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

Unified Diff: include/effects/SkPerlinNoiseShader.h

Issue 169973002: Begin making SkPerlinNoiseShader const. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Don't lazily initialize bitmaps. Use setPixels 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') | no next file with comments »
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..497c0e0e8c476bc2934abb9bf315dac90065bb05 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;
« no previous file with comments | « no previous file | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698