Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a10ca7e authored by Deepanshu Gupta's avatar Deepanshu Gupta
Browse files

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
parent d68448a6
Loading
Loading
Loading
Loading
+36 −516

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -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;