Enable unused param checking for public includes.

This CL cleans up the existing violations and enables the
build time check to ensure that we don't regress.

The motiviation behind this change is to allow clients who include
our headers to be able to build with this warning enabled.

Review URL: https://codereview.chromium.org/726923002
diff --git a/gyp/tools.gyp b/gyp/tools.gyp
index 30e3e9e..23790a6 100644
--- a/gyp/tools.gyp
+++ b/gyp/tools.gyp
@@ -628,7 +628,9 @@
     {
       'target_name': 'test_public_includes',
       'type': 'static_library',
-      #'cflags!': [ '-Wno-unused-parameter' ],
+      # Ensure that our public headers don't have unused params so that clients
+      # (e.g. Android) that include us can build with these warnings enabled
+      'cflags!': [ '-Wno-unused-parameter' ],
       'variables': {
         'includes_to_test': [
           '<(skia_include_path)/animator',
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 0cb762a..276b392 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1078,7 +1078,7 @@
         subclasses like SkPicture's recording canvas, that can store the data
         and then play it back later (via another call to drawData).
      */
-    virtual void drawData(const void* data, size_t length) {
+    virtual void drawData(const void* /*data*/, size_t /*length*/) {
         // do nothing. Subclasses may do something with the data
     }
 
@@ -1086,10 +1086,10 @@
         Each comment added via addComment is notionally attached to its
         enclosing group. Top-level comments simply belong to no group.
      */
-    virtual void beginCommentGroup(const char* description) {
+    virtual void beginCommentGroup(const char* /*description*/) {
         // do nothing. Subclasses may do something
     }
-    virtual void addComment(const char* kywd, const char* value) {
+    virtual void addComment(const char* /*kywd*/, const char* /*value*/) {
         // do nothing. Subclasses may do something
     }
     virtual void endCommentGroup() {
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 43cb32c..471a76b 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -281,8 +281,8 @@
      *  it just returns false and leaves result and offset unchanged.
      */
     virtual bool filterImage(const SkImageFilter*, const SkBitmap&,
-                             const SkImageFilter::Context& ctx,
-                             SkBitmap* result, SkIPoint* offset) {
+                             const SkImageFilter::Context&,
+                             SkBitmap* /*result*/, SkIPoint* /*offset*/) {
         return false;
     }
 
@@ -352,7 +352,7 @@
         const SkPixelGeometry fPixelGeometry;
     };
 
-    virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo& cinfo) {
+    virtual SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) {
         return NULL;
     }
 
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index 21077cc..b384708 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -348,13 +348,13 @@
 
     // If the decoder wants to support tiled based decoding,
     // this method must be overridden. This guy is called by buildTileIndex(...)
-    virtual bool onBuildTileIndex(SkStreamRewindable*, int *width, int *height) {
+    virtual bool onBuildTileIndex(SkStreamRewindable*, int* /*width*/, int* /*height*/) {
         return false;
     }
 
     // If the decoder wants to support tiled based decoding,
     // this method must be overridden. This guy is called by decodeRegion(...)
-    virtual bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) {
+    virtual bool onDecodeSubset(SkBitmap*, const SkIRect&) {
         return false;
     }
 
@@ -364,8 +364,9 @@
         updates componentSizes to the final image size.
         Returns whether the decoding was successful.
     */
-    virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], void* planes[3],
-                                    size_t rowBytes[3], SkYUVColorSpace*) {
+    virtual bool onDecodeYUV8Planes(SkStream*, SkISize[3] /*componentSizes*/,
+                                    void*[3] /*planes*/, size_t[3] /*rowBytes*/,
+                                    SkYUVColorSpace*) {
         return false;
     }
 
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 02d696e..6f0421e 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -247,7 +247,7 @@
      *          not be created with the given config), or this PixelRef does not support deep
      *          copies.
      */
-    virtual SkPixelRef* deepCopy(SkColorType colortype, const SkIRect* subset) {
+    virtual SkPixelRef* deepCopy(SkColorType, const SkIRect* /*subset*/) {
         return NULL;
     }
 
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index 0fbc1b8..1515118 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -366,7 +366,7 @@
         const SkXfermode*   fMode;
     };
 
-    virtual bool asACompose(ComposeRec* rec) const { return false; }
+    virtual bool asACompose(ComposeRec*) const { return false; }
 
 
     /**
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index 8e3f375..913286b 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -102,13 +102,13 @@
      *  If an attempt is made to seek past the end of the stream, the position will be set
      *  to the end of the stream.
      */
-    virtual bool seek(size_t position) { return false; }
+    virtual bool seek(size_t /*position*/) { return false; }
 
     /** Seeks to an relative offset in the stream. If this cannot be done, returns false.
      *  If an attempt is made to move to a position outside the stream, the position will be set
      *  to the closest point within the stream (beginning or end).
      */
-    virtual bool move(long offset) { return false; }
+    virtual bool move(long /*offset*/) { return false; }
 
     /** Duplicates this stream. If this cannot be done, returns NULL.
      *  The returned stream will be positioned the same as this stream.
diff --git a/include/core/SkTArray.h b/include/core/SkTArray.h
index 06a85bc..9de2117 100644
--- a/include/core/SkTArray.h
+++ b/include/core/SkTArray.h
@@ -464,7 +464,7 @@
 
 // Use the below macro (SkNEW_APPEND_TO_TARRAY) rather than calling this directly
 template <typename T, bool MEM_COPY>
-void* operator new(size_t, SkTArray<T, MEM_COPY>* array, int atIndex) {
+void* operator new(size_t, SkTArray<T, MEM_COPY>* array, int SkDEBUGCODE(atIndex)) {
     // Currently, we only support adding to the end of the array. When the array class itself
     // supports random insertion then this should be updated.
     // SkASSERT(atIndex >= 0 && atIndex <= array->count());
@@ -476,7 +476,7 @@
 // to match the op new silences warnings about missing op delete when a constructor throws an
 // exception.
 template <typename T, bool MEM_COPY>
-void operator delete(void*, SkTArray<T, MEM_COPY>* array, int atIndex) {
+void operator delete(void*, SkTArray<T, MEM_COPY>* /*array*/, int /*atIndex*/) {
     SK_CRASH();
 }
 
diff --git a/include/effects/SkGradientShader.h b/include/effects/SkGradientShader.h
index 8d1a931..2d2fefe 100644
--- a/include/effects/SkGradientShader.h
+++ b/include/effects/SkGradientShader.h
@@ -58,7 +58,7 @@
 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES
     static SkShader* CreateLinear(const SkPoint pts[2],
                                   const SkColor colors[], const SkScalar pos[], int count,
-                                  SkShader::TileMode mode, void* ignored,
+                                  SkShader::TileMode mode, void* /*ignored*/,
                                   uint32_t flags, const SkMatrix* localMatrix) {
         return CreateLinear(pts, colors, pos, count, mode, flags, localMatrix);
     }
@@ -94,7 +94,7 @@
 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES
     static SkShader* CreateRadial(const SkPoint& center, SkScalar radius,
                                   const SkColor colors[], const SkScalar pos[], int count,
-                                  SkShader::TileMode mode, void* ignored,
+                                  SkShader::TileMode mode, void* /*ignored*/,
                                   uint32_t flags, const SkMatrix* localMatrix) {
         return CreateRadial(center, radius, colors, pos, count, mode, flags, localMatrix);
     }
@@ -137,7 +137,7 @@
     static SkShader* CreateTwoPointRadial(const SkPoint& start, SkScalar startRadius,
                                           const SkPoint& end, SkScalar endRadius,
                                           const SkColor colors[], const SkScalar pos[], int count,
-                                          SkShader::TileMode mode, void* ignored,
+                                          SkShader::TileMode mode, void* /*ignored*/,
                                           uint32_t flags, const SkMatrix* localMatrix) {
         return CreateTwoPointRadial(start, startRadius, end, endRadius, colors, pos, count, mode,
                                     flags, localMatrix);
@@ -168,7 +168,7 @@
     static SkShader* CreateTwoPointConical(const SkPoint& start, SkScalar startRadius,
                                            const SkPoint& end, SkScalar endRadius,
                                            const SkColor colors[], const SkScalar pos[], int count,
-                                           SkShader::TileMode mode, void* ignored,
+                                           SkShader::TileMode mode, void* /*ignored*/,
                                            uint32_t flags, const SkMatrix* localMatrix) {
         return CreateTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode,
                                     flags, localMatrix);
@@ -202,7 +202,7 @@
 #ifdef SK_SUPPORT_LEGACY_GRADIENT_FACTORIES
     static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
                                  const SkColor colors[], const SkScalar pos[], int count,
-                                 void* ignored,
+                                 void* /*ignored*/,
                                  uint32_t flags, const SkMatrix* localMatrix) {
         return CreateSweep(cx, cy, colors, pos, count, flags, localMatrix);
     }
diff --git a/include/gpu/GrColor.h b/include/gpu/GrColor.h
index 3470c88..bd949ce 100644
--- a/include/gpu/GrColor.h
+++ b/include/gpu/GrColor.h
@@ -66,7 +66,7 @@
 /**
  * Assert in debug builds that a GrColor is premultiplied.
  */
-static inline void GrColorIsPMAssert(GrColor c) {
+static inline void GrColorIsPMAssert(GrColor SkDEBUGCODE(c)) {
 #ifdef SK_DEBUG
     unsigned a = GrColorUnpackA(c);
     unsigned r = GrColorUnpackR(c);
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 97acda1..ccc07c7 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -827,7 +827,7 @@
             kWideOpen_InitialClip,
         };
 
-        AutoClip(GrContext* context, InitialClip initialState)
+        AutoClip(GrContext* context, InitialClip SkDEBUGCODE(initialState))
         : fContext(context) {
             SkASSERT(kWideOpen_InitialClip == initialState);
             fNewClipData.fClipStack = &fNewClipStack;
diff --git a/include/ports/SkFontConfigInterface.h b/include/ports/SkFontConfigInterface.h
index c596267..7a77b16 100644
--- a/include/ports/SkFontConfigInterface.h
+++ b/include/ports/SkFontConfigInterface.h
@@ -105,8 +105,8 @@
     // New APIS, which have default impls for now (which do nothing)
 
     virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); }
-    virtual bool matchFamilySet(const char inFamilyName[],
-                                SkString* outFamilyName,
+    virtual bool matchFamilySet(const char[] /*inFamilyName*/,
+                                SkString* /*outFamilyName*/,
                                 SkTArray<FontIdentity>*) {
         return false;
     }
diff --git a/include/utils/SkCamera.h b/include/utils/SkCamera.h
index b515be9..4b77ec6 100644
--- a/include/utils/SkCamera.h
+++ b/include/utils/SkCamera.h
@@ -84,8 +84,8 @@
     }
 
     // deprecated, but still here for animator (for now)
-    void rotate(SkScalar x, SkScalar y, SkScalar z) {}
-    void rotateDegrees(SkScalar x, SkScalar y, SkScalar z) {}
+    void rotate(SkScalar /*x*/, SkScalar /*y*/, SkScalar /*z*/) {}
+    void rotateDegrees(SkScalar /*x*/, SkScalar /*y*/, SkScalar /*z*/) {}
 
 private:
 public: // make public for SkDraw3D for now
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index 5f781f8..69c8c3e 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -222,8 +222,7 @@
          *  @param newAllocatedStorage same value as would be returned by
          *      storageAllocatedForRecording(), for convenience.
          */
-        virtual void storageAllocatedForRecordingChanged(
-            size_t newAllocatedStorage) {}
+        virtual void storageAllocatedForRecordingChanged(size_t /*newAllocatedStorage*/) {}
 
         /**
          *  Called after pending draw commands have been flushed
diff --git a/include/views/SkView.h b/include/views/SkView.h
index c083cf1..db71231 100644
--- a/include/views/SkView.h
+++ b/include/views/SkView.h
@@ -337,12 +337,12 @@
     //! called once before all of the children are drawn (or clipped/translated)
     virtual SkCanvas* beforeChildren(SkCanvas* c) { return c; }
     //! called once after all of the children are drawn (or clipped/translated)
-    virtual void afterChildren(SkCanvas* orig) {}
+    virtual void afterChildren(SkCanvas*) {}
 
     //! called right before this child's onDraw is called
-    virtual void beforeChild(SkView* child, SkCanvas* canvas) {}
+    virtual void beforeChild(SkView* /*child*/, SkCanvas*) {}
     //! called right after this child's onDraw is called
-    virtual void afterChild(SkView* child, SkCanvas* canvas) {}
+    virtual void afterChild(SkView* /*child*/, SkCanvas*) {}
 
     /** Override this if you might handle the click
     */