Remove default implementation of GrEffect::isEqual. Make GrSingleTextureEffect abstract.
Review URL: https://codereview.appspot.com/7142049
git-svn-id: http://skia.googlecode.com/svn/trunk@7254 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index e7f266e..bcf0baf 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -48,7 +48,7 @@
static const char* Name() { return "Magnifier"; }
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
- virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;
+ virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE;
float x_offset() const { return fXOffset; }
float y_offset() const { return fYOffset; }
@@ -75,6 +75,8 @@
, fXInset(xInset)
, fYInset(yInset) {}
+ virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE;
+
GR_DECLARE_EFFECT_TEST;
float fXOffset;
@@ -230,10 +232,10 @@
return GrTBackendEffectFactory<GrMagnifierEffect>::getInstance();
}
-bool GrMagnifierEffect::isEqual(const GrEffect& sBase) const {
- const GrMagnifierEffect& s =
- static_cast<const GrMagnifierEffect&>(sBase);
- return (this->fXOffset == s.fXOffset &&
+bool GrMagnifierEffect::onIsEqual(const GrEffect& sBase) const {
+ const GrMagnifierEffect& s = static_cast<const GrMagnifierEffect&>(sBase);
+ return (this->texture(0) == s.texture(0) &&
+ this->fXOffset == s.fXOffset &&
this->fYOffset == s.fYOffset &&
this->fXZoom == s.fXZoom &&
this->fYZoom == s.fYZoom &&
@@ -241,6 +243,10 @@
this->fYInset == s.fYInset);
}
+void GrMagnifierEffect::getConstantColorComponents(GrColor* color, uint32_t* validFlags) const {
+ this->updateConstantColorComponentsForModulation(color, validFlags);
+}
+
#endif
////////////////////////////////////////////////////////////////////////////////