More clang warning fixes.

Mostly unused functions and variables removed.

BUG=None
TEST=ninja -C out/Debug most
     ninja -C out/Release most

R=bsalomon@google.com, caryclark@google.com, robertphillips@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/27933002

git-svn-id: http://skia.googlecode.com/svn/trunk@11884 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 5b69b57..2d86c2d 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -147,21 +147,11 @@
     typedef SkBenchmark INHERITED;
 };
 
-static inline SkIRect make_simple_rect(SkRandom&, int index, int numRects) {
-    SkIRect out = {0, 0, GENERATE_EXTENTS, GENERATE_EXTENTS};
-    return out;
-}
-
 static inline SkIRect make_concentric_rects_increasing(SkRandom&, int index, int numRects) {
     SkIRect out = {0, 0, index + 1, index + 1};
     return out;
 }
 
-static inline SkIRect make_concentric_rects_decreasing(SkRandom&, int index, int numRects) {
-    SkIRect out = {0, 0, numRects - index, numRects - index};
-    return out;
-}
-
 static inline SkIRect make_XYordered_rects(SkRandom& rand, int index, int numRects) {
     SkIRect out;
     out.fLeft = index % GRID_WIDTH;
@@ -179,15 +169,6 @@
     return out;
 }
 
-static inline SkIRect make_point_rects(SkRandom& rand, int index, int numRects) {
-    SkIRect out;
-    out.fLeft   = rand.nextU() % GENERATE_EXTENTS;
-    out.fTop    = rand.nextU() % GENERATE_EXTENTS;
-    out.fRight  = out.fLeft + (GENERATE_EXTENTS / 200);
-    out.fBottom = out.fTop + (GENERATE_EXTENTS / 200);
-    return out;
-}
-
 static inline SkIRect make_random_rects(SkRandom& rand, int index, int numRects) {
     SkIRect out;
     out.fLeft   = rand.nextS() % GENERATE_EXTENTS;
@@ -197,15 +178,6 @@
     return out;
 }
 
