diff options
author | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 04:52:11 +0000 |
---|---|---|
committer | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 04:52:11 +0000 |
commit | cbad942609ba0c4b06bb2eccf5e84e255eee1340 (patch) | |
tree | 9cc9be88a55338d5fe67a429355e3f3a785b878b /skia/sgl | |
parent | 0b908c92984295229c4ebf3d9a04d0f3c631c127 (diff) | |
download | chromium_src-cbad942609ba0c4b06bb2eccf5e84e255eee1340.zip chromium_src-cbad942609ba0c4b06bb2eccf5e84e255eee1340.tar.gz chromium_src-cbad942609ba0c4b06bb2eccf5e84e255eee1340.tar.bz2 |
Clean up warnings in Skia (also sent upstream)
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/sgl')
-rw-r--r-- | skia/sgl/SkGeometry.cpp | 8 | ||||
-rw-r--r-- | skia/sgl/SkPaint.cpp | 20 | ||||
-rw-r--r-- | skia/sgl/SkScalerContext.cpp | 11 | ||||
-rw-r--r-- | skia/sgl/SkScan.h | 8 | ||||
-rw-r--r-- | skia/sgl/SkScan_Path.cpp | 2 | ||||
-rw-r--r-- | skia/sgl/SkUtils.cpp | 2 | ||||
-rw-r--r-- | skia/sgl/SkWriter32.cpp | 9 |
7 files changed, 8 insertions, 52 deletions
diff --git a/skia/sgl/SkGeometry.cpp b/skia/sgl/SkGeometry.cpp index 65022ce..3c72f4b 100644 --- a/skia/sgl/SkGeometry.cpp +++ b/skia/sgl/SkGeometry.cpp @@ -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. */ diff --git a/skia/sgl/SkPaint.cpp b/skia/sgl/SkPaint.cpp index 71aa230..ef23f09 100644 --- a/skia/sgl/SkPaint.cpp +++ b/skia/sgl/SkPaint.cpp @@ -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); diff --git a/skia/sgl/SkScalerContext.cpp b/skia/sgl/SkScalerContext.cpp index 5f4abfd..0289312 100644 --- a/skia/sgl/SkScalerContext.cpp +++ b/skia/sgl/SkScalerContext.cpp @@ -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; diff --git a/skia/sgl/SkScan.h b/skia/sgl/SkScan.h index c4cefeb..f5b12fb 100644 --- a/skia/sgl/SkScan.h +++ b/skia/sgl/SkScan.h @@ -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); diff --git a/skia/sgl/SkScan_Path.cpp b/skia/sgl/SkScan_Path.cpp index 4e58518..43a61bd 100644 --- a/skia/sgl/SkScan_Path.cpp +++ b/skia/sgl/SkScan_Path.cpp @@ -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 */ diff --git a/skia/sgl/SkUtils.cpp b/skia/sgl/SkUtils.cpp index d541a1d..94834fd 100644 --- a/skia/sgl/SkUtils.cpp +++ b/skia/sgl/SkUtils.cpp @@ -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) diff --git a/skia/sgl/SkWriter32.cpp b/skia/sgl/SkWriter32.cpp index 61d0051..819803f 100644 --- a/skia/sgl/SkWriter32.cpp +++ b/skia/sgl/SkWriter32.cpp @@ -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() |