aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkPerlinNoiseShader.h
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-06 15:13:53 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-06 15:13:53 +0000
commitfd5c9a6e04ba31a82670d281b03b9c4a3f9b6e3c (patch)
tree2dba99da01f2d38ecd5a325540154c6f2de9b7c5 /include/effects/SkPerlinNoiseShader.h
parent5b70e7e2df94410e7e3ceeb6e54f4ebe72b87b7d (diff)
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
Diffstat (limited to 'include/effects/SkPerlinNoiseShader.h')
-rw-r--r--include/effects/SkPerlinNoiseShader.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/include/effects/SkPerlinNoiseShader.h b/include/effects/SkPerlinNoiseShader.h
index dd89c70925..497c0e0e8c 100644
--- a/include/effects/SkPerlinNoiseShader.h
+++ b/include/effects/SkPerlinNoiseShader.h
@@ -79,28 +79,28 @@ protected:
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);
-
- SkPMColor shade(const SkPoint& point, StitchData& stitchData);
-
- SkPerlinNoiseShader::Type fType;
- SkScalar fBaseFrequencyX;
- SkScalar fBaseFrequencyY;
- int fNumOctaves;
- SkScalar fSeed;
- SkISize fTileSize;
- bool fStitchTiles;
+ StitchData& stitchData, const SkPoint& point) const;
+
+ SkPMColor shade(const SkPoint& point, StitchData& stitchData) const;
+
+ // 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;