Implement optimized blending modes for Color Smudge paintop
The patch implements several things:
-
Adds U16 versions of Over and AlphaDarken composite ops. The basic memory access is taken from Mathias Wein's (!584 (closed)) patch
-
Adds implementation of Copy composite op for U8, U16 and F32 color spaces. This composite op is used a lot in colorsmudge.
-
The patch makes F32 and U16 (and U8 for "copy") composite ops to reuse the same codebase.
In comparison to !584 (closed) this patch has two things "not implemented yet":
- No optimization for alpha-locked state
- No optimization for separate read/demangle of the alpha channel value
Both these optimizations can be added later.
Benchmarking results for 200px auto brush:
old (ms) | new (ms) | speed increase (%) | |
---|---|---|---|
Dulling, Smear Alpha | 8212 | 6616 | 19.43% |
Dulling, No Smear Alpha | 6983 | 6600 | 5.48% |
Smearing, Smear Alpha | 6658 | 4875 | 26.78% |
Smearing, No Smear Alpha | 5604 | 4869 | 13.12% |
Test Plan
-
Try to paint with normal brush in "wash" mode with low opacity/flow values. There should be no artifacts visible
-
Try to paint with ColorSmudge brush in the following modes:
-
Smear Alpha is on/off
-
Inherit Alpha is on/off
-
Any selection is on/off
-
Some color channels of the layer are off
-
Test Packages
- DK1
Ref T12987