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

Unified Diff: src/effects/SkArithmeticMode_gpu.cpp

Issue 1715333004: remove dead unpremul checks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/effects/SkArithmeticMode_gpu.cpp
diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp
index 103931ce188c510c8240b9407fe88a8b34a43c1b..7fb6d66050d87eb4f17d545555628c7f2009de4e 100644
--- a/src/effects/SkArithmeticMode_gpu.cpp
+++ b/src/effects/SkArithmeticMode_gpu.cpp
@@ -19,8 +19,6 @@
#include "glsl/GrGLSLUniformHandler.h"
#include "glsl/GrGLSLXferProcessor.h"
-static const bool gUseUnpremul = false;
-
static void add_arithmetic_code(GrGLSLFragmentBuilder* fragBuilder,
const char* srcColor,
const char* dstColor,
@@ -32,22 +30,13 @@ static void add_arithmetic_code(GrGLSLFragmentBuilder* fragBuilder,
fragBuilder->codeAppend("const vec4 src = vec4(1);");
} else {
fragBuilder->codeAppendf("vec4 src = %s;", srcColor);
- if (gUseUnpremul) {
- fragBuilder->codeAppend("src.rgb = clamp(src.rgb / src.a, 0.0, 1.0);");
- }
}
fragBuilder->codeAppendf("vec4 dst = %s;", dstColor);
- if (gUseUnpremul) {
- fragBuilder->codeAppend("dst.rgb = clamp(dst.rgb / dst.a, 0.0, 1.0);");
- }
-
fragBuilder->codeAppendf("%s = %s.x * src * dst + %s.y * src + %s.z * dst + %s.w;",
outputColor, kUni, kUni, kUni, kUni);
fragBuilder->codeAppendf("%s = clamp(%s, 0.0, 1.0);\n", outputColor, outputColor);
- if (gUseUnpremul) {
- fragBuilder->codeAppendf("%s.rgb *= %s.a;", outputColor, outputColor);
- } else if (enforcePMColor) {
+ if (enforcePMColor) {
fragBuilder->codeAppendf("%s.rgb = min(%s.rgb, %s.a);",
outputColor, outputColor, outputColor);
}
« 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