Make perlin noise do CTM-correct scaling.

When drawing perlin noise, generate noise at the resolution determined
by CTM, not by the resolution at construction time. This required moving
the generation of PaintingData to getContext() and asNewEffect() for the
raster and GPU paths, respectively.

It also required adjusting the matrices used during rendering
to be translate-only.

R=sugoi@chromium.org, bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/358903002
diff --git a/include/effects/SkPerlinNoiseShader.h b/include/effects/SkPerlinNoiseShader.h
index 96cad46..2d9dfdd 100644
--- a/include/effects/SkPerlinNoiseShader.h
+++ b/include/effects/SkPerlinNoiseShader.h
@@ -23,9 +23,9 @@
     http://www.w3.org/TR/SVG/filters.html#feTurbulenceElement
 */
 class SK_API SkPerlinNoiseShader : public SkShader {
-    struct PaintingData;
 public:
     struct StitchData;
+    struct PaintingData;
 
     /**
      *  About the noise types : the difference between the 2 is just minor tweaks to the algorithm,
@@ -77,7 +77,7 @@
     class PerlinNoiseShaderContext : public SkShader::Context {
     public:
         PerlinNoiseShaderContext(const SkPerlinNoiseShader& shader, const ContextRec&);
-        virtual ~PerlinNoiseShaderContext() {}
+        virtual ~PerlinNoiseShaderContext();
 
         virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE;
         virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRIDE;
@@ -85,12 +85,13 @@
     private:
         SkPMColor shade(const SkPoint& point, StitchData& stitchData) const;
         SkScalar calculateTurbulenceValueForPoint(
-            int channel, const PaintingData& paintingData,
+            int channel,
             StitchData& stitchData, const SkPoint& point) const;
-        SkScalar noise2D(int channel, const PaintingData& paintingData,
+        SkScalar noise2D(int channel,
                          const StitchData& stitchData, const SkPoint& noiseVector) const;
 
         SkMatrix fMatrix;
+        PaintingData* fPaintingData;
 
         typedef SkShader::Context INHERITED;
     };
@@ -123,8 +124,6 @@
     /*const*/ SkISize                   fTileSize;
     /*const*/ bool                      fStitchTiles;
 
-    PaintingData* fPaintingData;
-
     typedef SkShader INHERITED;
 };