Index: src/gpu/glsl/GrGLSLProgramBuilder.cpp |
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp |
index 31d1de29b3ba89da5a7b22a0fc2b716e9337b51a..2a828c4e2986bc76e52f69777f15e28bc0a9af73 100644 |
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp |
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp |
@@ -87,6 +87,14 @@ void GrGLSLProgramBuilder::emitAndInstallPrimProc(const GrPrimitiveProcessor& pr |
this->nameExpression(outputColor, "outputColor"); |
this->nameExpression(outputCoverage, "outputCoverage"); |
+ if (this->fPipeline.usesDistanceVectorField()) { |
+ SkString outputDistanceVectorStr; |
+ this->nameVariable(&outputDistanceVectorStr, '\0', "outputDistanceVector"); |
egdaniel
2016/07/12 13:46:42
I think I would prefer hard coding the name we wan
dvonbeck
2016/07/13 15:17:13
The thing is, the Geometry Processors get their va
egdaniel
2016/07/13 15:47:02
I don't think there is any need for mangling the v
dvonbeck
2016/07/13 16:57:49
Done.
|
+ fFS.enableDistanceVector(outputDistanceVectorStr); |
+ |
robertphillips
2016/07/11 17:55:40
Maybe emit a comment:
// Un-normalized vector to
dvonbeck
2016/07/13 15:17:13
Done.
|
+ fFS.codeAppendf("vec2 %s = vec2(0.0, 0.0);", fFS.distanceVectorName()); |
+ } |
+ |
// Enclose custom code in a block to avoid namespace conflicts |
SkString openBrace; |
openBrace.printf("{ // Stage %d, %s\n", fStageIndex, proc.name()); |