Index: src/effects/SkColorFilters.cpp |
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp |
index 3d89d0b52a5971c388dcea3c89f36acd7ef0e2c0..e825695d58554367b5bc334a37124cf9f9f76d48 100644 |
--- a/src/effects/SkColorFilters.cpp |
+++ b/src/effects/SkColorFilters.cpp |
@@ -218,47 +218,45 @@ |
class GLEffect : public GrGLEffect { |
public: |
- GLEffect(const GrBackendEffectFactory& factory, const GrEffect&) |
+ GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) |
: INHERITED(factory) { |
} |
virtual void emitCode(GrGLProgramBuilder* builder, |
- const GrEffect& effect, |
+ const GrDrawEffect& drawEffect, |
const GrEffectKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray& coords, |
const TextureSamplerArray& samplers) SK_OVERRIDE { |
- SkXfermode::Mode mode = effect.cast<ModeColorFilterEffect>().mode(); |
+ SkXfermode::Mode mode = drawEffect.castEffect<ModeColorFilterEffect>().mode(); |
SkASSERT(SkXfermode::kDst_Mode != mode); |
const char* colorFilterColorUniName = NULL; |
- if (effect.cast<ModeColorFilterEffect>().willUseFilterColor()) { |
+ if (drawEffect.castEffect<ModeColorFilterEffect>().willUseFilterColor()) { |
fFilterColorUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
kVec4f_GrSLType, "FilterColor", |
&colorFilterColorUniName); |
} |
GrGLSLExpr4 filter = |
- color_filter_expression(mode, GrGLSLExpr4(colorFilterColorUniName), |
- GrGLSLExpr4(inputColor)); |
+ color_filter_expression(mode, GrGLSLExpr4(colorFilterColorUniName), GrGLSLExpr4(inputColor)); |
builder->getFragmentShaderBuilder()-> |
codeAppendf("\t%s = %s;\n", outputColor, filter.c_str()); |
} |
- static void GenKey(const GrEffect& effect, const GrGLCaps&, |
+ static void GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, |
GrEffectKeyBuilder* b) { |
- const ModeColorFilterEffect& colorModeFilter = effect.cast<ModeColorFilterEffect>(); |
+ const ModeColorFilterEffect& colorModeFilter = drawEffect.castEffect<ModeColorFilterEffect>(); |
// The SL code does not depend on filter color at the moment, so no need to represent it |
// in the key. |
b->add32(colorModeFilter.mode()); |
} |
- virtual void setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) SK_OVERRIDE { |
+ virtual void setData(const GrGLProgramDataManager& pdman, const GrDrawEffect& drawEffect) SK_OVERRIDE { |
if (fFilterColorUni.isValid()) { |
- const ModeColorFilterEffect& colorModeFilter = effect.cast<ModeColorFilterEffect>(); |
+ const ModeColorFilterEffect& colorModeFilter = drawEffect.castEffect<ModeColorFilterEffect>(); |
GrGLfloat c[4]; |
GrColorToRGBAFloat(colorModeFilter.color(), c); |
pdman.set4fv(fFilterColorUni, 1, c); |
@@ -282,14 +280,13 @@ |
SkXfermode::Coeff srcCoeff; |
SkAssertResult(SkXfermode::ModeAsCoeff(fMode, &srcCoeff, &dstCoeff)); |
// These could be calculated from the blend equation with template trickery.. |
- if (SkXfermode::kZero_Coeff == dstCoeff && |
- !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) { |
+ if (SkXfermode::kZero_Coeff == dstCoeff && !GrBlendCoeffRefsDst(sk_blend_to_grblend(srcCoeff))) { |
this->setWillNotUseInputColor(); |
} |
} |
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE { |
- const ModeColorFilterEffect& s = other.cast<ModeColorFilterEffect>(); |
+ const ModeColorFilterEffect& s = CastEffect<ModeColorFilterEffect>(other); |
return fMode == s.fMode && fColor == s.fColor; |
} |