Index: src/gpu/effects/GrEllipseEdgeEffect.cpp |
=================================================================== |
--- src/gpu/effects/GrEllipseEdgeEffect.cpp (revision 8241) |
+++ src/gpu/effects/GrEllipseEdgeEffect.cpp (working copy) |
@@ -15,29 +15,28 @@ |
class GrGLEllipseEdgeEffect : public GrGLEffect { |
public: |
- GrGLEllipseEdgeEffect(const GrBackendEffectFactory& factory, const GrEffectRef&) |
+ GrGLEllipseEdgeEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) |
: INHERITED (factory) {} |
virtual void emitCode(GrGLShaderBuilder* builder, |
- const GrEffectStage& stage, |
+ const GrDrawEffect& drawEffect, |
EffectKey key, |
- const char* vertexCoords, |
const char* outputColor, |
const char* inputColor, |
const TextureSamplerArray& samplers) SK_OVERRIDE { |
- const GrEllipseEdgeEffect& effect = GetEffectFromStage<GrEllipseEdgeEffect>(stage); |
+ const GrEllipseEdgeEffect& ellipseEffect = drawEffect.castEffect<GrEllipseEdgeEffect>(); |
const char *vsCenterName, *fsCenterName; |
const char *vsEdgeName, *fsEdgeName; |
builder->addVarying(kVec2f_GrSLType, "EllipseCenter", &vsCenterName, &fsCenterName); |
const SkString* attr0Name = |
- builder->getEffectAttributeName(stage.getVertexAttribIndices()[0]); |
+ builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
builder->vsCodeAppendf("\t%s = %s;\n", vsCenterName, attr0Name->c_str()); |
builder->addVarying(kVec4f_GrSLType, "EllipseEdge", &vsEdgeName, &fsEdgeName); |
const SkString* attr1Name = |
- builder->getEffectAttributeName(stage.getVertexAttribIndices()[1]); |
+ builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[1]); |
builder->vsCodeAppendf("\t%s = %s;\n", vsEdgeName, attr1Name->c_str()); |
// translate to origin |
@@ -50,7 +49,7 @@ |
// compare outer lengths against xOuterRadius |
builder->fsCodeAppendf("\tfloat edgeAlpha = clamp(%s.x-dOuter, 0.0, 1.0);\n", fsEdgeName); |
- if (effect.isStroked()) { |
+ if (ellipseEffect.isStroked()) { |
builder->fsCodeAppendf("\tinnerOffset.y *= %s.w;\n", fsEdgeName); |
builder->fsCodeAppend("\tfloat dInner = length(innerOffset);\n"); |
@@ -64,13 +63,13 @@ |
builder->fsCodeAppendf("\t%s = %s;\n", outputColor, modulate.c_str()); |
} |
- static inline EffectKey GenKey(const GrEffectStage& stage, const GrGLCaps&) { |
- const GrEllipseEdgeEffect& effect = GetEffectFromStage<GrEllipseEdgeEffect>(stage); |
+ static inline EffectKey GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) { |
+ const GrEllipseEdgeEffect& ellipseEffect = drawEffect.castEffect<GrEllipseEdgeEffect>(); |
- return effect.isStroked() ? 0x1 : 0x0; |
+ return ellipseEffect.isStroked() ? 0x1 : 0x0; |
} |
- virtual void setData(const GrGLUniformManager& uman, const GrEffectStage& stage) SK_OVERRIDE { |
+ virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVERRIDE { |
} |
private: |