mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 10:27:03 +00:00
Backed out changeset 123998cc3f92 (bug 854421)
This commit is contained in:
parent
ca0e6070b9
commit
ced23842df
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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<nsIPresShell> 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)
|
||||
{
|
||||
|
@ -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<nsARefreshObserver*> ObserverArray;
|
||||
typedef nsTHashtable<nsISupportsHashKey> RequestTable;
|
||||
@ -335,8 +328,6 @@ private:
|
||||
nsPresContext *mPresContext; // weak; pres context passed in constructor
|
||||
// and unset in Disconnect
|
||||
|
||||
nsRefPtr<nsRefreshDriver> mRootRefresh;
|
||||
|
||||
// The most recently allocated transaction id.
|
||||
uint64_t mPendingTransaction;
|
||||
// The most recently completed transaction id.
|
||||
|
Loading…
x
Reference in New Issue
Block a user