# compose

Landry Norris

02/19/2022, 6:03 PM
I'm evaluating switching existing code from the Android View library to compose. One feature of the app was implemented in C (now kotlin/native after I refactored it) and writes raw RGBA data to a surface using the NDK's ANativeWindow. Does Compose have something equivalent, or would I need to use platform interop with a TextureView like I have now?
I think I could also get away with writing to a bitmap if Compose has something for that, but the rendering has to stay native for performance reasons. I also need it to work through the JNI like Surface and ANativeWindow do.


02/19/2022, 6:30 PM
You can keep doing the same, you can embed a SurfaceView inside Compose
Or a TextureView. But unless you have good reasons to do so, use a SurfaceView, it's more efficient

Landry Norris

02/19/2022, 6:34 PM
I used a SurfaceView originally, but I switched to TextureView due to issues I can't remember. I wrote this code about a year ago.