Landry Norris
02/28/2023, 3:49 PMKirill Grouchnikov
02/28/2023, 3:50 PMLandry Norris
02/28/2023, 3:51 PMromainguy
02/28/2023, 3:54 PMCanvas
isn’t a backing store, it’s an interface to write into a bitmapLandry Norris
02/28/2023, 3:55 PMKirill Grouchnikov
02/28/2023, 3:55 PMromainguy
02/28/2023, 3:55 PMBitmap
from an IntArray
just fine (or even lock/unlockPixels
in JNI to write into the bitmap directly)Landry Norris
02/28/2023, 3:57 PMromainguy
02/28/2023, 3:58 PMLandry Norris
02/28/2023, 4:02 PMromainguy
02/28/2023, 4:04 PMhen whatever runtime cost it is to draw the bitmap to the compose canvas (the last part is likely the least performance cost).
Landry Norris
02/28/2023, 4:05 PMromainguy
02/28/2023, 4:05 PMLandry Norris
02/28/2023, 4:07 PMromainguy
02/28/2023, 4:08 PMLandry Norris
02/28/2023, 4:09 PMromainguy
02/28/2023, 4:10 PMSurface
Buffer
to do the copyTo/FromBuffer
, and not use an IntArray
lockPixels
Buffer
, your JNI can just get a pointer to the data to skip at least one copylockPixels
will be copy-lessLandry Norris
02/28/2023, 4:13 PMromainguy
02/28/2023, 4:13 PMSurfaceView
shows its content in a separate windowTextureView
is part of the UI hierarchyPixelCopy
on Android insteadLandry Norris
02/28/2023, 4:14 PMromainguy
02/28/2023, 4:16 PMTextureView
and SurfaceView
is that TextureView
requires an extra GPU copy at draw time, but should otherwise be the sameLandry Norris
02/28/2023, 4:17 PMromainguy
02/28/2023, 4:19 PMTextureView
Landry Norris
02/28/2023, 4:21 PMromainguy
02/28/2023, 4:26 PMSurface
or lockPixels
, it’s going to be your best solution if you are dead set on doing the decoding yourselfLandry Norris
02/28/2023, 4:33 PMromainguy
02/28/2023, 4:33 PMLandry Norris
02/28/2023, 4:34 PMromainguy
02/28/2023, 4:37 PMLandry Norris
02/28/2023, 4:39 PM