Bug 1848357 - Remove PaintWhileInterruptingJSNoOp(). r=mconley

This should not be needed anymore. We no longer need to "ack" an epoch,
since there's no epoch.

Make the logic to trigger a paint and request composite a bit more
generic. That doesn't change behavior right now, because our visibility
state is tied to mRenderLayers, but without this change setting
renderLayers = true on a display: none iframe will trigger a useless
paint after bug 1847584.

Differential Revision: https://phabricator.services.mozilla.com/D187293
This commit is contained in:
Emilio Cobos Álvarez 2023-09-02 07:09:01 +00:00
parent 8b9b0a9477
commit 1a7924d367
4 changed files with 4 additions and 30 deletions

View File

@ -2485,24 +2485,13 @@ mozilla::ipc::IPCResult BrowserChild::RecvRenderLayers(const bool& aEnabled) {
}
mRenderLayers = aEnabled;
const bool wasVisible = IsVisible();
if (aEnabled && IsVisible()) {
// This request is a no-op.
// In this case, we still want a MozLayerTreeReady notification to fire
// in the parent, PaintWhileInterruptingJSNoOp does that.
// TODO(emilio): Is this still needed? Seems like the front-end should know
// already that we have layers.
if (IPCOpen()) {
Unused << SendPaintWhileInterruptingJSNoOp();
}
return IPC_OK();
}
// FIXME(emilio): Probably / maybe this shouldn't be needed? See the comment
// in MakeVisible(), having the two separate states is not great.
UpdateVisibility();
if (!aEnabled) {
// If we just became visible, try to trigger a paint as soon as possible.
const bool becameVisible = !wasVisible && IsVisible();
if (!becameVisible) {
return IPC_OK();
}

View File

@ -3750,14 +3750,6 @@ void BrowserParent::LayerTreeUpdate(bool aActive) {
frameElement->DispatchEvent(*event);
}
mozilla::ipc::IPCResult BrowserParent::RecvPaintWhileInterruptingJSNoOp() {
// We sent a PaintWhileInterruptingJS message when layers were already
// visible. In this case, we should act as if an update occurred even though
// we already have the layers.
LayerTreeUpdate(true);
return IPC_OK();
}
mozilla::ipc::IPCResult BrowserParent::RecvRemoteIsReadyToHandleInputEvents() {
// When enabling input event prioritization, input events may preempt other
// normal priority IPC messages. To prevent the input events preempt

View File

@ -723,8 +723,6 @@ class BrowserParent final : public PBrowserParent,
mozilla::ipc::IPCResult RecvRemoteIsReadyToHandleInputEvents();
mozilla::ipc::IPCResult RecvPaintWhileInterruptingJSNoOp();
mozilla::ipc::IPCResult RecvSetDimensions(mozilla::DimensionRequest aRequest,
const double& aScale);

View File

@ -594,11 +594,6 @@ parent:
*/
async RemoteIsReadyToHandleInputEvents();
/**
* Child informs the parent that the layer tree is already available.
*/
async PaintWhileInterruptingJSNoOp();
child:
/**
* Parent informs the child of graphical effects that are being applied