diff --git a/gfx/layers/ipc/PLayerTransaction.ipdl b/gfx/layers/ipc/PLayerTransaction.ipdl index 8167cbd093a..921c4701d00 100644 --- a/gfx/layers/ipc/PLayerTransaction.ipdl +++ b/gfx/layers/ipc/PLayerTransaction.ipdl @@ -58,7 +58,7 @@ parent: // We don't need to send a sync transaction if // no transaction operate require a swap. - async UpdateNoSwap(Edit[] cset, uint64_t id, TargetConfig targetConfig, bool isFirstPaint, + async UpdateNoSwap(Edit[] cset, uin64_t id, TargetConfig targetConfig, bool isFirstPaint, bool scheduleComposite, uint32_t paintSequenceNumber); // Testing APIs diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 65b9a615559..efcd2a4883c 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4039,14 +4039,10 @@ PresShell::FlushPendingNotifications(mozilla::ChangesToFlush aFlush) if (aFlush.mFlushAnimations && !mPresContext->StyleUpdateForAllAnimationsIsUpToDate()) { - if (mPresContext->AnimationManager()) { - mPresContext->AnimationManager()-> - FlushAnimations(CommonAnimationManager::Cannot_Throttle); - } - if (mPresContext->TransitionManager()) { - mPresContext->TransitionManager()-> - FlushTransitions(CommonAnimationManager::Cannot_Throttle); - } + mPresContext->AnimationManager()-> + FlushAnimations(CommonAnimationManager::Cannot_Throttle); + mPresContext->TransitionManager()-> + FlushTransitions(CommonAnimationManager::Cannot_Throttle); mPresContext->TickLastStyleUpdateForAllAnimations(); } diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index ce9ca57384a..cabf8c39bb1 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -686,7 +686,6 @@ nsRefreshDriver::nsRefreshDriver(nsPresContext* aPresContext) mReflowCause(nullptr), mStyleCause(nullptr), mPresContext(aPresContext), - mRootRefresh(nullptr), mPendingTransaction(0), mCompletedTransaction(0), mFreezeCount(0), @@ -708,10 +707,6 @@ nsRefreshDriver::~nsRefreshDriver() "observers should have unregistered"); NS_ABORT_IF_FALSE(!mActiveTimer, "timer should be gone"); - if (mRootRefresh) { - mRootRefresh->RemoveRefreshObserver(this, Flush_Style); - mRootRefresh = nullptr; - } for (uint32_t i = 0; i < mPresShellsToInvalidateIfHidden.Length(); i++) { mPresShellsToInvalidateIfHidden[i]->InvalidatePresShellIfHidden(); } @@ -1070,17 +1065,13 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) mMostRecentRefresh = aNowTime; mMostRecentRefreshEpochTime = aNowEpoch; - if (IsWaitingForPaint()) { + if (mWaitingForTransaction) { // We're currently suspended waiting for earlier Tick's to // be completed (on the Compositor). Mark that we missed the paint // and keep waiting. + mSkippedPaint = true; return; } - if (mRootRefresh) { - mRootRefresh->RemoveRefreshObserver(this, Flush_Style); - mRootRefresh = nullptr; - } - mSkippedPaint = false; nsCOMPtr presShell = mPresContext->GetPresShell(); if (!presShell || (ObserverCount() == 0 && ImageRequestCount() == 0)) { @@ -1433,49 +1424,6 @@ nsRefreshDriver::NotifyTransactionCompleted(uint64_t aTransactionId) } } -void -nsRefreshDriver::WillRefresh(mozilla::TimeStamp aTime) -{ - mRootRefresh->RemoveRefreshObserver(this, Flush_Style); - mRootRefresh = nullptr; - if (mSkippedPaint) { - DoRefresh(); - } -} - -bool -nsRefreshDriver::IsWaitingForPaint() -{ - if (mTestControllingRefreshes) { - return false; - } - if (mWaitingForTransaction) { - mSkippedPaint = true; - return true; - } - - // Try find the 'root' refresh driver for the current window and check - // if that is waiting for a paint. - nsPresContext *displayRoot = PresContext()->GetDisplayRootPresContext(); - if (displayRoot) { - nsRefreshDriver *rootRefresh = displayRoot->GetRootPresContext()->RefreshDriver(); - if (rootRefresh && rootRefresh != this) { - if (rootRefresh->IsWaitingForPaint()) { - if (mRootRefresh != rootRefresh) { - if (mRootRefresh) { - mRootRefresh->RemoveRefreshObserver(this, Flush_Style); - } - rootRefresh->AddRefreshObserver(this, Flush_Style); - mRootRefresh = rootRefresh; - } - mSkippedPaint = true; - return true; - } - } - } - return false; -} - void nsRefreshDriver::SetThrottled(bool aThrottled) { diff --git a/layout/base/nsRefreshDriver.h b/layout/base/nsRefreshDriver.h index 9a803f5acc9..4cbc097c055 100644 --- a/layout/base/nsRefreshDriver.h +++ b/layout/base/nsRefreshDriver.h @@ -63,8 +63,7 @@ public: virtual void DidRefresh() = 0; }; -class nsRefreshDriver MOZ_FINAL : public mozilla::layers::TransactionIdAllocator, - public nsARefreshObserver { +class nsRefreshDriver MOZ_FINAL : public mozilla::layers::TransactionIdAllocator { public: nsRefreshDriver(nsPresContext *aPresContext); ~nsRefreshDriver(); @@ -276,12 +275,6 @@ public: void NotifyTransactionCompleted(uint64_t aTransactionId) MOZ_OVERRIDE; void RevokeTransactionId(uint64_t aTransactionId) MOZ_OVERRIDE; - bool IsWaitingForPaint(); - - // nsARefreshObserver - NS_IMETHOD_(MozExternalRefCountType) AddRef(void) { return TransactionIdAllocator::AddRef(); } - NS_IMETHOD_(MozExternalRefCountType) Release(void) { return TransactionIdAllocator::Release(); } - virtual void WillRefresh(mozilla::TimeStamp aTime); private: typedef nsTObserverArray ObserverArray; typedef nsTHashtable RequestTable; @@ -335,8 +328,6 @@ private: nsPresContext *mPresContext; // weak; pres context passed in constructor // and unset in Disconnect - nsRefPtr mRootRefresh; - // The most recently allocated transaction id. uint64_t mPendingTransaction; // The most recently completed transaction id.