Index: src/effects/SkDisplacementMapEffect.cpp |
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp |
index 899254fda2ea6fba371a30e4be49f132b297fe0c..bb71aa13e917a7f0dd69ba8be0494c723f1eb307 100644 |
--- a/src/effects/SkDisplacementMapEffect.cpp |
+++ b/src/effects/SkDisplacementMapEffect.cpp |
@@ -300,20 +300,20 @@ |
class GrGLDisplacementMapEffect : public GrGLEffect { |
public: |
GrGLDisplacementMapEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect); |
+ const GrDrawEffect& drawEffect); |
virtual ~GrGLDisplacementMapEffect(); |
virtual void emitCode(GrGLProgramBuilder*, |
- const GrEffect&, |
+ const GrDrawEffect&, |
const GrEffectKey&, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray&) SK_OVERRIDE; |
- static inline void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*); |
- |
- virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE; |
+ static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*); |
+ |
+ virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE; |
private: |
SkDisplacementMapEffect::ChannelSelectorType fXChannelSelector; |
@@ -480,7 +480,7 @@ |
} |
bool GrDisplacementMapEffect::onIsEqual(const GrEffect& sBase) const { |
- const GrDisplacementMapEffect& s = sBase.cast<GrDisplacementMapEffect>(); |
+ const GrDisplacementMapEffect& s = CastEffect<GrDisplacementMapEffect>(sBase); |
return fDisplacementAccess.getTexture() == s.fDisplacementAccess.getTexture() && |
fColorAccess.getTexture() == s.fColorAccess.getTexture() && |
fXChannelSelector == s.fXChannelSelector && |
@@ -532,17 +532,17 @@ |
/////////////////////////////////////////////////////////////////////////////// |
GrGLDisplacementMapEffect::GrGLDisplacementMapEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+ const GrDrawEffect& drawEffect) |
: INHERITED(factory) |
- , fXChannelSelector(effect.cast<GrDisplacementMapEffect>().xChannelSelector()) |
- , fYChannelSelector(effect.cast<GrDisplacementMapEffect>().yChannelSelector()) { |
+ , fXChannelSelector(drawEffect.castEffect<GrDisplacementMapEffect>().xChannelSelector()) |
+ , fYChannelSelector(drawEffect.castEffect<GrDisplacementMapEffect>().yChannelSelector()) { |
} |
GrGLDisplacementMapEffect::~GrGLDisplacementMapEffect() { |
} |
void GrGLDisplacementMapEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect&, |
+ const GrDrawEffect&, |
const GrEffectKey& key, |
const char* outputColor, |
const char* inputColor, |
@@ -620,8 +620,9 @@ |
} |
void GrGLDisplacementMapEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- const GrDisplacementMapEffect& displacementMap = effect.cast<GrDisplacementMapEffect>(); |
+ const GrDrawEffect& drawEffect) { |
+ const GrDisplacementMapEffect& displacementMap = |
+ drawEffect.castEffect<GrDisplacementMapEffect>(); |
GrTexture* colorTex = displacementMap.texture(1); |
SkScalar scaleX = SkScalarDiv(displacementMap.scale().fX, SkIntToScalar(colorTex->width())); |
SkScalar scaleY = SkScalarDiv(displacementMap.scale().fY, SkIntToScalar(colorTex->height())); |
@@ -630,9 +631,10 @@ |
SkScalarToFloat(scaleY) : SkScalarToFloat(-scaleY)); |
} |
-void GrGLDisplacementMapEffect::GenKey(const GrEffect& effect, |
+void GrGLDisplacementMapEffect::GenKey(const GrDrawEffect& drawEffect, |
const GrGLCaps&, GrEffectKeyBuilder* b) { |
- const GrDisplacementMapEffect& displacementMap = effect.cast<GrDisplacementMapEffect>(); |
+ const GrDisplacementMapEffect& displacementMap = |
+ drawEffect.castEffect<GrDisplacementMapEffect>(); |
uint32_t xKey = displacementMap.xChannelSelector(); |
uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBits; |