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,7 +14,7 @@ use voelin_core::Command;
|
||||
|
||||
use crate::foreground::Foreground;
|
||||
use crate::host::EngineHost;
|
||||
use crate::{bridge, capture, secrets};
|
||||
use crate::{bridge, capture, egl, secrets};
|
||||
|
||||
/// Store setting (`bool`): the user's opt-in to local crash reports.
|
||||
pub const CRASH_REPORTS_SETTING: &str = "crash_reports";
|
||||
@@ -73,6 +73,8 @@ fn run(app: AndroidApp) -> anyhow::Result<()> {
|
||||
let host = host()?;
|
||||
static PROCESS: Once = Once::new();
|
||||
PROCESS.call_once(|| {
|
||||
// Before Slint creates the first window surface.
|
||||
egl::reserve_skia_extension_slots();
|
||||
capture::register();
|
||||
watch_voice(host);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user