From d778febae6ee4de8f0519c6b9e131b6584a265cf Mon Sep 17 00:00:00 2001 From: reed Date: Mon, 22 Feb 2016 10:25:45 -0800 Subject: [PATCH] remove dead unpremul checks BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1715333004 Review URL: https://codereview.chromium.org/1715333004 --- src/effects/SkArithmeticMode_gpu.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp index 103931c..7fb6d66 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); } -- 2.7.4