Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Unified Diff: include/effects/SkPerlinNoiseShader.h

Issue 169973002: Begin making SkPerlinNoiseShader const. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/effects/SkPerlinNoiseShader.cpp » ('j') | src/effects/SkPerlinNoiseShader.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkPerlinNoiseShader.h
diff --git a/include/effects/SkPerlinNoiseShader.h b/include/effects/SkPerlinNoiseShader.h
index dd89c70925954deefd9fa6d7f05e4335454f9465..a7b4d49f56de2fe038fa86f2d57d441ee47399fe 100644
--- a/include/effects/SkPerlinNoiseShader.h
+++ b/include/effects/SkPerlinNoiseShader.h
@@ -82,10 +82,6 @@ private:
const SkISize* tileSize = NULL);
virtual ~SkPerlinNoiseShader();
- void setTileSize(const SkISize&);
-
- void initPaint(PaintingData& paintingData);
-
SkScalar noise2D(int channel, const PaintingData& paintingData,
const StitchData& stitchData, const SkPoint& noiseVector);
@@ -94,13 +90,17 @@ private:
SkPMColor shade(const SkPoint& point, StitchData& stitchData);
- 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.
Dominik Grewe 2014/02/18 15:00:33 Is it always feasible to make all fields const? If
scroggo 2014/02/18 16:42:57 I don't know of any other way to make them immutab
+ /*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;
« no previous file with comments | « no previous file | src/effects/SkPerlinNoiseShader.cpp » ('j') | src/effects/SkPerlinNoiseShader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698