diff options
author | Josh Matthews <josh@joshmatthews.net> | 2019-07-25 20:43:57 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-07-25 23:07:23 -0400 |
commit | a2ca3ddbd95f45e8e02eaa4ed39ab7283fc49aa3 (patch) | |
tree | fc7aa7243321a44350d7b81f072e10184f2cce28 /components/constellation | |
parent | d7269ad3c667ac71226380abd0002d2f7109bd01 (diff) | |
download | servo-a2ca3ddbd95f45e8e02eaa4ed39ab7283fc49aa3.tar.gz servo-a2ca3ddbd95f45e8e02eaa4ed39ab7283fc49aa3.zip |
Remove extra webgl message pumping thread.
Diffstat (limited to 'components/constellation')
-rw-r--r-- | components/constellation/constellation.rs | 10 | ||||
-rw-r--r-- | components/constellation/pipeline.rs | 12 |
2 files changed, 20 insertions, 2 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 9a4d8b3e93f..6b87dca2036 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -112,7 +112,7 @@ use compositing::compositor_thread::Msg as ToCompositorMsg; use compositing::SendableFrameTree; use crossbeam_channel::{unbounded, Receiver, Sender}; use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg}; -use embedder_traits::{Cursor, EmbedderMsg, EmbedderProxy}; +use embedder_traits::{Cursor, EmbedderMsg, EmbedderProxy, EventLoopWaker}; use euclid::{default::Size2D as UntypedSize2D, Scale, Size2D}; use gfx::font_cache_thread::FontCacheThread; use gfx_traits::Epoch; @@ -416,6 +416,9 @@ pub struct Constellation<Message, LTF, STF> { /// Application window's GL Context for Media player player_context: WindowGLContext, + + /// Mechanism to force the compositor to process events. + event_loop_waker: Option<Box<dyn EventLoopWaker>>, } /// State needed to construct a constellation. @@ -469,6 +472,9 @@ pub struct InitialConstellationState { /// Application window's GL Context for Media player pub player_context: WindowGLContext, + + /// Mechanism to force the compositor to process events. + pub event_loop_waker: Option<Box<dyn EventLoopWaker>>, } /// Data needed for webdriver @@ -767,6 +773,7 @@ where enable_canvas_antialiasing, glplayer_threads: state.glplayer_threads, player_context: state.player_context, + event_loop_waker: state.event_loop_waker, }; constellation.run(); @@ -1009,6 +1016,7 @@ where webvr_chan: self.webvr_chan.clone(), webxr_registry: self.webxr_registry.clone(), player_context: self.player_context.clone(), + event_loop_waker: self.event_loop_waker.as_ref().map(|w| (*w).clone_box()), }); let pipeline = match result { diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index d2c006d368c..43c6a13524f 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -11,6 +11,7 @@ use compositing::CompositionPipeline; use compositing::CompositorProxy; use crossbeam_channel::Sender; use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg}; +use embedder_traits::EventLoopWaker; use euclid::{Scale, Size2D}; use gfx::font_cache_thread::FontCacheThread; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; @@ -195,6 +196,9 @@ pub struct InitialPipelineState { /// Application window's GL Context for Media player pub player_context: WindowGLContext, + + /// Mechanism to force the compositor to process events. + pub event_loop_waker: Option<Box<dyn EventLoopWaker>>, } pub struct NewPipeline { @@ -327,7 +331,11 @@ impl Pipeline { let register = state .background_monitor_register .expect("Couldn't start content, no background monitor has been initiated"); - unprivileged_pipeline_content.start_all::<Message, LTF, STF>(false, register); + unprivileged_pipeline_content.start_all::<Message, LTF, STF>( + false, + register, + state.event_loop_waker, + ); None }; @@ -524,6 +532,7 @@ impl UnprivilegedPipelineContent { self, wait_for_completion: bool, background_hang_monitor_register: Box<dyn BackgroundHangMonitorRegister>, + event_loop_waker: Option<Box<dyn EventLoopWaker>>, ) where LTF: LayoutThreadFactory<Message = Message>, STF: ScriptThreadFactory<Message = Message>, @@ -566,6 +575,7 @@ impl UnprivilegedPipelineContent { webrender_api_sender: self.webrender_api_sender.clone(), layout_is_busy: layout_thread_busy_flag.clone(), player_context: self.player_context.clone(), + event_loop_waker, }, self.load_data.clone(), self.opts.profile_script_events, |