Landry Norris
02/28/2023, 3:49 PMLandry Norris
02/28/2023, 3:50 PMKirill Grouchnikov
02/28/2023, 3:50 PMLandry Norris
02/28/2023, 3:51 PMLandry Norris
02/28/2023, 3:51 PMLandry Norris
02/28/2023, 3:53 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)romainguy
02/28/2023, 3:56 PMLandry Norris
02/28/2023, 3:57 PMromainguy
02/28/2023, 3:58 PMromainguy
02/28/2023, 3:58 PMromainguy
02/28/2023, 3:58 PMLandry Norris
02/28/2023, 4:02 PMromainguy
02/28/2023, 4:04 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).
romainguy
02/28/2023, 4:04 PMromainguy
02/28/2023, 4:05 PMLandry Norris
02/28/2023, 4:05 PMromainguy
02/28/2023, 4:05 PMromainguy
02/28/2023, 4:07 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
romainguy
02/28/2023, 4:11 PMBuffer
to do the copyTo/FromBuffer
, and not use an IntArray
romainguy
02/28/2023, 4:11 PMlockPixels
romainguy
02/28/2023, 4:12 PMBuffer
, your JNI can just get a pointer to the data to skip at least one copyromainguy
02/28/2023, 4:12 PMlockPixels
will be copy-lessLandry Norris
02/28/2023, 4:13 PMromainguy
02/28/2023, 4:13 PMSurfaceView
shows its content in a separate windowromainguy
02/28/2023, 4:13 PMTextureView
is part of the UI hierarchyromainguy
02/28/2023, 4:13 PMPixelCopy
on Android insteadLandry Norris
02/28/2023, 4:14 PMLandry Norris
02/28/2023, 4:16 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 PMLandry Norris
02/28/2023, 4:19 PMromainguy
02/28/2023, 4:19 PMTextureView
romainguy
02/28/2023, 4:19 PMromainguy
02/28/2023, 4:20 PMLandry 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 PMromainguy
02/28/2023, 4:33 PMLandry Norris
02/28/2023, 4:34 PMromainguy
02/28/2023, 4:37 PMromainguy
02/28/2023, 4:37 PMLandry Norris
02/28/2023, 4:39 PM