Bug 1232577 part 15 - Drop LastStyleUpdateForAllAnimations flag from pres context; r=heycam

nsPresContext contains a mLastStyleUpdateForAllAnimations flag which is simply
used to prevent unnecessarily posting restyles when throttled animations are
already up to date. Since part 13 we now accurately record whether we have
posted a restyle for each throttled animation and only post a restyle if we
have not done so already. As a result, this flag is no longer needed since
calling PostRestyleForThrottledAnimations is effectively a noop when throttled
animations are up-to-date.
This commit is contained in:
Brian Birtles 2016-01-13 07:54:55 +09:00
Родитель b65c8d2610
Коммит 7a8bb45336
5 изменённых файлов: 2 добавлений и 39 удалений

Просмотреть файл

@ -158,7 +158,6 @@ EffectCompositor::RequestRestyle(dom::Element* aElement,
if (aRestyleType == RestyleType::Layer) {
// Prompt layers to re-sync their animations.
mPresContext->ClearLastStyleUpdateForAllAnimations();
mPresContext->RestyleManager()->IncrementAnimationGeneration();
EffectSet* effectSet =
EffectSet::GetEffectSet(aElement, aPseudoType);

Просмотреть файл

@ -1050,9 +1050,6 @@ nsPresContext::Init(nsDeviceContext* aDeviceContext)
}
}
// Initialise refresh tick counters for OMTA
mLastStyleUpdateForAllAnimations = mRefreshDriver->MostRecentRefresh();
// Initialize restyle manager after initializing the refresh driver.
// Since RestyleManager is also the name of a method of nsPresContext,
// it is necessary to prefix the class with the mozilla namespace
@ -1762,24 +1759,6 @@ nsPresContext::Detach()
}
}
bool
nsPresContext::StyleUpdateForAllAnimationsIsUpToDate() const
{
return mLastStyleUpdateForAllAnimations == mRefreshDriver->MostRecentRefresh();
}
void
nsPresContext::TickLastStyleUpdateForAllAnimations()
{
mLastStyleUpdateForAllAnimations = mRefreshDriver->MostRecentRefresh();
}
void
nsPresContext::ClearLastStyleUpdateForAllAnimations()
{
mLastStyleUpdateForAllAnimations = TimeStamp();
}
bool
nsPresContext::BidiEnabledExternal() const
{

Просмотреть файл

@ -707,13 +707,6 @@ public:
mDrawColorBackground = aCanDraw;
}
/**
* Getter and setters for OMTA time counters
*/
bool StyleUpdateForAllAnimationsIsUpToDate() const;
void TickLastStyleUpdateForAllAnimations();
void ClearLastStyleUpdateForAllAnimations();
/**
* Check if bidi enabled (set depending on the presence of RTL
* characters or when default directionality is RTL).

Просмотреть файл

@ -3966,12 +3966,8 @@ PresShell::FlushPendingNotifications(mozilla::ChangesToFlush aFlush)
mDocument->GetAnimationController()->FlushResampleRequests();
}
if (aFlush.mFlushAnimations &&
!mPresContext->StyleUpdateForAllAnimationsIsUpToDate()) {
if (mPresContext->EffectCompositor()) {
mPresContext->EffectCompositor()->PostRestyleForThrottledAnimations();
}
mPresContext->TickLastStyleUpdateForAllAnimations();
if (aFlush.mFlushAnimations && mPresContext->EffectCompositor()) {
mPresContext->EffectCompositor()->PostRestyleForThrottledAnimations();
}
// The FlushResampleRequests() above flushed style changes.

Просмотреть файл

@ -1709,10 +1709,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
if (tracingStyleFlush) {
profiler_tracing("Paint", "Styles", TRACING_INTERVAL_END);
}
if (!nsLayoutUtils::AreAsyncAnimationsEnabled()) {
mPresContext->TickLastStyleUpdateForAllAnimations();
}
}
} else if (i == 1) {
// This is the Flush_Layout case.