diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2019-06-19 18:40:19 +0200 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-07-04 10:25:49 +0200 |
commit | db4fff173d11b7b7a67775e3a7274a84aa0340d9 (patch) | |
tree | 5f9496e9ba983c001ceb11daad929d452bfa534e | |
parent | eb3857237c2760ed17a2888f01c069566def509f (diff) | |
download | servo-db4fff173d11b7b7a67775e3a7274a84aa0340d9.tar.gz servo-db4fff173d11b7b7a67775e3a7274a84aa0340d9.zip |
Create the WindowGLContext at create_constellation()
-rw-r--r-- | components/servo/lib.rs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 185d5c5838e..9917c8bea9a 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -306,21 +306,11 @@ where None }; - let gl_context = window.get_gl_context(); - let glplayer_threads = match gl_context { - GlContext::Unknown => None, - _ => { - let (glplayer_threads, image_handler) = GLPlayerThreads::new(); - webrender.set_external_image_handler(image_handler); - Some(glplayer_threads) - }, - }; - let player_context = WindowGLContext { - gl_context, + gl_context: window.get_gl_context(), native_display: window.get_native_display(), gl_api: window.get_gl_api(), - glplayer_chan: glplayer_threads.as_ref().map(|threads| threads.pipeline()), + glplayer_chan: None, }; // Create the constellation, which maintains the engine @@ -341,7 +331,6 @@ where window.gl(), webvr_services, webxr_registry, - glplayer_threads, player_context, ); @@ -653,7 +642,6 @@ fn create_constellation( window_gl: Rc<dyn gl::Gl>, webvr_services: Option<VRServiceManager>, webxr_registry: webxr_api::Registry, - glplayer_threads: Option<GLPlayerThreads>, player_context: WindowGLContext, ) -> (Sender<ConstellationMsg>, SWManagerSenders) { // Global configuration options, parsed from the command line. @@ -720,6 +708,20 @@ fn create_constellation( webgl_threads }); + let glplayer_threads = match player_context.gl_context { + GlContext::Unknown => None, + _ => { + let (glplayer_threads, image_handler) = GLPlayerThreads::new(); + webrender.set_external_image_handler(image_handler); + Some(glplayer_threads) + }, + }; + + let player_context = WindowGLContext { + glplayer_chan: glplayer_threads.as_ref().map(|threads| threads.pipeline()), + ..player_context + }; + let initial_state = InitialConstellationState { compositor_proxy, embedder_proxy, |