mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Encapsulate the sharing cache backend better.
MozReview-Commit-ID: 2x9BIhmwH83
This commit is contained in:
parent
c409c2089c
commit
74b4f95d71
3 changed files with 114 additions and 118 deletions
|
@ -624,7 +624,6 @@ where
|
|||
E: TElement,
|
||||
{
|
||||
use data::RestyleKind::*;
|
||||
use sharing::StyleSharingResult::*;
|
||||
|
||||
context.thread_local.statistics.elements_styled += 1;
|
||||
let kind = data.restyle_kind(context.shared);
|
||||
|
@ -656,12 +655,11 @@ where
|
|||
// Now that our bloom filter is set up, try the style sharing
|
||||
// cache.
|
||||
match target.share_style_if_possible(context) {
|
||||
StyleWasShared(index, styles) => {
|
||||
Some(styles) => {
|
||||
context.thread_local.statistics.styles_shared += 1;
|
||||
context.thread_local.sharing_cache.touch(index);
|
||||
styles
|
||||
}
|
||||
CannotShare => {
|
||||
None => {
|
||||
context.thread_local.statistics.elements_matched += 1;
|
||||
// Perform the matching and cascading.
|
||||
let new_styles = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue