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

Unified Diff: src/core/SkXfermode.cpp

Issue 13327008: Fix GLPrograms test. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | src/gpu/gl/GrGLProgramDesc.h » ('j') | 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 8449)
+++ src/core/SkXfermode.cpp (working copy)
@@ -984,13 +984,20 @@
const TextureSamplerArray& samplers) SK_OVERRIDE {
const char* dstColorName = builder->dstColor();
GrAssert(NULL != dstColorName);
- builder->fsCodeAppendf("\t\t%s.a = 1.0 - (1.0 - %s.a) * (1.0 - %s.a);\n",
- outputColor, dstColorName, inputColor);
- builder->fsCodeAppendf("\t\t%s.rgb = min((1.0 - %s.a) * %s.rgb + %s.rgb,"
- " (1.0 - %s.a) * %s.rgb + %s.rgb);\n",
- outputColor,
- inputColor, dstColorName, inputColor,
- dstColorName, inputColor, dstColorName);
+ if (NULL == inputColor){
+ // the input color is solid white
+ builder->fsCodeAppendf("\t\t%s.a = 1.0;\n", outputColor);
+ builder->fsCodeAppendf("\t\t%s.rgb = vec3(1.0, 1.0, 1.0) - %s.aaa + %s.rgb;\n",
+ outputColor, dstColorName, dstColorName);
+ } else {
+ builder->fsCodeAppendf("\t\t%s.a = 1.0 - (1.0 - %s.a) * (1.0 - %s.a);\n",
+ outputColor, dstColorName, inputColor);
+ builder->fsCodeAppendf("\t\t%s.rgb = min((1.0 - %s.a) * %s.rgb + %s.rgb,"
+ " (1.0 - %s.a) * %s.rgb + %s.rgb);\n",
+ outputColor,
+ inputColor, dstColorName, inputColor,
+ dstColorName, inputColor, dstColorName);
+ }
}
static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&) { return 0; }
« no previous file with comments | « no previous file | src/gpu/gl/GrGLProgramDesc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698