aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-09-09 11:30:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-09 11:30:55 -0700
commit8d914908d8ad37a73c39ba8f7ef298bfee457388 (patch)
tree9b66aef85a0bffc1c0cd0836f790ed4814125ef9 /src/gpu/glsl
parentb37c034ac8ad590c70ceac9811ba42a0bf34642c (diff)
Fix color gamut xform matrices in GPU code
Now that we're not storing them transposed, we can plumb them to the shader column-major all the way, and then multiply colors on the right, as it should be. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2326093002 Review-Url: https://codereview.chromium.org/2326093002
Diffstat (limited to 'src/gpu/glsl')
-rw-r--r--src/gpu/glsl/GrGLSLShaderBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 8b004b265f..26a7761f32 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -149,7 +149,7 @@ void GrGLSLShaderBuilder::appendColorGamutXform(SkString* out,
"\tcolor.rgb = color.rgb / nonZeroAlpha;\n");
}
// Gamut xform, clamp to destination gamut
- functionBody.append("\tcolor.rgb = clamp((vec4(color.rgb, 1.0) * xform).rgb, 0.0, 1.0);\n");
+ functionBody.append("\tcolor.rgb = clamp((xform * vec4(color.rgb, 1.0)).rgb, 0.0, 1.0);\n");
if (kPremul_SkAlphaType == colorXformHelper->alphaType()) {
// Re-multiply by alpha
functionBody.append("\tcolor.rgb = color.rgb * nonZeroAlpha;\n");