Bug 1452845 - Fix up snapshotting implementation with async-scene-building enabled. r?jrmuizel draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 24 May 2018 16:16:00 -0400
changeset 799500 d127826f1a2c3636afc2788653c48bba0af28f55
parent 799482 f7b2aa63a4230d301b7ee5f659081c37f6e1489d
child 799501 379f2186c633b2ab067d9797275d1ccf93b58560
push id111083
push userkgupta@mozilla.com
push dateThu, 24 May 2018 20:16:39 +0000
reviewersjrmuizel
bugs1452845, 1417784
milestone62.0a1
Bug 1452845 - Fix up snapshotting implementation with async-scene-building enabled. r?jrmuizel This updates the not-really-correct code to flush the WR pipeline before doing a readback. It now uses the flushing functions introduced in bug 1417784 to ensure things are flushed properly. MozReview-Commit-ID: 90BZuLKcjUi
gfx/layers/wr/WebRenderBridgeParent.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -948,26 +948,20 @@ WebRenderBridgeParent::RecvGetSnapshot(P
   // We only support B8G8R8A8 for now.
   MOZ_ASSERT(buffer);
   MOZ_ASSERT(bufferTexture->GetFormat() == SurfaceFormat::B8G8R8A8);
   uint32_t buffer_size = size.width * size.height * 4;
 
   // Assert the stride of the buffer is what webrender expects
   MOZ_ASSERT((uint32_t)(size.width * 4) == stride);
 
-  mForceRendering = true;
-
-  mCompositorScheduler->FlushPendingComposite();
-  if (gfxPrefs::WebRenderAsyncSceneBuild()) {
-    mApi->FlushSceneBuilder();
-  }
+  FlushSceneBuilds();
+  FlushFrameGeneration();
   mApi->Readback(size, buffer, buffer_size);
 
-  mForceRendering = false;
-
   return IPC_OK();
 }
 
 void
 WebRenderBridgeParent::AddPipelineIdForCompositable(const wr::PipelineId& aPipelineId,
                                                     const CompositableHandle& aHandle,
                                                     const bool& aAsync)
 {