mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Pass GLPlayerThreads to constellation
Create the thread only if the GL context is known.
This commit is contained in:
parent
43467b4290
commit
dd01728d53
3 changed files with 28 additions and 1 deletions
|
@ -104,6 +104,7 @@ use background_hang_monitor::HangMonitorRegister;
|
|||
use backtrace::Backtrace;
|
||||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas::canvas_paint_thread::CanvasPaintThread;
|
||||
use canvas::media_thread::GLPlayerThreads;
|
||||
use canvas::webgl_thread::WebGLThreads;
|
||||
use canvas_traits::canvas::CanvasId;
|
||||
use canvas_traits::canvas::CanvasMsg;
|
||||
|
@ -411,6 +412,9 @@ pub struct Constellation<Message, LTF, STF> {
|
|||
/// results are required.
|
||||
enable_canvas_antialiasing: bool,
|
||||
|
||||
/// Entry point to create and get channels to a GLPlayerThread.
|
||||
glplayer_threads: Option<GLPlayerThreads>,
|
||||
|
||||
/// Application window's GL Context for Media player
|
||||
player_context: WindowGLContext,
|
||||
}
|
||||
|
@ -461,6 +465,8 @@ pub struct InitialConstellationState {
|
|||
|
||||
/// The XR device registry
|
||||
pub webxr_registry: webxr_api::Registry,
|
||||
|
||||
pub glplayer_threads: Option<GLPlayerThreads>,
|
||||
|
||||
/// Application window's GL Context for Media player
|
||||
pub player_context: WindowGLContext,
|
||||
|
@ -760,6 +766,7 @@ where
|
|||
is_running_problem_test,
|
||||
hard_fail,
|
||||
enable_canvas_antialiasing,
|
||||
glplayer_threads: state.glplayer_threads,
|
||||
player_context: state.player_context,
|
||||
};
|
||||
|
||||
|
@ -1804,6 +1811,13 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
debug!("Exiting GLPlayer thread.");
|
||||
if let Some(glplayer_threads) = self.glplayer_threads.as_ref() {
|
||||
if let Err(e) = glplayer_threads.exit() {
|
||||
warn!("Exit GLPlayer Thread failed ({})", e);
|
||||
}
|
||||
}
|
||||
|
||||
debug!("Exiting timer scheduler.");
|
||||
if let Err(e) = self.scheduler_chan.send(TimerSchedulerMsg::Exit) {
|
||||
warn!("Exit timer scheduler failed ({})", e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue