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

Unified Diff: src/effects/SkPerlinNoiseShader.cpp

Issue 1287023009: Added tree structure to GrGLFragmentProcessor, i.e. GL instances (Closed) Base URL: https://skia.googlesource.com/skia@cs3_isequal_nonrecursive
Patch Set: moved onSetData from public to protected, onCreateGLInstance from public to private in subclasses Created 5 years, 4 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 | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkPerlinNoiseShader.cpp
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 989bdd143d051b4b88e70cc22ad6e1c0144e0fcd..501e6361a53f0e2d1c6ede31b37dde9cc397e58c 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -489,10 +489,11 @@ public:
virtual void emitCode(EmitArgs&) override;
- void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
-
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
+protected:
+ void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override;
+
private:
GrGLProgramDataManager::UniformHandle fStitchDataUni;
@@ -527,10 +528,6 @@ public:
const char* name() const override { return "PerlinNoise"; }
- GrGLFragmentProcessor* createGLInstance() const override {
- return SkNEW_ARGS(GrGLPerlinNoise, (*this));
- }
-
const SkPerlinNoiseShader::StitchData& stitchData() const { return fPaintingData->fStitchDataInit; }
SkPerlinNoiseShader::Type type() const { return fType; }
@@ -541,6 +538,10 @@ public:
uint8_t alpha() const { return fAlpha; }
private:
+ GrGLFragmentProcessor* onCreateGLInstance() const override {
+ return SkNEW_ARGS(GrGLPerlinNoise, (*this));
+ }
+
virtual void onGetGLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override {
GrGLPerlinNoise::GenKey(*this, caps, b);
@@ -916,8 +917,8 @@ void GrGLPerlinNoise::GenKey(const GrProcessor& processor, const GrGLSLCaps&,
b->add32(key);
}
-void GrGLPerlinNoise::setData(const GrGLProgramDataManager& pdman, const GrProcessor& processor) {
- INHERITED::setData(pdman, processor);
+void GrGLPerlinNoise::onSetData(const GrGLProgramDataManager& pdman, const GrProcessor& processor) {
+ INHERITED::onSetData(pdman, processor);
const GrPerlinNoiseEffect& turbulence = processor.cast<GrPerlinNoiseEffect>();
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/effects/SkTableColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698