Bug 1378966 - Don't cause immediate throttling of the refresh driver on repeat transactions. r=mattwoodrow

MozReview-Commit-ID: 8orAmdpIRTF

--HG--
extra : rebase_source : 2988a9faced2648cd182ebe8adff791634af519f
This commit is contained in:
Kartikaya Gupta 2017-07-12 09:10:25 -04:00
Родитель 2a5888f644
Коммит 6d0c0db395
5 изменённых файлов: 10 добавлений и 7 удалений

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

@ -24,9 +24,11 @@ public:
* only be called while IsInRefresh().
*
* If too many id's are allocated without being returned then
* the refresh driver will suspend until they catch up.
* the refresh driver will suspend until they catch up. This
* "throttling" behaviour can be skipped by passing aThrottle=false.
* Otherwise call sites should generally be passing aThrottle=true.
*/
virtual uint64_t GetTransactionId() = 0;
virtual uint64_t GetTransactionId(bool aThrottle) = 0;
/**
* Return the transaction id that for the last non-revoked transaction.

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

@ -726,7 +726,7 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
mPhase = PHASE_FORWARD;
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId();
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId(!mIsRepeatTransaction);
TimeStamp transactionStart;
if (!mTransactionIdAllocator->GetTransactionStart().IsNull()) {
transactionStart = mTransactionIdAllocator->GetTransactionStart();

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

@ -520,7 +520,7 @@ WebRenderLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback
}
bool sync = mTarget != nullptr;
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId();
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId(/*aThrottle*/ true);
{
AutoProfilerTracing

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

@ -2161,11 +2161,12 @@ nsRefreshDriver::FinishedWaitingForTransaction()
}
uint64_t
nsRefreshDriver::GetTransactionId()
nsRefreshDriver::GetTransactionId(bool aThrottle)
{
++mPendingTransaction;
if (mPendingTransaction >= mCompletedTransaction + 2 &&
if (aThrottle &&
mPendingTransaction >= mCompletedTransaction + 2 &&
!mWaitingForTransaction &&
!mTestControllingRefreshes) {
mWaitingForTransaction = true;

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

@ -317,7 +317,7 @@ public:
static bool GetJankLevels(mozilla::Vector<uint64_t>& aJank);
// mozilla::layers::TransactionIdAllocator
uint64_t GetTransactionId() override;
uint64_t GetTransactionId(bool aThrottle) override;
uint64_t LastTransactionId() const override;
void NotifyTransactionCompleted(uint64_t aTransactionId) override;
void RevokeTransactionId(uint64_t aTransactionId) override;