Bug 1482032 part 1 - A bit clean up of FlushTransactionIdsForEpoch() r=mattwoodrow
authorsotaro <sotaro.ikeda.g@gmail.com>
Wed, 15 Aug 2018 14:13:24 +0900
changeset 431585 c1f4543fd3fbae487bcfbb5f3bdc5b4fd7911124
parent 431584 a699096ae193a22952e1dc33950047c8aad7dc42
child 431586 bc38e7f7ca73a73ed745426100e57f7c3df43fe5
push id106491
push usersikeda@mozilla.com
push dateWed, 15 Aug 2018 05:14:01 +0000
treeherdermozilla-inbound@bc38e7f7ca73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1482032
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1482032 part 1 - A bit clean up of FlushTransactionIdsForEpoch() r=mattwoodrow
gfx/layers/wr/WebRenderBridgeParent.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -1591,38 +1591,40 @@ WebRenderBridgeParent::LastPendingTransa
   return id;
 }
 
 TransactionId
 WebRenderBridgeParent::FlushTransactionIdsForEpoch(const wr::Epoch& aEpoch, const TimeStamp& aEndTime)
 {
   TransactionId id{0};
   while (!mPendingTransactionIds.empty()) {
-    if (aEpoch.mHandle < mPendingTransactionIds.front().mEpoch.mHandle) {
+    const auto& transactionId = mPendingTransactionIds.front();
+
+    if (aEpoch.mHandle < transactionId.mEpoch.mHandle) {
       break;
     }
 
     if (!IsRootWebRenderBridgeParent() && !mVsyncRate.IsZero()) {
-      double latencyMs = (aEndTime - mPendingTransactionIds.front().mTxnStartTime).ToMilliseconds();
+      double latencyMs = (aEndTime - transactionId.mTxnStartTime).ToMilliseconds();
       double latencyNorm = latencyMs / mVsyncRate.ToMilliseconds();
       int32_t fracLatencyNorm = lround(latencyNorm * 100.0);
       Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME, fracLatencyNorm);
     }
 
 #if defined(ENABLE_FRAME_LATENCY_LOG)
-    if (mPendingTransactionIds.front().mRefreshStartTime) {
-      int32_t latencyMs = lround((aEndTime - mPendingTransactionIds.front().mRefreshStartTime).ToMilliseconds());
+    if (transactionId.mRefreshStartTime) {
+      int32_t latencyMs = lround((aEndTime - transactionId.mRefreshStartTime).ToMilliseconds());
       printf_stderr("From transaction start to end of generate frame latencyMs %d this %p\n", latencyMs, this);
     }
-    if (mPendingTransactionIds.front().mFwdTime) {
-      int32_t latencyMs = lround((aEndTime - mPendingTransactionIds.front().mFwdTime).ToMilliseconds());
+    if (transactionId.mFwdTime) {
+      int32_t latencyMs = lround((aEndTime - transactionId.mFwdTime).ToMilliseconds());
       printf_stderr("From forwarding transaction to end of generate frame latencyMs %d this %p\n", latencyMs, this);
     }
 #endif
-    id = mPendingTransactionIds.front().mId;
+    id = transactionId.mId;
     mPendingTransactionIds.pop();
   }
   return id;
 }
 
 LayersId
 WebRenderBridgeParent::GetLayersId() const
 {