Bug 1540908. If the layer manager revokes a transaction id then revert the last stored transaction id too. r=mattwoodrow
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 02 Apr 2019 12:08:21 +0000
changeset 526465 10a446ed2a38d6af1eaa8b6d51ad9f1333b247d8
parent 526464 1e35279977a4b2638e9c2c5f080e99f3afaf3aac
child 526466 cc2ac1b5534f166fbc0f225c5d66946fd8f410af
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1540908
milestone68.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 1540908. If the layer manager revokes a transaction id then revert the last stored transaction id too. r=mattwoodrow This prevents calls to nsPresContext::NotifyInvalidation from using a transaction id that has already been revoked. Android does "repeat" transactions, where one EndTransaction call results in two transactions. The first updates the "critical" area of painted content (immediately visible). The second updates the rest of the display port. What happens in the specific failing test that triggered this is the first transaction results in invalidations from layer tree invalidation. The second transaction nothing has changed, so it gets revoked. When EndTransaction returns to the nsDisplayList code and calls nsPresContext::NotifyInvalidation it uses the last transaction id stored on the layer manager. But this has already been revoked. Differential Revision: https://phabricator.services.mozilla.com/D25702
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/wr/WebRenderLayerManager.cpp
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -711,16 +711,17 @@ void ClientLayerManager::ForwardTransact
     NS_WARNING("failed to forward Layers transaction");
   }
 
   if (!sent) {
     // Clear the transaction id so that it doesn't get returned
     // unless we forwarded to somewhere that doesn't actually
     // have a compositor.
     mTransactionIdAllocator->RevokeTransactionId(mLatestTransactionId);
+    mLatestTransactionId = mLatestTransactionId.Prev();
   }
 
   mPhase = PHASE_NONE;
 
   // this may result in Layers being deleted, which results in
   // PLayer::Send__delete__() and DeallocShmem()
   mKeepAlive.Clear();
 
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -203,16 +203,17 @@ bool WebRenderLayerManager::EndEmptyTran
         break;
       }
     }
     if (!haveScrollUpdates) {
       MOZ_ASSERT(!mTarget);
       WrBridge()->SendSetFocusTarget(mFocusTarget);
       // Revoke TransactionId to trigger next paint.
       mTransactionIdAllocator->RevokeTransactionId(mLatestTransactionId);
+      mLatestTransactionId = mLatestTransactionId.Prev();
       return true;
     }
   }
 
   LayoutDeviceIntSize size = mWidget->GetClientSize();
   WrBridge()->BeginTransaction();
 
   mWebRenderCommandBuilder.EmptyTransaction();