diff options
author | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-07 16:47:43 +0000 |
---|---|---|
committer | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-07 16:47:43 +0000 |
commit | 05af1afd429808913683da75644e48bece12e820 (patch) | |
tree | b7f0ec33f2cbbb9312deb9e0e566c8bea4a97320 /src/effects/gradients | |
parent | 30454293fd4fae81238c582c18232692bff32b1e (diff) |
eliminate all warnings in non-thirdparty code on mac
Most of these issues were due to functions whose definitions appear in header files; I changed those functions to be 'static inline' instead of just 'static' or 'inline', which kills the warning for such functions.
Other functions that were static or anonymous-namespaced but were unused in cpp files were probably called at some point but are no longer; someone who knows more than I do should probably scrub all the functions I either deleted or #if 0'ed out and make sure that the right thing is happening here.
Lots of unused variables removed, and one nasty const issue handled.
There remains a single warning in thirdparty/externals/cityhash/src/city.cc on line 146 related to a signed/unsigned mismatch. I don't know if we have control over this library so I didn't fix this one, but perhaps someone could do something about that one.
BUG=
Review URL: https://codereview.appspot.com/7067044
git-svn-id: http://skia.googlecode.com/svn/trunk@7051 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/gradients')
-rw-r--r-- | src/effects/gradients/SkGradientShaderPriv.h | 6 | ||||
-rw-r--r-- | src/effects/gradients/SkLinearGradient.cpp | 25 |
2 files changed, 3 insertions, 28 deletions
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h index 829d153d77..1662188d05 100644 --- a/src/effects/gradients/SkGradientShaderPriv.h +++ b/src/effects/gradients/SkGradientShaderPriv.h @@ -24,7 +24,7 @@ #define USE_DITHER_32BIT_GRADIENT #endif -static void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1, +static inline void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1, int count) { if (count > 0) { if (v0 == v1) { @@ -44,13 +44,13 @@ static void sk_memset32_dither(uint32_t dst[], uint32_t v0, uint32_t v1, // Clamp -static SkFixed clamp_tileproc(SkFixed x) { +static inline SkFixed clamp_tileproc(SkFixed x) { return SkClampMax(x, 0xFFFF); } // Repeat -static SkFixed repeat_tileproc(SkFixed x) { +static inline SkFixed repeat_tileproc(SkFixed x) { return x & 0xFFFF; } diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index 71614505a1..2e80351cb6 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -120,23 +120,6 @@ typedef void (*LinearShadeProc)(TileProc proc, SkFixed dx, SkFixed fx, SkPMColor* dstC, const SkPMColor* cache, int toggle, int count); -// This function is deprecated, and will be replaced by -// shadeSpan_linear_vertical_lerp() once Chrome has been weaned off of it. -void shadeSpan_linear_vertical(TileProc proc, SkFixed dx, SkFixed fx, - SkPMColor* SK_RESTRICT dstC, - const SkPMColor* SK_RESTRICT cache, - int toggle, int count) { - // We're a vertical gradient, so no change in a span. - // If colors change sharply across the gradient, dithering is - // insufficient (it subsamples the color space) and we need to lerp. - unsigned fullIndex = proc(fx); - unsigned fi = fullIndex >> (16 - SkGradientShaderBase::kCache32Bits); - sk_memset32_dither(dstC, - cache[toggle + fi], - cache[(toggle ^ SkGradientShaderBase::kDitherStride32) + fi], - count); -} - // Linear interpolation (lerp) is unnecessary if there are no sharp // discontinuities in the gradient - which must be true if there are // only 2 colors - but it's cheap. @@ -256,15 +239,7 @@ void SkLinearGradient::shadeSpan(int x, int y, SkPMColor* SK_RESTRICT dstC, LinearShadeProc shadeProc = shadeSpan_linear_repeat; if (SkFixedNearlyZero(dx)) { -#ifdef SK_SIMPLE_TWOCOLOR_VERTICAL_GRADIENTS - if (fColorCount > 2) { - shadeProc = shadeSpan_linear_vertical_lerp; - } else { - shadeProc = shadeSpan_linear_vertical; - } -#else shadeProc = shadeSpan_linear_vertical_lerp; -#endif } else if (SkShader::kClamp_TileMode == fTileMode) { shadeProc = shadeSpan_linear_clamp; } else if (SkShader::kMirror_TileMode == fTileMode) { |