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
--- 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)
{