From 8ddbe8b9366c8c59c4fb55f01f253de8a0b37d6e Mon Sep 17 00:00:00 2001 From: joshualitt Date: Tue, 16 Sep 2014 06:46:30 -0700 Subject: removing GrDrawEffect BUG=skia: R=bsalomon@google.com Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/571163002 --- src/core/SkXfermode.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/core/SkXfermode.cpp') diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp index 91aa84706b..db9d332e79 100644 --- a/src/core/SkXfermode.cpp +++ b/src/core/SkXfermode.cpp @@ -818,18 +818,19 @@ public: class GLEffect : public GrGLEffect { public: - GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) + GLEffect(const GrBackendEffectFactory& factory, const GrEffect&) : GrGLEffect(factory) { } virtual void emitCode(GrGLProgramBuilder* builder, - const GrDrawEffect& drawEffect, + const GrEffect& effect, const GrEffectKey& key, const char* outputColor, const char* inputColor, const TransformedCoordsArray& coords, const TextureSamplerArray& samplers) SK_OVERRIDE { - SkXfermode::Mode mode = drawEffect.castEffect().mode(); - const GrTexture* backgroundTex = drawEffect.castEffect().backgroundAccess().getTexture(); + SkXfermode::Mode mode = effect.cast().mode(); + const GrTexture* backgroundTex = + effect.cast().backgroundAccess().getTexture(); GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); const char* dstColor; if (backgroundTex) { @@ -970,12 +971,12 @@ public: } } - static inline void GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, + static inline void GenKey(const GrEffect& effect, const GrGLCaps&, GrEffectKeyBuilder* b) { // The background may come from the dst or from a texture. - uint32_t key = drawEffect.effect()->numTextures(); + uint32_t key = effect.numTextures(); SkASSERT(key <= 1); - key |= drawEffect.castEffect().mode() << 1; + key |= effect.cast().mode() << 1; b->add32(key); } @@ -1214,7 +1215,7 @@ private: } } virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE { - const XferEffect& s = CastEffect(other); + const XferEffect& s = other.cast(); return fMode == s.fMode && fBackgroundAccess.getTexture() == s.fBackgroundAccess.getTexture(); } -- cgit v1.2.3