diff options
author | 2014-06-24 11:16:52 -0700 | |
---|---|---|
committer | 2014-06-24 11:16:52 -0700 | |
commit | 22900008fb89afe4687a40db8737553ee0e55621 (patch) | |
tree | e3fff330bde35641bc7e13d6fe9edb559b2f0b8d /src/gpu/effects/GrRRectEffect.cpp | |
parent | 8a243376d6f6c4561c713a8fae87af5917461872 (diff) |
Make GrGLShaderBuilder::fragmentPosition() return a vec4, with 1.0 as the zw components when in the y-flip case. This works around an Adreno driver bug.
Revert "Stop referencing gl_FragCoord z and w components."
This reverts commit 160a52ba217012ed73c240f6d67b3bbf2b4879d6.
R=jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/354663002
Diffstat (limited to 'src/gpu/effects/GrRRectEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrRRectEffect.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp index 0f2178b577..11d8a18e61 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -199,8 +199,8 @@ void GLCircularRRectEffect::emitCode(GrGLShaderBuilder* builder, // alphas together. switch (crre.getCircularCornerFlags()) { case CircularRRectEffect::kAll_CornerFlags: - builder->fsCodeAppendf("\t\tvec2 dxy0 = %s.xy - %s;\n", rectName, fragmentPos); - builder->fsCodeAppendf("\t\tvec2 dxy1 = %s - %s.zw;\n", fragmentPos, rectName); + builder->fsCodeAppendf("\t\tvec2 dxy0 = %s.xy - %s.xy;\n", rectName, fragmentPos); + builder->fsCodeAppendf("\t\tvec2 dxy1 = %s.xy - %s.zw;\n", fragmentPos, rectName); builder->fsCodeAppend("\t\tvec2 dxy = max(max(dxy0, dxy1), 0.0);\n"); builder->fsCodeAppendf("\t\tfloat alpha = clamp(%s - length(dxy), 0.0, 1.0);\n", radiusPlusHalfName); @@ -537,8 +537,8 @@ void GLEllipticalRRectEffect::emitCode(GrGLShaderBuilder* builder, // The code below is a simplified version of the above that performs maxs on the vector // components before computing distances and alpha values so that only one distance computation // need be computed to determine the min alpha. - builder->fsCodeAppendf("\t\tvec2 dxy0 = %s.xy - %s;\n", rectName, fragmentPos); - builder->fsCodeAppendf("\t\tvec2 dxy1 = %s - %s.zw;\n", fragmentPos, rectName); + builder->fsCodeAppendf("\t\tvec2 dxy0 = %s.xy - %s.xy;\n", rectName, fragmentPos); + builder->fsCodeAppendf("\t\tvec2 dxy1 = %s.xy - %s.zw;\n", fragmentPos, rectName); switch (erre.getRRect().getType()) { case SkRRect::kSimple_Type: { const char *invRadiiXYSqdName; |