David
01/17/2025, 9:46 AMGLSurfaceView 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 🧵)David
01/17/2025, 9:48 AMNative method - com.google.android.gles_jni.EGLImpl.eglSwapBuffersAlex Vanyo
01/17/2025, 11:45 PMGLSurfaceView 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 usefulDavid
01/18/2025, 2:56 PM