Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: src/gpu/glsl/GrGLSLShaderBuilder.cpp

Issue 2326093002: Fix color gamut xform matrices in GPU code (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrColorSpaceXform.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLShaderBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 8b004b265f862763ddfa25f4da146b6288ee8b43..26a7761f320dc77fc89b0a5bb38609dbe9917c19 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");
« no previous file with comments | « src/gpu/GrColorSpaceXform.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698