Index: src/gpu/GrOvalRenderer.cpp |
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp |
index 4575287d05c3de1fe074818a23ffe9c5e34896b2..c06909d5e1e19383dcb23b01f0b549940175ad13 100644 |
--- a/src/gpu/GrOvalRenderer.cpp |
+++ b/src/gpu/GrOvalRenderer.cpp |
@@ -100,6 +100,10 @@ public: |
GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();; |
vsBuilder->codeAppendf("%s = %s;", v.vsOut(), circleEffect.inCircleEdge().c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), |
+ vsBuilder->uViewM(), vsBuilder->inPosition()); |
+ |
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
fsBuilder->codeAppendf("float d = length(%s.xy);", v.fsIn()); |
fsBuilder->codeAppendf("float edgeAlpha = clamp(%s.z - d, 0.0, 1.0);", v.fsIn()); |
@@ -219,6 +223,10 @@ public: |
vsBuilder->codeAppendf("%s = %s;", ellipseRadii.vsOut(), |
ellipseEffect.inEllipseRadii().c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), |
+ vsBuilder->uViewM(), vsBuilder->inPosition()); |
+ |
// for outer curve |
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
fsBuilder->codeAppendf("vec2 scaledOffset = %s*%s.xy;", ellipseOffsets.fsIn(), |
@@ -365,6 +373,10 @@ public: |
vsBuilder->codeAppendf("%s = %s;", offsets1.vsOut(), |
ellipseEffect.inEllipseOffsets1().c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), |
+ vsBuilder->uViewM(), vsBuilder->inPosition()); |
+ |
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
SkAssertResult(fsBuilder->enableFeature( |
GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); |