From 21df4014db5ff11581fcdd328d2dd1f7226a4544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 9 Mar 2018 23:27:29 +0100 Subject: 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. --- components/script/script_thread.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'components/script/script_thread.rs') diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index f386d29487e..d949e9d0b8c 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -483,8 +483,8 @@ pub struct ScriptThread { /// The unit of related similar-origin browsing contexts' list of MutationObserver objects mutation_observers: DomRefCell>>, - /// A handle to the webgl thread - webgl_chan: WebGLPipeline, + /// A handle to the WebGL thread + webgl_chan: Option, /// A handle to the webvr thread, if available webvr_chan: Option>, @@ -2130,7 +2130,7 @@ impl ScriptThread { origin, incomplete.navigation_start, incomplete.navigation_start_precise, - self.webgl_chan.channel(), + self.webgl_chan.as_ref().map(|chan| chan.channel()), self.webvr_chan.clone(), self.microtask_queue.clone(), self.webrender_document, -- cgit v1.2.3