diff options
author | reed <reed@google.com> | 2016-02-22 10:25:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-22 10:25:45 -0800 |
commit | d778febae6ee4de8f0519c6b9e131b6584a265cf (patch) | |
tree | 3654f5db277ba9fb8d5b2df16d376bb9a992392b /src | |
parent | 32119f1ba0b78e69e3cc06307e6d09f3ccd62a1e (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkArithmeticMode_gpu.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp index 103931ce18..7fb6d66050 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); } |