Index: src/gpu/effects/GrDistanceFieldTextureEffect.cpp |
diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp |
index b9776986b54dfb969bbff17897908fd296d6c597..0c7a9a3d8c21da5dc6603faf9e025f410ee34145 100755 |
--- a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp |
+++ b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp |
@@ -45,6 +45,10 @@ public: |
GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
vsBuilder->codeAppendf("\t%s = %s;\n", v.vsOut(), dfTexEffect.inTextureCoords().c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), |
+ vsBuilder->uViewM(), vsBuilder->inPosition()); |
+ |
const char* textureSizeUniName = NULL; |
fTextureSizeUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
kVec2f_GrSLType, "TextureSize", |
@@ -256,6 +260,10 @@ public: |
GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
vsBuilder->codeAppendf("%s = %s;", v.vsOut(), dfTexEffect.inTextureCoords().c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), |
+ vsBuilder->uViewM(), vsBuilder->inPosition()); |
+ |
const char* textureSizeUniName = NULL; |
fTextureSizeUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
kVec2f_GrSLType, "TextureSize", |
@@ -410,6 +418,10 @@ public: |
GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); |
vsBuilder->codeAppendf("\t%s = %s;\n", v.vsOut(), dfTexEffect.inTextureCoords().c_str()); |
+ // setup position varying |
+ vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), |
+ vsBuilder->uViewM(), vsBuilder->inPosition()); |
+ |
const char* textureSizeUniName = NULL; |
// width, height, 1/(3*width) |
fTextureSizeUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility, |