android: keep EGL extension slots for Skia (the UI did not start on Waydroid)
On Waydroid the app ended right after start: "Could not create Skia Direct Context from GL interface", after libEGL logged "no more slots for eglGetProcAddress". Android's libEGL gives every GL function without a built-in entry point one of 256 extension slots on its first lookup. Slint's Skia OpenGL surface loads glow's whole function table (desktop GL included) before Skia assembles its interface; Mesa returns an entry point for every name, so the slots run out, Skia gets NULL for glTextureBarrierNV (advertised through GL_NV_texture_barrier) and refuses the interface. Look up the 83 extension functions Skia's GLES interface can use (Skia m153's GrGLAssembleGLESInterfaceAutogen.cpp) once per process before Slint creates its surface, so they get slots first; glow's desktop-only lookups are the ones that fail. Vendor drivers return NULL for desktop-only names and were not affected. docs/android.md explains it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
1 parent
e050148a32
commit
f7ada91fcd
4 files changed
+163
-1
No files matched your search
@@ -14,6 +14,8 @@
|
||||
//! - `capture` (Android): screen and system-audio capture through
|
||||
//! MediaProjection, registered as `voelin_media` capture providers
|
||||
//! - `secrets` (Android): passwords encrypted with an Android Keystore key
|
||||
//! - `egl` (Android): keeps EGL extension slots for Skia, without which the
|
||||
//! UI cannot draw on Mesa-based Android (Waydroid)
|
||||
//!
|
||||
//! Only [`host`] and [`foreground`] build on other platforms, for tests.
|
||||
|
||||
@@ -27,4 +29,6 @@ mod bridge;
|
||||
#[cfg(target_os = "android")]
|
||||
mod capture;
|
||||
#[cfg(target_os = "android")]
|
||||
mod egl;
|
||||
#[cfg(target_os = "android")]
|
||||
mod secrets;
|
||||
Reference in new issue
Block a user