Index: src/gpu/effects/GrBezierEffect.cpp |
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp |
index 196168c06a6e2628b7958c0a2dd1efdadfdf0cfd..26049b398baa2f9e2d604e843d875b11b68c7b97 100644 |
--- a/src/gpu/effects/GrBezierEffect.cpp |
+++ b/src/gpu/effects/GrBezierEffect.cpp |
@@ -44,6 +44,10 @@ void GrGLConicEffect::emitCode(const EmitArgs& args) { |
GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
vsBuilder->codeAppendf("%s = %s;", v.vsOut(), inConicCoeffs.c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), vsBuilder->uViewM(), |
+ vsBuilder->inPosition()); |
+ |
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
fsBuilder->codeAppend("float edgeAlpha;"); |
@@ -184,6 +188,10 @@ void GrGLQuadEffect::emitCode(const EmitArgs& args) { |
const GrShaderVar& inHairQuadEdge = args.fGP.cast<GrQuadEffect>().inHairQuadEdge(); |
vsBuilder->codeAppendf("%s = %s;", v.vsOut(), inHairQuadEdge.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 edgeAlpha;"); |
@@ -310,6 +318,10 @@ void GrGLCubicEffect::emitCode(const EmitArgs& args) { |
const GrShaderVar& inCubicCoeffs = args.fGP.cast<GrCubicEffect>().inCubicCoeffs(); |
vsBuilder->codeAppendf("%s = %s;", v.vsOut(), inCubicCoeffs.c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), vsBuilder->uViewM(), |
+ vsBuilder->inPosition()); |
+ |
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
GrGLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |