Commit bd57436c authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Reduce calls to LoadPendingImages.

There is no need for the extra call after ApplyAnimatedStandardProperties
now that we trigger loading at the end of StyleForElement and
PseudoStyleForElement. Also, we only need to have the extra loading for
MatchedPropertiesCache case if when we actually add the ComputedStyle to
the cache.

Change-Id: I943c24f42f8ec945b901cdbf7572361dc68e280b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216076Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772159}
parent 7a182881
...@@ -1464,9 +1464,6 @@ bool StyleResolver::ApplyAnimatedStandardProperties( ...@@ -1464,9 +1464,6 @@ bool StyleResolver::ApplyAnimatedStandardProperties(
standard_transitions); standard_transitions);
} }
// Start loading resources used by animations.
state.LoadPendingResources();
DCHECK(!state.GetFontBuilder().FontDirty()); DCHECK(!state.GetFontBuilder().FontDirty());
return true; return true;
...@@ -1900,6 +1897,7 @@ void StyleResolver::MaybeAddToMatchedPropertiesCache( ...@@ -1900,6 +1897,7 @@ void StyleResolver::MaybeAddToMatchedPropertiesCache(
MatchedPropertiesCache::IsCacheable(state)) { MatchedPropertiesCache::IsCacheable(state)) {
INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(), INCREMENT_STYLE_STATS_COUNTER(GetDocument().GetStyleEngine(),
matched_property_cache_added, 1); matched_property_cache_added, 1);
state.LoadPendingResources();
matched_properties_cache_.Add(cache_success.key, *state.Style(), matched_properties_cache_.Add(cache_success.key, *state.Style(),
*state.ParentStyle(), state.Dependencies()); *state.ParentStyle(), state.Dependencies());
} }
...@@ -2077,7 +2075,6 @@ void StyleResolver::ApplyMatchedLowPriorityProperties( ...@@ -2077,7 +2075,6 @@ void StyleResolver::ApplyMatchedLowPriorityProperties(
state, match_result, apply_inherited_only, needs_apply_pass); state, match_result, apply_inherited_only, needs_apply_pass);
} }
state.LoadPendingResources();
MaybeAddToMatchedPropertiesCache(state, cache_success, match_result); MaybeAddToMatchedPropertiesCache(state, cache_success, match_result);
DCHECK(!state.GetFontBuilder().FontDirty()); DCHECK(!state.GetFontBuilder().FontDirty());
...@@ -2177,7 +2174,6 @@ void StyleResolver::CascadeAndApplyMatchedProperties(StyleResolverState& state, ...@@ -2177,7 +2174,6 @@ void StyleResolver::CascadeAndApplyMatchedProperties(StyleResolverState& state,
cascade.Apply(); cascade.Apply();
} }
state.LoadPendingResources();
MaybeAddToMatchedPropertiesCache(state, cache_success, result); MaybeAddToMatchedPropertiesCache(state, cache_success, result);
DCHECK(!state.GetFontBuilder().FontDirty()); DCHECK(!state.GetFontBuilder().FontDirty());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment