diff options
author | Derek Sollenberger <djsollen@google.com> | 2015-03-06 13:48:27 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2015-03-06 13:51:04 -0500 |
commit | c0bf700441e1b53f1693d7445dc6f9876f5c9b4f (patch) | |
tree | 3c5e3c8d822bec972071064d7804e467f324983f | |
parent | 1592f98973ffffe828d34d90ddb944947d510eba (diff) | |
download | frameworks_base-c0bf700441e1b53f1693d7445dc6f9876f5c9b4f.zip frameworks_base-c0bf700441e1b53f1693d7445dc6f9876f5c9b4f.tar.gz frameworks_base-c0bf700441e1b53f1693d7445dc6f9876f5c9b4f.tar.bz2 |
SkPorterDuff Multiply mode maps to SkXfermode modulate.
bug:19627342
Change-Id: I97f26ca1bc8abe2768f4a12cc70fb0fa5d905098
-rw-r--r-- | graphics/java/android/graphics/PorterDuff.java | 2 | ||||
-rw-r--r-- | libs/hwui/ProgramCache.cpp | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/graphics/java/android/graphics/PorterDuff.java b/graphics/java/android/graphics/PorterDuff.java index f5fbe70..dcccf35 100644 --- a/graphics/java/android/graphics/PorterDuff.java +++ b/graphics/java/android/graphics/PorterDuff.java @@ -51,7 +51,7 @@ public class PorterDuff { Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)] */ LIGHTEN (17), /** [Sa * Da, Sc * Dc] */ - MULTIPLY (24), + MULTIPLY (13), /** [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] */ SCREEN (14), /** Saturate(S + D) */ diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index 7ad4a57..e9b22e2 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -380,9 +380,9 @@ const char* gBlendOps[18] = { // Xor "return vec4(src.rgb * (1.0 - dst.a) + (1.0 - src.a) * dst.rgb, " "src.a + dst.a - 2.0 * src.a * dst.a);\n", - // Add + // Plus "return min(src + dst, 1.0);\n", - // Multiply + // Modulate "return src * dst;\n", // Screen "return src + dst - src * dst;\n", @@ -777,9 +777,6 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti } void ProgramCache::generateBlend(String8& shader, const char* name, SkXfermode::Mode mode) { - // TODO: update gBlendOps so this workaround isn't necessary - if (mode > SkXfermode::kPlus_Mode) mode = SkXfermode::kClear_Mode; - shader.append("\nvec4 "); shader.append(name); shader.append("(vec4 src, vec4 dst) {\n"); |