From 1a10ca7e526736b4fd143f7c9f3b29643c0062a4 Mon Sep 17 00:00:00 2001 From: Deepanshu Gupta Date: Thu, 26 Feb 2015 14:34:57 -0800 Subject: Correct PorterDuff filters. 1. Remove unused modes - makes the class more manageable, and missing modes can always be readded from the git history. 2. Reuse the existing BlendComposite instances where possible. 3. Fix incorrect alpha computation for multiply mode. 4. Change the alpha computation for all blend modes to compenstate for the fact that the color filter image that we create extends beyond the image it is inteded to be applied to. Change-Id: Iedebf289a23325ee4c6d406dcad46a9edb1855c7 --- .../bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java') diff --git a/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java index 4ac376c..1ca94dc 100644 --- a/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/PorterDuffColorFilter_Delegate.java @@ -103,7 +103,7 @@ public class PorterDuffColorFilter_Delegate extends ColorFilter_Delegate { // For filtering the colors, the src image should contain the "color" only for pixel values // which are not transparent in the target image. But, we are using a simple rectangular image // completely filled with color. Hence some Composite rules do not apply as intended. However, - // in such cases, they can usually be mapped to some other mode, which produces an + // in such cases, they can usually be mapped to some other mode, which produces an approximately // equivalent result. private Mode getCompatibleMode(Mode mode) { Mode m = mode; -- cgit v1.1