From 35886dcefdfcffe70ef98389e384df1ea507b52c Mon Sep 17 00:00:00 2001 From: Jamie Nicol Date: Tue, 17 Sep 2019 14:57:59 +0000 Subject: [PATCH] Bug 1580153 - Call NotifyFirstPaint on next composite after RecvResumeAndResize. r=jrmuizel Previously after RecvResumeAndResize() we would set a flag on the root WebRenderBridgeParent, which in turn sets a flag on the next display list it receives that it should be treated as a first paint. Then when that display list is finally composited, we call UiCompositorControllerParent::NotifyFirstPaint(), which in turn tells GeckoView to uncover the widget. After switching tabs in GeckoView browsers, however, the root WebRenderBridgeParent does not always receive a new display list, so the widget would not be uncovered. Instead of waiting for the next received display list to be composited, we simply want to uncover the widget on the next composite. To achieve this we instead set the forced-first-paint flag on the root CompositorBridgeParent then we call NotifyFirstPaint() during CompositorBridgeParent::NotifyPipelineRendered(). Differential Revision: https://phabricator.services.mozilla.com/D46157 --HG-- extra : moz-landing-system : lando --- gfx/layers/ipc/CompositorBridgeParent.cpp | 8 +++++++- gfx/layers/ipc/CompositorBridgeParent.h | 1 + gfx/layers/wr/WebRenderBridgeParent.h | 10 ---------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index 1627033e5d83..3278d302a5f7 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -322,6 +322,7 @@ CompositorBridgeParent::CompositorBridgeParent( mPendingTransaction{0}, mPaused(false), mHaveCompositionRecorder(false), + mIsForcedFirstPaint(false), mUseExternalSurfaceSize(aUseExternalSurfaceSize), mEGLSurfaceSize(aSurfaceSize), mOptions(aOptions), @@ -418,7 +419,7 @@ CompositorBridgeParent::~CompositorBridgeParent() { void CompositorBridgeParent::ForceIsFirstPaint() { if (mWrBridge) { - mWrBridge->ForceIsFirstPaint(); + mIsForcedFirstPaint = true; } else { mCompositionManager->ForceIsFirstPaint(); } @@ -2138,6 +2139,11 @@ void CompositorBridgeParent::NotifyPipelineRendered( mWrBridge->RemoveEpochDataPriorTo(aEpoch); if (!mPaused) { + if (mIsForcedFirstPaint) { + uiController->NotifyFirstPaint(); + mIsForcedFirstPaint = false; + } + TransactionId transactionId = mWrBridge->FlushTransactionIdsForEpoch( aEpoch, aCompositeStartId, aCompositeStart, aRenderStart, aCompositeEnd, uiController); diff --git a/gfx/layers/ipc/CompositorBridgeParent.h b/gfx/layers/ipc/CompositorBridgeParent.h index 903a904ff06b..448dbb99286f 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.h +++ b/gfx/layers/ipc/CompositorBridgeParent.h @@ -760,6 +760,7 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase, bool mPaused; bool mHaveCompositionRecorder; + bool mIsForcedFirstPaint; bool mUseExternalSurfaceSize; gfx::IntSize mEGLSurfaceSize; diff --git a/gfx/layers/wr/WebRenderBridgeParent.h b/gfx/layers/wr/WebRenderBridgeParent.h index 1af357ab18db..558e509b98f7 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.h +++ b/gfx/layers/wr/WebRenderBridgeParent.h @@ -260,16 +260,6 @@ class WebRenderBridgeParent final void RemoveEpochDataPriorTo(const wr::Epoch& aRenderedEpoch); - /** - * This sets the is-first-paint flag to true for the next received - * display list. This is intended to be called by the widget code when it - * loses its viewport information (or for whatever reason wants to refresh - * the viewport information). The message will sent back to the widget code - * via UiCompositorControllerParent::NotifyFirstPaint() when the corresponding - * transaction is flushed. - */ - void ForceIsFirstPaint() { mIsFirstPaint = true; } - void PushDeferredPipelineData(RenderRootDeferredData&& aDeferredData); /**