mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Create the WindowGLContext at create_constellation()
This commit is contained in:
parent
eb3857237c
commit
db4fff173d
1 changed files with 16 additions and 14 deletions
|
@ -306,21 +306,11 @@ where
|
||||||
None
|
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 {
|
let player_context = WindowGLContext {
|
||||||
gl_context,
|
gl_context: window.get_gl_context(),
|
||||||
native_display: window.get_native_display(),
|
native_display: window.get_native_display(),
|
||||||
gl_api: window.get_gl_api(),
|
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
|
// Create the constellation, which maintains the engine
|
||||||
|
@ -341,7 +331,6 @@ where
|
||||||
window.gl(),
|
window.gl(),
|
||||||
webvr_services,
|
webvr_services,
|
||||||
webxr_registry,
|
webxr_registry,
|
||||||
glplayer_threads,
|
|
||||||
player_context,
|
player_context,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -653,7 +642,6 @@ fn create_constellation(
|
||||||
window_gl: Rc<dyn gl::Gl>,
|
window_gl: Rc<dyn gl::Gl>,
|
||||||
webvr_services: Option<VRServiceManager>,
|
webvr_services: Option<VRServiceManager>,
|
||||||
webxr_registry: webxr_api::Registry,
|
webxr_registry: webxr_api::Registry,
|
||||||
glplayer_threads: Option<GLPlayerThreads>,
|
|
||||||
player_context: WindowGLContext,
|
player_context: WindowGLContext,
|
||||||
) -> (Sender<ConstellationMsg>, SWManagerSenders) {
|
) -> (Sender<ConstellationMsg>, SWManagerSenders) {
|
||||||
// Global configuration options, parsed from the command line.
|
// Global configuration options, parsed from the command line.
|
||||||
|
@ -720,6 +708,20 @@ fn create_constellation(
|
||||||
webgl_threads
|
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 {
|
let initial_state = InitialConstellationState {
|
||||||
compositor_proxy,
|
compositor_proxy,
|
||||||
embedder_proxy,
|
embedder_proxy,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue