Bug 1596791: Invalidate the rendered frame when processing OpUpdatedAsyncImagePipeline commands. r=nical
authorBob Owen <bobowencode@gmail.com>
Mon, 18 Nov 2019 10:59:40 +0000
changeset 502399 68c4c2622a23a76ad4ee3fe130b82c0d9d39ab19
parent 502398 a67caf145931c59a6471afd2dc0f7bb68f2fe6f4
child 502400 ff1c407a4421c71c1c60b2456d323dbd59747e67
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1596791
milestone72.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 1596791: Invalidate the rendered frame when processing OpUpdatedAsyncImagePipeline commands. r=nical This stops the potential build up of held textures during a series of empty webrender transactions, because of a render not happening. The patch also only sends the OpUpdatedAsyncImagePipeline command when a new texture has been forwarded for the canvas, to prevent unnecessary invalidation. Differential Revision: https://phabricator.services.mozilla.com/D53223
gfx/layers/wr/WebRenderBridgeParent.cpp
gfx/layers/wr/WebRenderCanvasRenderer.cpp
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -1628,16 +1628,17 @@ bool WebRenderBridgeParent::ProcessWebRe
         mAsyncImageManager->ApplyAsyncImageForPipeline(
             op.pipelineId(), aTxn, txnForImageBridge,
             RenderRootForExternal(aRenderRoot));
         break;
       }
       case WebRenderParentCommand::TOpUpdatedAsyncImagePipeline: {
         const OpUpdatedAsyncImagePipeline& op =
             cmd.get_OpUpdatedAsyncImagePipeline();
+        aTxn.InvalidateRenderedFrame();
         mAsyncImageManager->ApplyAsyncImageForPipeline(
             op.pipelineId(), aTxn, txnForImageBridge,
             RenderRootForExternal(aRenderRoot));
         break;
       }
       case WebRenderParentCommand::TCompositableOperation: {
         if (!ReceiveCompositableUpdate(cmd.get_CompositableOperation())) {
           NS_ERROR("ReceiveCompositableUpdate failed");
--- a/gfx/layers/wr/WebRenderCanvasRenderer.cpp
+++ b/gfx/layers/wr/WebRenderCanvasRenderer.cpp
@@ -78,18 +78,19 @@ void WebRenderCanvasRendererAsync::Destr
   if (mPipelineId.isSome()) {
     mManager->RemovePipelineIdForCompositable(mPipelineId.ref());
     mPipelineId.reset();
   }
 }
 
 void WebRenderCanvasRendererAsync::
     UpdateCompositableClientForEmptyTransaction() {
+  bool wasDirty = IsDirty();
   UpdateCompositableClient(mManager->GetRenderRoot());
-  if (mPipelineId.isSome()) {
+  if (wasDirty && mPipelineId.isSome()) {
     // Notify an update of async image pipeline during empty transaction.
     // During non empty transaction, WebRenderBridgeParent receives
     // OpUpdateAsyncImagePipeline message, but during empty transaction, the
     // message is not sent to WebRenderBridgeParent. Then
     // OpUpdatedAsyncImagePipeline is used to notify the update.
     mManager->AddWebRenderParentCommand(
         OpUpdatedAsyncImagePipeline(mPipelineId.ref()));
   }