aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLProgramBuilder.cpp
diff options
context:
space:
mode:
authorGravatar dvonbeck <dvonbeck@google.com>2016-08-08 11:47:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-08 11:47:12 -0700
commit84bca78ab462314ec48614ff50315f28d5467149 (patch)
tree147b6c68d8a26d9145b645bb7059550e64208d63 /src/gpu/glsl/GrGLSLProgramBuilder.cpp
parent397a517d1a5774653fcdd08172f9a6b5eea67621 (diff)
Split distance vector into direction and magnitude components
The vector was split because the vector's users need it split, and we were creating it from the split components in the first place, so it made sense to skip that step. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2223053002 Review-Url: https://codereview.chromium.org/2223053002
Diffstat (limited to 'src/gpu/glsl/GrGLSLProgramBuilder.cpp')
-rw-r--r--src/gpu/glsl/GrGLSLProgramBuilder.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 1f28f19bb9..d0d813d4c2 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -90,8 +90,9 @@ void GrGLSLProgramBuilder::emitAndInstallPrimProc(const GrPrimitiveProcessor& pr
const char* distanceVectorName = nullptr;
if (this->fPipeline.usesDistanceVectorField() && proc.implementsDistanceVector()) {
distanceVectorName = fFS.distanceVectorName();
- fFS.codeAppend( "// Un-normalized vector to the closed geometric edge (in source space)\n");
- fFS.codeAppendf("vec2 %s;", distanceVectorName);
+ fFS.codeAppend( "// Normalized vector to the closest geometric edge (in source space)\n");
+ fFS.codeAppend( "// Distance to the edge encoded in the z-component\n");
+ fFS.codeAppendf("vec3 %s;", distanceVectorName);
}
// Enclose custom code in a block to avoid namespace conflicts