mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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.
This commit is contained in:
parent
5478e605ae
commit
203d2a62c2
15 changed files with 166 additions and 134 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue