mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
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.
This commit is contained in:
parent
6f35b867c9
commit
e881f0feeb
5 changed files with 134 additions and 56 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue