There are some predefined blending modes described here: https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html
Is there a possibility to use some other custom modes? (for drawing various stuff on Canvas)
For example, I really need two more:
- Replace the alpha (it would be written as
[Sa, Dc]
if I understand right) - Blend using destination alpha
[Sa, Da * Sc + (1 - Da) * Dc]
(here I don't really care about the result's alpha)
And it would be OK if it would require OpenGL ES 2+.
There's a [remotely] similar question here: Implementing different PorterDuff modes in android — but the answer seems to require using two bitmaps, and I want to stay free of temporary bitmaps, because they are… not free.
Paint
probably) over an existing image B (Canvas
), using some function with 2 inputs (pixel from A, pixel from B) to compute the final pixels. – Tearjerker