Index: src/gpu/GrOvalRenderer.cpp |
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp |
index 5ec750457798af3f38cabb2f498a457a3499b830..de7f4a36ef26917414d30d81c90edb8515613a05 100644 |
--- a/src/gpu/GrOvalRenderer.cpp |
+++ b/src/gpu/GrOvalRenderer.cpp |
@@ -91,13 +91,16 @@ public: |
const char* outputColor, |
const char* inputColor, |
const TextureSamplerArray& samplers) SK_OVERRIDE { |
+ GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder(); |
+ SkASSERT(NULL != vertexBuilder); |
+ |
const CircleEdgeEffect& circleEffect = drawEffect.castEffect<CircleEdgeEffect>(); |
const char *vsName, *fsName; |
- builder->addVarying(kVec4f_GrSLType, "CircleEdge", &vsName, &fsName); |
+ vertexBuilder->addVarying(kVec4f_GrSLType, "CircleEdge", &vsName, &fsName); |
const SkString* attrName = |
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
- builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str()); |
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str()); |
builder->fsCodeAppendf("\tfloat d = length(%s.xy);\n", fsName); |
builder->fsCodeAppendf("\tfloat edgeAlpha = clamp(%s.z - d, 0.0, 1.0);\n", fsName); |
@@ -202,20 +205,23 @@ public: |
const char* outputColor, |
const char* inputColor, |
const TextureSamplerArray& samplers) SK_OVERRIDE { |
+ GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder(); |
+ SkASSERT(NULL != vertexBuilder); |
+ |
const EllipseEdgeEffect& ellipseEffect = drawEffect.castEffect<EllipseEdgeEffect>(); |
const char *vsOffsetName, *fsOffsetName; |
const char *vsRadiiName, *fsRadiiName; |
- builder->addVarying(kVec2f_GrSLType, "EllipseOffsets", &vsOffsetName, &fsOffsetName); |
+ vertexBuilder->addVarying(kVec2f_GrSLType, "EllipseOffsets", &vsOffsetName, &fsOffsetName); |
const SkString* attr0Name = |
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
- builder->vsCodeAppendf("\t%s = %s;\n", vsOffsetName, attr0Name->c_str()); |
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsOffsetName, attr0Name->c_str()); |
- builder->addVarying(kVec4f_GrSLType, "EllipseRadii", &vsRadiiName, &fsRadiiName); |
+ vertexBuilder->addVarying(kVec4f_GrSLType, "EllipseRadii", &vsRadiiName, &fsRadiiName); |
const SkString* attr1Name = |
- builder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[1]); |
- builder->vsCodeAppendf("\t%s = %s;\n", vsRadiiName, attr1Name->c_str()); |
+ vertexBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[1]); |
+ vertexBuilder->vsCodeAppendf("\t%s = %s;\n", vsRadiiName, attr1Name->c_str()); |
// for outer curve |
builder->fsCodeAppendf("\tvec2 scaledOffset = %s*%s.xy;\n", fsOffsetName, fsRadiiName); |