mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Hoist bloom filter into scoped TLS and simplify code.
This commit is contained in:
parent
25f32c4513
commit
b6e948dc5d
7 changed files with 19 additions and 130 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
use animation::Animation;
|
||||
use app_units::Au;
|
||||
use bloom::StyleBloom;
|
||||
use dom::{OpaqueNode, TElement};
|
||||
use error_reporting::ParseErrorReporter;
|
||||
use euclid::Size2D;
|
||||
|
@ -77,6 +78,7 @@ pub struct SharedStyleContext {
|
|||
|
||||
pub struct ThreadLocalStyleContext<E: TElement> {
|
||||
pub style_sharing_candidate_cache: StyleSharingCandidateCache<E>,
|
||||
pub bloom_filter: StyleBloom,
|
||||
/// A channel on which new animations that have been triggered by style
|
||||
/// recalculation can be sent.
|
||||
pub new_animations_sender: Sender<Animation>,
|
||||
|
@ -86,6 +88,7 @@ impl<E: TElement> ThreadLocalStyleContext<E> {
|
|||
pub fn new(shared: &SharedStyleContext) -> Self {
|
||||
ThreadLocalStyleContext {
|
||||
style_sharing_candidate_cache: StyleSharingCandidateCache::new(),
|
||||
bloom_filter: StyleBloom::new(),
|
||||
new_animations_sender: shared.local_context_creation_data.lock().unwrap().new_animations_sender.clone(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue