diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-25 08:00:14 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-25 08:00:14 +0530 |
commit | 4f625d3ab67bc14b1563f90c48cf97ca59dc1a28 (patch) | |
tree | c21358898bfb9ed2746c9bc29f1e073ffae2e26b /components/layout/context.rs | |
parent | 13a96fcaf78c299beb2021d3ae9dae8d9e916762 (diff) | |
parent | e881f0feebeec31582b3fbb848aeeb8b7ed70a32 (diff) | |
download | servo-4f625d3ab67bc14b1563f90c48cf97ca59dc1a28.tar.gz servo-4f625d3ab67bc14b1563f90c48cf97ca59dc1a28.zip |
Auto merge of #8670 - pcwalton:animation-expiration, r=glennw
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.
cc @paulrouget
r? @glennw
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8670)
<!-- Reviewable:end -->
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, |