Android Custom XferMode / PorterDuff.Mode

There are some predefined blending modes described here: https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html

Is it possible to use other user modes? (for drawing various materials on canvas)

For example, I really need two more:

  • Replace alpha (it will be written as [Sa, Dc] , if I understand correctly)
  • Mix using destination alpha [Sa, Da * Sc + (1 - Da) * Dc] (I don't care about the alpha result here)

And it would be nice if it required OpenGL ES 2 +.

There is a [remote] similar question: Implementing various PorterDuff modes in android - but the answer seems to require the use of two bitmaps, and I want to stay free from temporary bitmaps because they ... are not free.

+5
source share

Source: https://habr.com/ru/post/1215726/


All Articles