Bug 996796 patch 2 - Change the public API to updating main-thread-suppressed animation styles (miniflush) in preparation for refactoring how it works. r=birtles

Later patches will combine the coalescing of restyling between the
miniflush performed for animations and for transitions into a single
RestyleTracker, which will coalesce the work better.  This patch changes
the API exposed for doing that so that the coalescing patch will contain
only the internals.
This commit is contained in:
L. David Baron 2014-07-24 21:35:34 -07:00
parent 50a5e634d3
commit ff6cc13ca8
3 changed files with 15 additions and 4 deletions

View File

@ -1468,8 +1468,7 @@ RestyleManager::ProcessPendingRestyles()
if (nsLayoutUtils::AreAsyncAnimationsEnabled() &&
mPendingRestyles.Count() > 0) {
++mAnimationGeneration;
mPresContext->TransitionManager()->UpdateAllThrottledStyles();
mPresContext->AnimationManager()->UpdateAllThrottledStyles();
UpdateOnlyAnimationStyles();
}
mPendingRestyles.ProcessRestyles();
@ -1529,6 +1528,13 @@ RestyleManager::EndProcessingRestyles()
#endif
}
void
RestyleManager::UpdateOnlyAnimationStyles()
{
mPresContext->TransitionManager()->UpdateAllThrottledStyles();
mPresContext->AnimationManager()->UpdateAllThrottledStyles();
}
void
RestyleManager::PostRestyleEventCommon(Element* aElement,
nsRestyleHint aRestyleHint,

View File

@ -160,6 +160,12 @@ public:
void BeginProcessingRestyles();
void EndProcessingRestyles();
// Update styles for animations that are running on the compositor and
// whose updating is suppressed on the main thread (to save
// unnecessary work), while leaving all other aspects of style
// out-of-date.
void UpdateOnlyAnimationStyles();
// Rebuilds all style data by throwing out the old rule tree and
// building a new one, and additionally applying aExtraHint (which
// must not contain nsChangeHint_ReconstructFrame) to the root frame.

View File

@ -6689,8 +6689,7 @@ FlushThrottledStyles(nsIDocument *aDocument, void *aData)
if (shell && shell->IsVisible()) {
nsPresContext* presContext = shell->GetPresContext();
if (presContext) {
presContext->TransitionManager()->UpdateAllThrottledStyles();
presContext->AnimationManager()->UpdateAllThrottledStyles();
presContext->RestyleManager()->UpdateOnlyAnimationStyles();
}
}