Index: src/gpu/effects/GrConvexPolyEffect.cpp |
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp |
index afe3674d59c9a9828cad850ad19bef8ba979fb10..71a8befece6c788d4adbdd4e365cea31a395355c 100644 |
--- a/src/gpu/effects/GrConvexPolyEffect.cpp |
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp |
@@ -50,7 +50,7 @@ |
} |
virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE { |
- const AARectEffect& aare = other.cast<AARectEffect>(); |
+ const AARectEffect& aare = CastEffect<AARectEffect>(other); |
return fRect == aare.fRect; |
} |
@@ -87,19 +87,19 @@ |
class GLAARectEffect : public GrGLEffect { |
public: |
- GLAARectEffect(const GrBackendEffectFactory&, const GrEffect&); |
+ GLAARectEffect(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 fRectUniform; |
@@ -108,19 +108,19 @@ |
}; |
GLAARectEffect::GLAARectEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+ const GrDrawEffect& drawEffect) |
: INHERITED (factory) { |
fPrevRect.fLeft = SK_ScalarNaN; |
} |
void GLAARectEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect& effect, |
+ const GrDrawEffect& drawEffect, |
const GrEffectKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray& samplers) { |
- const AARectEffect& aare = effect.cast<AARectEffect>(); |
+ const AARectEffect& aare = drawEffect.castEffect<AARectEffect>(); |
const char *rectName; |
// The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bottom - 0.5), |
// respectively. |
@@ -157,8 +157,8 @@ |
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str()); |
} |
-void GLAARectEffect::setData(const GrGLProgramDataManager& pdman, const GrEffect& effect) { |
- const AARectEffect& aare = effect.cast<AARectEffect>(); |
+void GLAARectEffect::setData(const GrGLProgramDataManager& pdman, const GrDrawEffect& drawEffect) { |
+ const AARectEffect& aare = drawEffect.castEffect<AARectEffect>(); |
const SkRect& rect = aare.getRect(); |
if (rect != fPrevRect) { |
pdman.set4f(fRectUniform, rect.fLeft + 0.5f, rect.fTop + 0.5f, |
@@ -167,9 +167,9 @@ |
} |
} |
-void GLAARectEffect::GenKey(const GrEffect& effect, const GrGLCaps&, |
+void GLAARectEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, |
GrEffectKeyBuilder* b) { |
- const AARectEffect& aare = effect.cast<AARectEffect>(); |
+ const AARectEffect& aare = drawEffect.castEffect<AARectEffect>(); |
b->add32(aare.getEdgeType()); |
} |
@@ -181,19 +181,19 @@ |
class GrGLConvexPolyEffect : public GrGLEffect { |
public: |
- GrGLConvexPolyEffect(const GrBackendEffectFactory&, const GrEffect&); |
+ GrGLConvexPolyEffect(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 fEdgeUniform; |
@@ -202,19 +202,19 @@ |
}; |
GrGLConvexPolyEffect::GrGLConvexPolyEffect(const GrBackendEffectFactory& factory, |
- const GrEffect& effect) |
+ const GrDrawEffect& drawEffect) |
: INHERITED (factory) { |
fPrevEdges[0] = SK_ScalarNaN; |
} |
void GrGLConvexPolyEffect::emitCode(GrGLProgramBuilder* builder, |
- const GrEffect& effect, |
+ const GrDrawEffect& drawEffect, |
const GrEffectKey& key, |
const char* outputColor, |
const char* inputColor, |
const TransformedCoordsArray&, |
const TextureSamplerArray& samplers) { |
- const GrConvexPolyEffect& cpe = effect.cast<GrConvexPolyEffect>(); |
+ const GrConvexPolyEffect& cpe = drawEffect.castEffect<GrConvexPolyEffect>(); |
const char *edgeArrayName; |
fEdgeUniform = builder->addUniformArray(GrGLProgramBuilder::kFragment_Visibility, |
@@ -249,8 +249,8 @@ |
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str()); |
} |
-void GrGLConvexPolyEffect::setData(const GrGLProgramDataManager& pdman, const GrEffect& effect) { |
- const GrConvexPolyEffect& cpe = effect.cast<GrConvexPolyEffect>(); |
+void GrGLConvexPolyEffect::setData(const GrGLProgramDataManager& pdman, const GrDrawEffect& drawEffect) { |
+ const GrConvexPolyEffect& cpe = drawEffect.castEffect<GrConvexPolyEffect>(); |
size_t byteSize = 3 * cpe.getEdgeCount() * sizeof(SkScalar); |
if (0 != memcmp(fPrevEdges, cpe.getEdges(), byteSize)) { |
pdman.set3fv(fEdgeUniform, cpe.getEdgeCount(), cpe.getEdges()); |
@@ -258,9 +258,9 @@ |
} |
} |
-void GrGLConvexPolyEffect::GenKey(const GrEffect& effect, const GrGLCaps&, |
+void GrGLConvexPolyEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, |
GrEffectKeyBuilder* b) { |
- const GrConvexPolyEffect& cpe = effect.cast<GrConvexPolyEffect>(); |
+ const GrConvexPolyEffect& cpe = drawEffect.castEffect<GrConvexPolyEffect>(); |
GR_STATIC_ASSERT(kGrEffectEdgeTypeCnt <= 8); |
uint32_t key = (cpe.getEdgeCount() << 3) | cpe.getEdgeType(); |
b->add32(key); |
@@ -351,7 +351,7 @@ |
} |
bool GrConvexPolyEffect::onIsEqual(const GrEffect& other) const { |
- const GrConvexPolyEffect& cpe = other.cast<GrConvexPolyEffect>(); |
+ const GrConvexPolyEffect& cpe = CastEffect<GrConvexPolyEffect>(other); |
// ignore the fact that 0 == -0 and just use memcmp. |
return (cpe.fEdgeType == fEdgeType && cpe.fEdgeCount == fEdgeCount && |
0 == memcmp(cpe.fEdges, fEdges, 3 * fEdgeCount * sizeof(SkScalar))); |