Hello! We are rendering a `GLSurfaceView` in an `A...
# compose-android
d
Hello! We are rendering a
GLSurfaceView
in an
AndroidView
to be able to render some 3D graphics (source), however we seem to hit some ANRs (about 80 events per month on several hundred thousands users). From reading up
GLSurfaceView
implementation is a bit iffy, and was never originally build with Compose in mind, so my guess is that we are getting some race conditions when starting/stopping the rendering thread along with the surface. I saw that recently
androidx.graphics:graphics-core
was introduced, which supposedly should handle lifecycle better. Anyone have any examples on how to implemented the GLRenderer along with Compose? (I've attached logs from our crash in 🧵)
Most common crash:
Native method - com.google.android.gles_jni.EGLImpl.eglSwapBuffers
a
I have a WIP PR switching from a
GLSurfaceView
to a
GLRenderer
+
AndroidExternalSurface
here that might be useful as a reference: https://github.com/alexvanyo/composelife/pull/1908 I'm running into one issue with
GLRenderer
when the surface resizes on physical devices, but hopefully the before and after could still be useful
🙌 1
d
Sweet @Alex Vanyo! That fits me perfectly, thanks I'll take a look at it!