Index: src/gpu/effects/GrRRectEffect.cpp |
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp |
index 1c45c3774a051cbc572addf3dd4a4565d7c3d9a1..8a3fc44704fce997c62b7fefd0d861dd0f74bd3f 100644 |
--- a/src/gpu/effects/GrRRectEffect.cpp |
+++ b/src/gpu/effects/GrRRectEffect.cpp |
@@ -102,7 +102,7 @@ |
} |
bool CircularRRectEffect::onIsEqual(const GrEffect& other) const { |
- const CircularRRectEffect& crre = other.cast<CircularRRectEffect>(); |
+ const CircularRRectEffect& crre = CastEffect<CircularRRectEffect>(other); |
// The corner flags are derived from fRRect, so no need to check them. |
return fEdgeType == crre.fEdgeType && fRRect == crre.fRRect; |
} |
@@ -132,19 +132,19 @@ |
class GLCircularRRectEffect : public GrGLEffect { |
public: |
- GLCircularRRectEffect(const GrBackendEffectFactory&, const GrEffect&); |
+ GLCircularRRectEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
virtual void emitCode(GrGLProgramBuilder* builder, |
- const GrEffect& effect, |
+ const GrDrawEffect& drawEffect, |
const GrEffectKey& key, |
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: |
GrGLProgramDataManager::UniformHandle fInnerRectUniform; |
@@ -154,19 +154,19 @@ |
}; |
GLCircularRRectEffect::GLCircularRRectEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+ const GrDrawEffect& drawEffect) |
: INHERITED (factory) { |
fPrevRRect.setEmpty(); |
} |
void GLCircularRRectEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect& effect, |
+ const GrDrawEffect& drawEffect, |
const GrEffectKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray& samplers) { |
- const CircularRRectEffect& crre = effect.cast<CircularRRectEffect>(); |
+ const CircularRRectEffect& crre = drawEffect.castEffect<CircularRRectEffect>(); |
const char *rectName; |
const char *radiusPlusHalfName; |
// The inner rect is the rrect bounds inset by the radius. Its left, top, right, and bottom |
@@ -293,16 +293,16 @@ |
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str()); |
} |
-void GLCircularRRectEffect::GenKey(const GrEffect& effect, const GrGLCaps&, |
+void GLCircularRRectEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, |
GrEffectKeyBuilder* b) { |
- const CircularRRectEffect& crre = effect.cast<CircularRRectEffect>(); |
+ const CircularRRectEffect& crre = drawEffect.castEffect<CircularRRectEffect>(); |
GR_STATIC_ASSERT(kGrEffectEdgeTypeCnt <= 8); |
b->add32((crre.getCircularCornerFlags() << 3) | crre.getEdgeType()); |
} |
void GLCircularRRectEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- const CircularRRectEffect& crre = effect.cast<CircularRRectEffect>(); |
+ const GrDrawEffect& drawEffect) { |
+ const CircularRRectEffect& crre = drawEffect.castEffect<CircularRRectEffect>(); |
const SkRRect& rrect = crre.getRRect(); |
if (rrect != fPrevRRect) { |
SkRect rect = rrect.getBounds(); |
@@ -436,7 +436,7 @@ |
} |
bool EllipticalRRectEffect::onIsEqual(const GrEffect& other) const { |
- const EllipticalRRectEffect& erre = other.cast<EllipticalRRectEffect>(); |
+ const EllipticalRRectEffect& erre = CastEffect<EllipticalRRectEffect>(other); |
return fEdgeType == erre.fEdgeType && fRRect == erre.fRRect; |
} |
@@ -486,19 +486,19 @@ |
class GLEllipticalRRectEffect : public GrGLEffect { |
public: |
- GLEllipticalRRectEffect(const GrBackendEffectFactory&, const GrEffect&); |
+ GLEllipticalRRectEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
virtual void emitCode(GrGLProgramBuilder* builder, |
- const GrEffect& effect, |
+ const GrDrawEffect& drawEffect, |
const GrEffectKey& key, |
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: |
GrGLProgramDataManager::UniformHandle fInnerRectUniform; |
@@ -508,19 +508,19 @@ |
}; |
GLEllipticalRRectEffect::GLEllipticalRRectEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+ const GrDrawEffect& drawEffect) |
: INHERITED (factory) { |
fPrevRRect.setEmpty(); |
} |
void GLEllipticalRRectEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect& effect, |
+ const GrDrawEffect& drawEffect, |
const GrEffectKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray& samplers) { |
- const EllipticalRRectEffect& erre = effect.cast<EllipticalRRectEffect>(); |
+ const EllipticalRRectEffect& erre = drawEffect.castEffect<EllipticalRRectEffect>(); |
const char *rectName; |
// The inner rect is the rrect bounds inset by the x/y radii |
fInnerRectUniform = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
@@ -590,16 +590,16 @@ |
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str()); |
} |
-void GLEllipticalRRectEffect::GenKey(const GrEffect& effect, const GrGLCaps&, |
+void GLEllipticalRRectEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, |
GrEffectKeyBuilder* b) { |
- const EllipticalRRectEffect& erre = effect.cast<EllipticalRRectEffect>(); |
+ const EllipticalRRectEffect& erre = drawEffect.castEffect<EllipticalRRectEffect>(); |
GR_STATIC_ASSERT(kLast_GrEffectEdgeType < (1 << 3)); |
b->add32(erre.getRRect().getType() | erre.getEdgeType() << 3); |
} |
void GLEllipticalRRectEffect::setData(const GrGLProgramDataManager& pdman, |
- const GrEffect& effect) { |
- const EllipticalRRectEffect& erre = effect.cast<EllipticalRRectEffect>(); |
+ const GrDrawEffect& drawEffect) { |
+ const EllipticalRRectEffect& erre = drawEffect.castEffect<EllipticalRRectEffect>(); |
const SkRRect& rrect = erre.getRRect(); |
if (rrect != fPrevRRect) { |
SkRect rect = rrect.getBounds(); |