-static inline SkIRect make_large_rects(SkRandom& rand, int index, int numRects) {
-    SkIRect out;
-    out.fLeft   = rand.nextU() % GENERATE_EXTENTS;
-    out.fTop    = rand.nextU() % GENERATE_EXTENTS;
-    out.fRight  = out.fLeft + (GENERATE_EXTENTS / 3);
-    out.fBottom = out.fTop  + (GENERATE_EXTENTS / 3);
-    return out;
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 
 DEF_BENCH(
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index ae20a8d..5d840a0 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -206,8 +206,6 @@
 static const GLContextType kNative = GrContextFactory::kNative_GLContextType;
 #if SK_ANGLE
 static const GLContextType kANGLE  = GrContextFactory::kANGLE_GLContextType;
-#else
-static const GLContextType kANGLE  = kNative;
 #endif
 static const GLContextType kDebug  = GrContextFactory::kDebug_GLContextType;
 static const GLContextType kNull   = GrContextFactory::kNull_GLContextType;
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp
index 9669e6f..a9d591a 100644
--- a/src/core/SkAAClip.cpp
+++ b/src/core/SkAAClip.cpp
@@ -36,9 +36,11 @@
 
 #define kMaxInt32   0x7FFFFFFF
 
+#ifdef SK_DEBUG
 static inline bool x_in_rect(int x, const SkIRect& rect) {
     return (unsigned)(x - rect.fLeft) < (unsigned)rect.width();
 }
+#endif
 
 static inline bool y_in_rect(int y, const SkIRect& rect) {
     return (unsigned)(y - rect.fTop) < (unsigned)rect.height();
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index ad6e061..2292929 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -230,9 +230,12 @@
     devBounds->growToInclude(pt.fX, pt.fY);
 }
 
+#ifdef SK_DEBUG
 static inline bool contains_inclusive(const SkRect& rect, const SkPoint& p) {
     return p.fX >= rect.fLeft && p.fX <= rect.fRight && p.fY >= rect.fTop && p.fY <= rect.fBottom;
 }
+#endif
+
 static inline void add_quad_segment(const SkPoint pts[3],
                                     SegmentArray* segments,
                                     SkRect* devBounds) {
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index dca5874..26ce82a 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1691,16 +1691,6 @@
     return fGpu->caps()->isConfigRenderable(config, withMSAA);
 }
 
-static inline intptr_t setOrClear(intptr_t bits, int shift, intptr_t pred) {
-    intptr_t mask = 1 << shift;
-    if (pred) {
-        bits |= mask;
-    } else {
-        bits &= ~mask;
-    }
-    return bits;
-}
-
 void GrContext::setupDrawBuffer() {
     SkASSERT(NULL == fDrawBuffer);
     SkASSERT(NULL == fDrawBufferVBAllocPool);
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 108979d..adbfc35 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -15,13 +15,9 @@
 #include "SkStrokeRec.h"
 #include "SkTemplates.h"
 
-static const GrGLuint GR_MAX_GLUINT = ~0U;
-static const GrGLint  GR_INVAL_GLINT = ~0;
-
 #define GL_CALL(X) GR_GL_CALL(this->glInterface(), X)
 #define GL_CALL_RET(RET, X) GR_GL_CALL_RET(this->glInterface(), RET, X)
 
-
 #define SKIP_CACHE_CHECK    true
 
 #if GR_GL_CHECK_ALLOC_WITH_GET_ERROR
diff --git a/tests/BlitRowTest.cpp b/tests/BlitRowTest.cpp
index 2b7d94a..3903efb 100644
--- a/tests/BlitRowTest.cpp
+++ b/tests/BlitRowTest.cpp
@@ -12,10 +12,6 @@
 #include "SkGradientShader.h"
 #include "SkRect.h"
 
-static inline const char* boolStr(bool value) {
-    return value ? "true" : "false";
-}
-
 // these are in the same order as the SkBitmap::Config enum
 static const char* gConfigName[] = {
     "None", "A1", "A8", "Index8", "565", "4444", "8888", "RLE_Index8"
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 24c3348..6d9fa1a 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -94,8 +94,6 @@
 
 static const int kWidth = 2;
 static const int kHeight = 2;
-// Maximum stream length for picture serialization
-static const size_t kMaxPictureBufferSize = 1024;
 
 // Format strings that describe the test context.  The %s token is where
 // the name of the test step is inserted.  The context is required for
@@ -109,28 +107,18 @@
     "Drawing test step %s with SkPicture";
 static const char* const kPictureSecondDrawAssertMessageFormat =
     "Duplicate draw of test step %s with SkPicture";
-static const char* const kPictureReDrawAssertMessageFormat =
-    "Playing back test step %s from an SkPicture to another SkPicture";
 static const char* const kDeferredDrawAssertMessageFormat =
     "Drawing test step %s with SkDeferredCanvas";
 static const char* const kProxyDrawAssertMessageFormat =
     "Drawing test step %s with SkProxyCanvas";
 static const char* const kNWayDrawAssertMessageFormat =
     "Drawing test step %s with SkNWayCanvas";
-static const char* const kRoundTripAssertMessageFormat =
-    "test step %s, SkPicture consistency after round trip";
-static const char* const kPictureRecoringAssertMessageFormat =
-    "test step %s, SkPicture state consistency after recording";
-static const char* const kPicturePlaybackAssertMessageFormat =
-    "test step %s, SkPicture state consistency in playback canvas";
 static const char* const kDeferredPreFlushAssertMessageFormat =
     "test step %s, SkDeferredCanvas state consistency before flush";
 static const char* const kDeferredPostFlushPlaybackAssertMessageFormat =
     "test step %s, SkDeferredCanvas playback canvas state consistency after flush";
 static const char* const kDeferredPostSilentFlushPlaybackAssertMessageFormat =
     "test step %s, SkDeferredCanvas playback canvas state consistency after silent flush";
-static const char* const kDeferredPostFlushAssertMessageFormat =
-    "test step %s, SkDeferredCanvas state consistency after flush";
 static const char* const kPictureResourceReuseMessageFormat =
     "test step %s, SkPicture duplicate flattened object test";
 static const char* const kProxyStateAssertMessageFormat =
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index c16220e..04b48b6 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -858,29 +858,6 @@
     region->op(elemRegion, element.getOp());
 }
 
-// This can assist with debugging the clip stack reduction code when the test below fails.
-static inline void print_clip(const SkClipStack::Element& element) {
-    static const char* kOpStrs[] = {
-        "DF",
-        "IS",
-        "UN",
-        "XR",
-        "RD",
-        "RP",
-    };
-    if (SkClipStack::Element::kEmpty_Type != element.getType()) {
-        const SkRect& bounds = element.getBounds();
-        bool isRect = SkClipStack::Element::kRect_Type == element.getType();
-        SkDebugf("%s %s %s [%f %f] x [%f %f]\n",
-                 kOpStrs[element.getOp()],
-                 (isRect ? "R" : "P"),
-                 (element.isInverseFilled() ? "I" : " "),
-                 bounds.fLeft, bounds.fRight, bounds.fTop, bounds.fBottom);
-    } else {
-        SkDebugf("EM\n");
-    }
-}
-
 static void test_reduced_clip_stack(skiatest::Reporter* reporter) {
     // We construct random clip stacks, reduce them, and then rasterize both versions to verify that
     // they are equal.
diff --git a/tests/ColorTest.cpp b/tests/ColorTest.cpp
index a720ff4..30dad88 100644
--- a/tests/ColorTest.cpp
+++ b/tests/ColorTest.cpp
@@ -16,108 +16,6 @@
 #define GetPackedG16As32(packed)    (SkGetPackedG16(dc) << (8 - SK_G16_BITS))
 #define GetPackedB16As32(packed)    (SkGetPackedB16(dc) << (8 - SK_B16_BITS))
 
-static inline bool S32A_D565_Blend_0(SkPMColor sc, uint16_t dc, U8CPU alpha) {
-    unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
-    unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetPackedR16(dc), dst_scale);
-    unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetPackedG16(dc), dst_scale);
-
-    unsigned rr = SkDiv255Round(dr);
-    unsigned rg = SkDiv255Round(dg);
-
-    if (rr <= 31 && rg <= 63) {
-        return true;
-    }
-    return false;
-}
-
-static inline bool S32A_D565_Blend_01(SkPMColor sc, uint16_t dc, U8CPU alpha) {
-    unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
-    unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(SkGetPackedR16(dc) << 3, dst_scale);
-    unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(SkGetPackedG16(dc) << 2, dst_scale);
-
-    unsigned rr = SkDiv255Round(dr) >> 3;
-    unsigned rg = SkDiv255Round(dg) >> 2;
-
-    if (rr <= 31 && rg <= 63) {
-        return true;
-    }
-    return false;
-}
-
-static inline bool S32A_D565_Blend_02(SkPMColor sc, uint16_t dc, U8CPU alpha) {
-    unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
-    unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(GetPackedR16As32(dc), dst_scale);
-    unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(GetPackedG16As32(dc), dst_scale);
-    unsigned db = SkMulS16(SkGetPackedB32(sc), alpha) + SkMulS16(GetPackedB16As32(dc), dst_scale);
-    int rc = SkPack888ToRGB16(SkDiv255Round(dr),
-                              SkDiv255Round(dg),
-                              SkDiv255Round(db));
-
-    unsigned rr = SkGetPackedR16(rc);
-    unsigned rg = SkGetPackedG16(rc);
-
-    if (rr <= 31 && rg <= 63) {
-        return true;
-    }
-    return false;
-}
-
-static inline bool S32A_D565_Blend_1(SkPMColor sc, uint16_t dc, U8CPU alpha) {
-    unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha);
-    unsigned dr = (SkMulS16(SkGetPackedR32(sc), alpha) >> 3) + SkMulS16(SkGetPackedR16(dc), dst_scale);
-    unsigned dg = (SkMulS16(SkGetPackedG32(sc), alpha) >> 2) + SkMulS16(SkGetPackedG16(dc), dst_scale);
-
-    unsigned rr = SkDiv255Round(dr);
-    unsigned rg = SkDiv255Round(dg);
-
-    if (rr <= 31 && rg <= 63) {
-        return true;
-    }
-    return false;
-}
-
-static inline int SkDiv65025Round(int x) {
-    return (x + 65025/2) / 65025;
-//    return x / 65025;
-}
-static inline bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) {
-    unsigned dst_scale = 255*255 - SkGetPackedA32(sc) * alpha;
-    alpha *= 255;
-    unsigned dr = (SkGetPackedR32(sc) >> 3) * alpha + SkGetPackedR16(dc) * dst_scale;
-    unsigned dg = (SkGetPackedG32(sc) >> 2) * alpha + SkGetPackedG16(dc) * dst_scale;
-
-    unsigned rr = SkDiv65025Round(dr);
-    unsigned rg = SkDiv65025Round(dg);
-
-    if (rr <= 31 && rg <= 63) {
-        return true;
-    }
-    return false;
-}
-
-static inline void test_565blend() {
-    int total_failures = 0;
-    for (int global_alpha = 0; global_alpha <= 255; ++global_alpha) {
-        int failures = 0;
-        int total = 0;
-        for (int src_a = 0; src_a <= 255; ++src_a) {
-            for (int src_c = 0; src_c <= src_a; ++src_c) {
-                SkPMColor sc = SkPackARGB32(src_a, src_c, src_c, src_c);
-                for (int dst_r = 0; dst_r <= 31; ++dst_r) {
-                    for (int dst_g = 0; dst_g <= 63; ++dst_g) {
-                        uint16_t dc = SkPackRGB16(dst_r, dst_g, dst_r);
-                        failures += !S32A_D565_Blend_0(sc, dc, global_alpha);
-                        total += 1;
-                    }
-                }
-            }
-        }
-        SkDebugf("global_alpha=%d failures=%d total=%d %g\n", global_alpha, failures, total, failures * 100.0 / total);
-        total_failures += failures;
-    }
-    SkDebugf("total failures %d\n", total_failures);
-}
-
 static inline void test_premul(skiatest::Reporter* reporter) {
     for (int a = 0; a <= 255; a++) {
         for (int x = 0; x <= 255; x++) {
diff --git a/tests/PathOpsAngleTest.cpp b/tests/PathOpsAngleTest.cpp
index 7f5e456..fed74d3 100644
--- a/tests/PathOpsAngleTest.cpp
+++ b/tests/PathOpsAngleTest.cpp
@@ -62,7 +62,7 @@
     SkPoint endPt;
 };
 
-static const SortSet set1[] = {
+/*static const SortSet set1[] = {
     {cubics[0], 4, 0.66666987081928919, 0.875, {0, 0}},
     {lines[0], 2, 0.574070336, 0.388888889, {0, 0}},
     {cubics[0], 4, 0.66666987081928919, 0.4050371120499307, {0, 0}},
@@ -72,7 +72,7 @@
 static const SortSet set1a[] = {
     {cubics[0], 4, 0.666666667, 0.405037112, {4.58007812f,2.83203125f}},
     {lines[0], 2, 0.574074074, 0.9140625, {4.44444466f,2.77777767f}},
-};
+};*/
 
 static const SortSet set2[] = {
     {cubics[0], 4, 0.666666667, 0.875, {0, 0}},
@@ -86,10 +86,10 @@
     {quads[0], 3, 1, 0, {0, 0}},
 };
 
-static const SortSet set4[] = {
+/*static const SortSet set4[] = {
     {cubics[2], 4, 0.812114222, 1, {0, 0}},
     {cubics[3], 4, 0.0684734759, 0, {0, 0}},
-};
+};*/
 
 static const SortSet set5[] = {
     {lines[1], 2, 0.777777778, 1, {0, 0}},
@@ -183,11 +183,11 @@
     {quads[2], 3, 0.5, 0.7, {0, 0}},
 };
 
-static const SortSet set15[] = {
+/*static const SortSet set15[] = {
     {cubics[14], 4, 0.93081374, 1, {0, 0}},
     {cubics[15], 4, 0.188518131, 0, {0, 0}},
     {cubics[14], 4, 0.93081374, 0, {0, 0}},
-};
+};*/
 
 static const SortSet set16[] = {
     {cubics[17], 4, 0.0682619216, 0, {130.042755f,11417.4131f}},