0

Clean up warnings in Skia (also sent upstream)

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1209 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
mmentovai@google.com
2008-08-22 04:52:11 +00:00
parent 0b908c9298
commit cbad942609
13 changed files with 18 additions and 61 deletions

@ -1364,7 +1364,6 @@
baseConfigurationReference = 7BED30C70E59F63000A747DB /* staticlib.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
HEADER_SEARCH_PATHS = (
..,
../skia/include,
@ -1380,7 +1379,6 @@
baseConfigurationReference = 7BED30C70E59F63000A747DB /* staticlib.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Versions/A/Frameworks";
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
HEADER_SEARCH_PATHS = (
..,
../skia/include,

@ -80,7 +80,7 @@ SkInterpolatorBase::Result SkInterpolatorBase::timeToT(SkMSec time, SkScalar* T,
SkASSERT(fFrameCount > 0);
Result result = kNormal_Result;
if (fRepeat != SK_Scalar1) {
SkMSec startTime, endTime;
SkMSec startTime = 0, endTime = 0;
this->getDuration(&startTime, &endTime);
SkMSec totalTime = endTime - startTime;
SkMSec offsetTime = time - startTime;

@ -607,12 +607,15 @@ private:
typedef Gradient_Shader INHERITED;
};
#if 0
// Used by a section that's currently #if 0 Linear_Gradient::shadeSpan
// Return true if fx, fx+dx, fx+2*dx, ... is always in range
static bool no_need_for_clamp(int fx, int dx, int count)
{
SkASSERT(count > 0);
return (unsigned)((fx | (fx + (count - 1) * dx)) >> 8) <= 0xFF;
}
#endif
void Linear_Gradient::shadeSpan(int x, int y, SkPMColor dstC[], int count)
{

@ -402,7 +402,7 @@ typedef uint16_t SkPMColor16;
#define SkG32To4444(g) ((unsigned)(g) >> 4)
#define SkB32To4444(b) ((unsigned)(b) >> 4)
static U8CPU SkReplicateNibble(unsigned nib)
static inline U8CPU SkReplicateNibble(unsigned nib)
{
SkASSERT(nib <= 0xF);
return (nib << 4) | nib;
@ -618,7 +618,7 @@ static inline SkPMColor16 SkDitherPixel32To4444(SkPMColor c)
Transforms a normal ARGB_8888 into the same byte order as
expanded ARGB_4444, but keeps each component 8bits
*/
static uint32_t SkExpand_8888(SkPMColor c)
static inline uint32_t SkExpand_8888(SkPMColor c)
{
return (((c >> SK_R32_SHIFT) & 0xFF) << 24) |
(((c >> SK_G32_SHIFT) & 0xFF) << 8) |
@ -629,7 +629,7 @@ static uint32_t SkExpand_8888(SkPMColor c)
/* Undo the operation of SkExpand_8888, turning the argument back into
a SkPMColor.
*/
static SkPMColor SkCompact_8888(uint32_t c)
static inline SkPMColor SkCompact_8888(uint32_t c)
{
return (((c >> 24) & 0xFF) << SK_R32_SHIFT) |
(((c >> 8) & 0xFF) << SK_G32_SHIFT) |
@ -641,7 +641,7 @@ static SkPMColor SkCompact_8888(uint32_t c)
but this routine just keeps the high 4bits of each component in the low
4bits of the result (just like a newly expanded PMColor16).
*/
static uint32_t SkExpand32_4444(SkPMColor c)
static inline uint32_t SkExpand32_4444(SkPMColor c)
{
return (((c >> (SK_R32_SHIFT + 4)) & 0xF) << 24) |
(((c >> (SK_G32_SHIFT + 4)) & 0xF) << 8) |

@ -209,7 +209,7 @@ static inline U8CPU SkMulDiv255Round(U8CPU a, U8CPU b) {
/** Return a*b/((1 << shift) - 1), rounding any fractional bits.
Only valid if a and b are unsigned and <= 32767 and shift is > 0 and <= 8
*/
static unsigned SkMul16ShiftRound(unsigned a, unsigned b, int shift) {
static inline unsigned SkMul16ShiftRound(unsigned a, unsigned b, int shift) {
SkASSERT(a <= 32767);
SkASSERT(b <= 32767);
SkASSERT(shift > 0 && shift <= 8);

@ -48,7 +48,7 @@ enum DrawVertexFlags {
class SkRefCntPlayback {
public:
SkRefCntPlayback();
~SkRefCntPlayback();
virtual ~SkRefCntPlayback();
int count() const { return fCount; }

@ -260,14 +260,6 @@ static void flatten_double_quad_extrema(SkScalar coords[14])
coords[2] = coords[6] = coords[4];
}
static void force_quad_monotonic_in_y(SkPoint pts[3])
{
// zap pts[1].fY to the nearest value
SkScalar ab = SkScalarAbs(pts[0].fY - pts[1].fY);
SkScalar bc = SkScalarAbs(pts[1].fY - pts[2].fY);
pts[1].fY = ab < bc ? pts[0].fY : pts[2].fY;
}
/* Returns 0 for 1 quad, and 1 for two quads, either way the answer is
stored in dst[]. Guarantees that the 1/2 quads will be monotonic.
*/

@ -374,26 +374,6 @@ int SkPaint::textToGlyphs(const void* textData, size_t byteLength, uint16_t glyp
//////////////////////////////////////////////////////////////////////////////
static uint32_t sk_glyphID_next(const char** text)
{
const uint16_t* glyph = (const uint16_t*)text;
int32_t value = *glyph;
glyph += 1;
*text = (const char*)glyph;
return value;
}
static uint32_t sk_glyphID_prev(const char** text)
{
const uint16_t* glyph = (const uint16_t*)text;
glyph -= 1;
int32_t value = *glyph;
*text = (const char*)glyph;
return value;
}
//////////////////////////////////////////////////////////////////////////////
static const SkGlyph& sk_getMetrics_utf8_next(SkGlyphCache* cache, const char** text)
{
SkASSERT(cache != NULL);

@ -182,17 +182,6 @@ SkScalerContext* SkScalerContext::getGlyphContext(const SkGlyph& glyph) const {
return ctx;
}
static int plus_minus_pin(int value, int max) {
SkASSERT(max >= 0);
if (value > max) {
value = max;
} else if (value < -max) {
value = -max;
}
return value;
}
void SkScalerContext::getAdvance(SkGlyph* glyph) {
// mark us as just having a valid advance
glyph->fMaskFormat = MASK_FORMAT_JUST_ADVANCE;

@ -83,7 +83,7 @@ public:
from int to SkFixed. Does not check for overflow if the src coordinates
exceed 32K
*/
static void XRect_set(SkXRect* xr, const SkIRect& src) {
static inline void XRect_set(SkXRect* xr, const SkIRect& src) {
xr->fLeft = SkIntToFixed(src.fLeft);
xr->fTop = SkIntToFixed(src.fTop);
xr->fRight = SkIntToFixed(src.fRight);
@ -94,7 +94,7 @@ static void XRect_set(SkXRect* xr, const SkIRect& src) {
from SkScalar to SkFixed. Does not check for overflow if the src coordinates
exceed 32K
*/
static void XRect_set(SkXRect* xr, const SkRect& src) {
static inline void XRect_set(SkXRect* xr, const SkRect& src) {
xr->fLeft = SkScalarToFixed(src.fLeft);
xr->fTop = SkScalarToFixed(src.fTop);
xr->fRight = SkScalarToFixed(src.fRight);
@ -103,7 +103,7 @@ static void XRect_set(SkXRect* xr, const SkRect& src) {
/** Round the SkXRect coordinates, and store the result in the SkIRect.
*/
static void XRect_round(const SkXRect& xr, SkIRect* dst) {
static inline void XRect_round(const SkXRect& xr, SkIRect* dst) {
dst->fLeft = SkFixedRound(xr.fLeft);
dst->fTop = SkFixedRound(xr.fTop);
dst->fRight = SkFixedRound(xr.fRight);
@ -113,7 +113,7 @@ static void XRect_round(const SkXRect& xr, SkIRect* dst) {
/** Round the SkXRect coordinates out (i.e. use floor for left/top, and ceiling
for right/bottom), and store the result in the SkIRect.
*/
static void XRect_roundOut(const SkXRect& xr, SkIRect* dst) {
static inline void XRect_roundOut(const SkXRect& xr, SkIRect* dst) {
dst->fLeft = SkFixedFloor(xr.fLeft);
dst->fTop = SkFixedFloor(xr.fTop);
dst->fRight = SkFixedCeil(xr.fRight);

@ -387,6 +387,7 @@ static SkEdge* sort_edges(SkEdge* list[], int count, SkEdge** last)
return list[0];
}
#ifdef SK_DEBUG
/* 'quick' computation of the max sized needed to allocated for
our edgelist.
*/
@ -422,6 +423,7 @@ static int worst_case_edge_count(const SkPath& path, size_t* storage)
*storage = size;
return edgeCount;
}
#endif
/* Much faster than worst_case_edge_count, but over estimates even more
*/

@ -427,10 +427,12 @@ size_t SkUTF16_ToUTF8(const uint16_t utf16[], int numberOf16BitValues, char utf8
#include <stdlib.h>
#if 0
static int round_to_K(size_t bytes)
{
return (bytes + 512) >> 10;
}
#endif
SkAutoMemoryUsageProbe::SkAutoMemoryUsageProbe(const char label[])
: fLabel(label)

@ -37,15 +37,6 @@ struct SkWriter32::Block {
}
};
static size_t compute_block_size(size_t currSize, size_t minSize)
{
if (currSize < minSize)
currSize = minSize;
currSize += (currSize >> 1);
return SkAlign4(currSize);
}
///////////////////////////////////////////////////////////////////////////////
SkWriter32::~SkWriter32()