mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
constellation: Make setting up the WebGL state fallible.
This fixes a regression caused by the glutin update. We now are creating EGL contexts in Linux Wayland, instead of X context, so the GLContextFactory assumption of one GL back-end per platform is broken. This just works around it, for now, but in general I think not relying on available WebGL state is a good thing, and we do that already for WebVR anyway.
This commit is contained in:
parent
3fc5bf87d3
commit
21df4014db
8 changed files with 48 additions and 31 deletions
|
@ -24,6 +24,9 @@ pub enum GLContextFactory {
|
|||
impl GLContextFactory {
|
||||
/// Creates a new GLContextFactory that uses the currently bound GL context to create shared contexts.
|
||||
pub fn current_native_handle(proxy: &CompositorProxy) -> Option<GLContextFactory> {
|
||||
// FIXME(emilio): This assumes a single GL backend per platform which is
|
||||
// not true on Linux, we probably need a third `Egl` variant or abstract
|
||||
// it a bit more...
|
||||
NativeGLContext::current_handle().map(|handle| {
|
||||
if cfg!(target_os = "windows") {
|
||||
// Used to dispatch functions from the GLContext thread to the main thread's event loop.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue