3 ms·
...I couldn't find a way to get the Java APIs to render image data that was stored in memory used by C; you had to copy the data back into Java first. I think
by pavlov 12y ago
...I couldn't find a way to get the Java APIs to render image data that was stored in memory used by C; you had to copy the data back into Java first.
I think you could use a GPU surface for that. On iOS there's IOSurface, which is basically a GPU-accessible memory buffer from the window manager that can be shared between processes. AFAIK there's something similar on Android, but I'm not sure off-hand what it's called.
The idea is to get a surface and blit your image there on the C side; then access that surface as a texture on the Java side and draw it directly into a view. That way the pixels are never touched by the Java code.
- seanwilson 12y agoThis was around the Android 2.1 days; I considered switching to OpenGL but I think I was deterred by inconsistent device support at the time and thought the Java option was less of a headache. I'd be very interested in more details about the solution you mentioned!