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

Unified Diff: src/effects/SkLumaColorFilter.cpp

Issue 26190003: Potentially optimize some GrGLEffects for known input color values (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkLumaXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLumaColorFilter.cpp
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index fd4826b5a9b92c8fb6a31472a7fe6cb799960ae3..38aaa86d00551e8918a9c19b4ea33500726a517b 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -94,18 +94,14 @@ public:
const GrDrawEffect&,
EffectKey,
const char* outputColor,
- const char* inputColor,
+ const GrGLSLExpr4& inputColor,
const TransformedCoordsArray&,
const TextureSamplerArray&) SK_OVERRIDE {
- if (NULL == inputColor) {
- inputColor = "vec4(1)";
- }
-
builder->fsCodeAppendf("\tfloat luma = dot(vec3(%f, %f, %f), %s.rgb);\n",
SK_ITU_BT709_LUM_COEFF_R,
SK_ITU_BT709_LUM_COEFF_G,
SK_ITU_BT709_LUM_COEFF_B,
- inputColor);
+ inputColor.c_str());
builder->fsCodeAppendf("\t%s = vec4(0, 0, 0, luma);\n",
outputColor);
« no previous file with comments | « src/effects/SkLightingImageFilter.cpp ('k') | src/effects/SkLumaXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698