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

Unified Diff: src/effects/SkBitmapAlphaThresholdShader.cpp

Issue 25048002: Express (GLSL expression, possibly known value) pairs as a class (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 2 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
Index: src/effects/SkBitmapAlphaThresholdShader.cpp
diff --git a/src/effects/SkBitmapAlphaThresholdShader.cpp b/src/effects/SkBitmapAlphaThresholdShader.cpp
index 84cdbf262b29f43fbfe1678833d9db733fc1678b..261ba4f0987af391f158e64b1bc99e0190277ca2 100644
--- a/src/effects/SkBitmapAlphaThresholdShader.cpp
+++ b/src/effects/SkBitmapAlphaThresholdShader.cpp
@@ -161,12 +161,8 @@ public:
"\t\t\tcolor.a = thresh;\n"
"\t\t}\n");
- builder->fsCodeAppend("color = ");
- SkString outStr;
- outStr.appendf("\t\t%s = ", outputColor);
- GrGLSLModulatef<4>(&outStr, inputColor, "color");
- outStr.append(";\n");
- builder->fsCodeAppend(outStr.c_str());
+ builder->fsCodeAppendf("color = %s = %s;\n", outputColor,
+ (GrGLSLExpr<4>(inputColor) * GrGLSLExpr<4>("color")).c_str());
}
virtual void setData(const GrGLUniformManager& uman, const GrDrawEffect& e) SK_OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698