Begin making SkPerlinNoiseShader const.

The overall goal is to make SkShader itself immutable (BUG=skia:1976).
The fields cannot yet be made constant, due to the constructor which
takes an SkReadBuffer. Other than that constructor, the fields are now
unchanged.

Remove setTileSize and initPaint. Merge initPaint with the constructor
of PaintingData, since it is only ever used on a new PaintingData.
Merge setTileSize with the SkPerlinNoiseShader constructor, its only
call site.

BUG=skia:1976
R=reed@google.com, sugoi@google.com, dominikg@chromium.org, senorblanco@google.com, senorblanco@chromium.org

Author: scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13682 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/effects/SkPerlinNoiseShader.h b/include/effects/SkPerlinNoiseShader.h
index dd89c70..497c0e0 100644
--- a/include/effects/SkPerlinNoiseShader.h
+++ b/include/effects/SkPerlinNoiseShader.h
@@ -79,28 +79,28 @@
 private:
     SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkScalar baseFrequencyX,
                         SkScalar baseFrequencyY, int numOctaves, SkScalar seed,
-                        const SkISize* tileSize = NULL);
+                        const SkISize* tileSize);
     virtual ~SkPerlinNoiseShader();
 
-    void setTileSize(const SkISize&);
-
-    void initPaint(PaintingData& paintingData);
-
     SkScalar noise2D(int channel, const PaintingData& paintingData,
-                     const StitchData& stitchData, const SkPoint& noiseVector);
+                     const StitchData& stitchData, const SkPoint& noiseVector) const;
 
     SkScalar calculateTurbulenceValueForPoint(int channel, const PaintingData& paintingData,
-                                              StitchData& stitchData, const SkPoint& point);
+                                              StitchData& stitchData, const SkPoint& point) const;
 
-    SkPMColor shade(const SkPoint& point, StitchData& stitchData);
+    SkPMColor shade(const SkPoint& point, StitchData& stitchData) const;
 
-    SkPerlinNoiseShader::Type fType;
-    SkScalar fBaseFrequencyX;
-    SkScalar fBaseFrequencyY;
-    int fNumOctaves;
-    SkScalar fSeed;
-    SkISize fTileSize;
-    bool fStitchTiles;
+    // TODO (scroggo): Once all SkShaders are created from a factory, and we have removed the
+    // constructor that creates SkPerlinNoiseShader from an SkReadBuffer, several fields can
+    // be made constant.
+    /*const*/ SkPerlinNoiseShader::Type fType;
+    /*const*/ SkScalar                  fBaseFrequencyX;
+    /*const*/ SkScalar                  fBaseFrequencyY;
+    /*const*/ int                       fNumOctaves;
+    /*const*/ SkScalar                  fSeed;
+    /*const*/ SkISize                   fTileSize;
+    /*const*/ bool                      fStitchTiles;
+    // TODO (scroggo): Once setContext creates a new object, place this on that object.
     SkMatrix fMatrix;
 
     PaintingData* fPaintingData;