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

Unified Diff: src/core/SkXfermode.cpp

Issue 14034018: Some fixes for saturation computation XferEffect. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkXfermode.cpp
===================================================================
--- src/core/SkXfermode.cpp (revision 8823)
+++ src/core/SkXfermode.cpp (working copy)
@@ -1305,7 +1305,7 @@
"\t\tmidComp = sat * (midComp - minComp) / (maxComp - minComp);\n"
"\t\tmaxComp = sat;\n"
"\t} else {\n"
- "\t\tmidComp = midComp = 0.0;\n"
+ "\t\tmidComp = maxComp = 0.0;\n"
"\t}\n"
"\tminComp = 0.0;\n");
builder->emitFunction(GrGLShaderBuilder::kFragment_ShaderType,
@@ -1325,8 +1325,10 @@
"\tif (hueLumColor.r <= hueLumColor.g) {\n"
"\t\tif (hueLumColor.g <= hueLumColor.b) {\n"
"\t\t\t%s(hueLumColor.r, hueLumColor.g, hueLumColor.b, sat);\n"
+ "\t\t} else if (hueLumColor.r <= hueLumColor.b) {\n"
+ "\t\t\t%s(hueLumColor.r, hueLumColor.b, hueLumColor.g, sat);\n"
"\t\t} else {\n"
- "\t\t\t%s(hueLumColor.r, hueLumColor.b, hueLumColor.g, sat);\n"
+ "\t\t\t%s(hueLumColor.b, hueLumColor.r, hueLumColor.g, sat);\n"
"\t\t}\n"
"\t} else if (hueLumColor.r <= hueLumColor.b) {\n"
"\t\t%s(hueLumColor.g, hueLumColor.r, hueLumColor.b, sat);\n"
@@ -1336,8 +1338,8 @@
"\t\t%s(hueLumColor.b, hueLumColor.g, hueLumColor.r, sat);\n"
"\t}\n"
"\treturn hueLumColor;",
- getFunction.c_str(), helpFunc, helpFunc, helpFunc, helpFunc,\
- helpFunc);
+ getFunction.c_str(), helpFunc, helpFunc, helpFunc, helpFunc,
+ helpFunc, helpFunc);
builder->emitFunction(GrGLShaderBuilder::kFragment_ShaderType,
kVec3f_GrSLType,
"set_saturation",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698