Index: src/core/SkXfermode.cpp |
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp |
index 0cc120dfa7db2104edd36c0240ba55b74c9b99c4..6d893a426d13e9b5d7edddd1b9c707ee7f02a071 100644 |
--- a/src/core/SkXfermode.cpp |
+++ b/src/core/SkXfermode.cpp |
@@ -1100,10 +1100,10 @@ public: |
setLumBody.appendf("\tfloat outLum = %s(outColor);\n", getFunction.c_str()); |
setLumBody.append("\tfloat minComp = min(min(outColor.r, outColor.g), outColor.b);\n" |
"\tfloat maxComp = max(max(outColor.r, outColor.g), outColor.b);\n" |
- "\tif (minComp < 0.0) {\n" |
+ "\tif (minComp < 0.0 && outLum != minComp) {\n" |
"\t\toutColor = outLum + ((outColor - vec3(outLum, outLum, outLum)) * outLum) / (outLum - minComp);\n" |
"\t}\n" |
- "\tif (maxComp > alpha) {\n" |
+ "\tif (maxComp > alpha && maxComp != outLum) {\n" |
"\t\toutColor = outLum + ((outColor - vec3(outLum, outLum, outLum)) * (alpha - outLum)) / (maxComp - outLum);\n" |
"\t}\n" |
"\treturn outColor;\n"); |