diff options
author | Emilio Cobos Álvarez <me@emiliocobos.me> | 2016-06-29 20:04:30 -0700 |
---|---|---|
committer | Emilio Cobos Álvarez <me@emiliocobos.me> | 2016-07-01 13:48:06 -0700 |
commit | 203d2a62c24ca3d8b07e4ec492fc53bb30bbeedc (patch) | |
tree | 979b0367ce41c744c270a54092c962b916f5a6e9 /components/layout_thread | |
parent | 5478e605aef93cc384b709688cc68e3ed854a68b (diff) | |
download | servo-203d2a62c24ca3d8b07e4ec492fc53bb30bbeedc.tar.gz servo-203d2a62c24ca3d8b07e4ec492fc53bb30bbeedc.zip |
style: Remove the Mutex from new_animations_sender by moving it to the local StyleContext.
As a follow-up, we could move all the data living under a mutex in the
SharedLayoutContext only in order to create the local context to the same place.
This should increase animation performance when there are multiple animations in
one page that happen to be on different threads.
Diffstat (limited to 'components/layout_thread')
-rw-r--r-- | components/layout_thread/lib.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index b33a5c56eb1..8b147955569 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -108,7 +108,7 @@ use style::parallel::WorkQueueData; use style::properties::ComputedValues; use style::refcell::RefCell; use style::selector_matching::USER_OR_USER_AGENT_STYLESHEETS; -use style::servo::{Animation, SharedStyleContext, Stylesheet, Stylist}; +use style::servo::{Animation, LocalStyleContextCreationInfo, SharedStyleContext, Stylesheet, Stylist}; use style::stylesheets::CSSRuleIteratorExt; use url::Url; use util::geometry::MAX_RECT; @@ -488,6 +488,8 @@ impl LayoutThread { screen_size_changed: bool, goal: ReflowGoal) -> SharedLayoutContext { + let local_style_context_creation_data = LocalStyleContextCreationInfo::new(self.new_animations_sender.clone()); + SharedLayoutContext { style_context: SharedStyleContext { viewport_size: self.viewport_size.clone(), @@ -495,10 +497,10 @@ impl LayoutThread { stylist: rw_data.stylist.clone(), generation: self.generation, goal: goal, - new_animations_sender: Mutex::new(self.new_animations_sender.clone()), running_animations: self.running_animations.clone(), expired_animations: self.expired_animations.clone(), error_reporter: self.error_reporter.clone(), + local_context_creation_data: Mutex::new(local_style_context_creation_data), }, image_cache_thread: self.image_cache_thread.clone(), image_cache_sender: Mutex::new(self.image_cache_sender.clone()), |