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

Unified Diff: src/effects/SkMagnifierImageFilter.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/SkLumaColorFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMagnifierImageFilter.cpp
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index e0edb4a75cbf8b7973ec169bb5a02865c39bc768..baa1926f7cf433e2e2307e4c92705e531359c2f9 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -47,8 +47,6 @@ public:
const char* name() const override { return "Magnifier"; }
- GrGLFragmentProcessor* createGLInstance() const override;
-
const SkRect& bounds() const { return fBounds; } // Bounds of source image.
// Offset to apply to zoomed pixels, (srcRect position / texture size).
float x_offset() const { return fXOffset; }
@@ -83,6 +81,8 @@ private:
this->initClassID<GrMagnifierEffect>();
}
+ GrGLFragmentProcessor* onCreateGLInstance() const override;
+
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
@@ -111,7 +111,8 @@ public:
virtual void emitCode(EmitArgs&) override;
- void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
+protected:
+ void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override;
private:
UniformHandle fOffsetVar;
@@ -178,7 +179,7 @@ void GrGLMagnifierEffect::emitCode(EmitArgs& args) {
fsBuilder->codeAppend(modulate.c_str());
}
-void GrGLMagnifierEffect::setData(const GrGLProgramDataManager& pdman,
+void GrGLMagnifierEffect::onSetData(const GrGLProgramDataManager& pdman,
const GrProcessor& effect) {
const GrMagnifierEffect& zoom = effect.cast<GrMagnifierEffect>();
pdman.set2f(fOffsetVar, zoom.x_offset(), zoom.y_offset());
@@ -195,7 +196,7 @@ void GrMagnifierEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
GrGLMagnifierEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrMagnifierEffect::createGLInstance() const {
+GrGLFragmentProcessor* GrMagnifierEffect::onCreateGLInstance() const {
return SkNEW_ARGS(GrGLMagnifierEffect, (*this));
}
« no previous file with comments | « src/effects/SkLumaColorFilter.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698