Bug 1427089 - Wait for a previous empty transaction to complete before doing another empty transaction. r=dvander, a=gchang
authorRyan Hunt <rhunt@eqrion.net>
Wed, 03 Jan 2018 16:56:25 -0600
changeset 445623 ed60f2c05c4ae44d1385176764dafe9b9c0321fa
parent 445622 aaea46054159fabc3b045ed11e6efb6e808c4031
child 445624 b5147bc4e38410b1c5b66368f9e0d67f02e98738
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, gchang
bugs1427089
milestone58.0
Bug 1427089 - Wait for a previous empty transaction to complete before doing another empty transaction. r=dvander, a=gchang
gfx/layers/client/ClientLayerManager.cpp
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -467,16 +467,22 @@ bool
 ClientLayerManager::EndEmptyTransaction(EndTransactionFlags aFlags)
 {
   mInTransaction = false;
 
   if (!mRoot || !mForwarder->IPCOpen()) {
     return false;
   }
 
+  if (mTransactionIncomplete) {
+    // If the previous transaction was incomplete then we may have buffer operations
+    // running on the paint thread that haven't finished yet
+    GetCompositorBridgeChild()->FlushAsyncPaints();
+  }
+
   if (!EndTransactionInternal(nullptr, nullptr, aFlags)) {
     // Return without calling ForwardTransaction. This leaves the
     // ShadowLayerForwarder transaction open; the following
     // EndTransaction will complete it.
     if (PaintThread::Get() && mQueuedAsyncPaints) {
       PaintThread::Get()->EndLayerTransaction(nullptr);
     }
     return false;