diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2015-11-24 19:46:09 -0600 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2015-11-24 19:50:52 -0600 |
commit | e881f0feebeec31582b3fbb848aeeb8b7ed70a32 (patch) | |
tree | 203802e309f643e47e4ee0d22c64f87f94bad919 /components/layout/context.rs | |
parent | 6f35b867c9c3bb7a345e2ac34e5970b93a1d3ea1 (diff) | |
download | servo-e881f0feebeec31582b3fbb848aeeb8b7ed70a32.tar.gz servo-e881f0feebeec31582b3fbb848aeeb8b7ed70a32.zip |
Write animated values into the `ComputedValues` structures when
animations complete or are interrupted.
This adds a new pair of reader-writer locks. I measured the performance
of style recalculation on Wikipedia and the overhead of the locks was
not measurable.
Closes #7816.
Diffstat (limited to 'components/layout/context.rs')
-rw-r--r-- | components/layout/context.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/layout/context.rs b/components/layout/context.rs index f6058eaaf44..624fb01a127 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -25,7 +25,7 @@ use std::collections::HashMap; use std::collections::hash_state::DefaultState; use std::rc::Rc; use std::sync::mpsc::{Sender, channel}; -use std::sync::{Arc, Mutex}; +use std::sync::{Arc, Mutex, RwLock}; use style::selector_matching::Stylist; use url::Url; use util::mem::HeapSizeOf; @@ -120,7 +120,10 @@ pub struct SharedLayoutContext { pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>, /// The animations that are currently running. - pub running_animations: Arc<HashMap<OpaqueNode, Vec<Animation>>>, + pub running_animations: Arc<RwLock<HashMap<OpaqueNode, Vec<Animation>>>>, + + /// The list of animations that have expired since the last style recalculation. + pub expired_animations: Arc<RwLock<HashMap<OpaqueNode, Vec<Animation>>>>, /// Why is this reflow occurring pub goal: ReflowGoal, |