From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- gfx/layers/ipc/CompositorManagerChild.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gfx/layers/ipc/CompositorManagerChild.cpp') diff --git a/gfx/layers/ipc/CompositorManagerChild.cpp b/gfx/layers/ipc/CompositorManagerChild.cpp index 0e553745d3..8d89339373 100644 --- a/gfx/layers/ipc/CompositorManagerChild.cpp +++ b/gfx/layers/ipc/CompositorManagerChild.cpp @@ -10,6 +10,7 @@ #include "mozilla/layers/CompositorBridgeChild.h" #include "mozilla/layers/CompositorManagerParent.h" #include "mozilla/layers/CompositorThread.h" +#include "mozilla/gfx/CanvasShutdownManager.h" #include "mozilla/gfx/gfxVars.h" #include "mozilla/gfx/GPUProcessManager.h" #include "mozilla/dom/ContentChild.h" // for ContentChild @@ -67,7 +68,15 @@ bool CompositorManagerChild::Init(Endpoint&& aEndpoint, sInstance = new CompositorManagerChild(std::move(aEndpoint), aProcessToken, aNamespace); sOtherPid = sInstance->OtherPid(); - return sInstance->CanSend(); + if (!sInstance->CanSend()) { + return false; + } + + // If there are any canvases waiting on the recreation of the GPUProcess or + // CompositorManagerChild, then we need to notify them so that they can + // restore their contexts. + gfx::CanvasShutdownManager::OnCompositorManagerRestored(); + return true; } /* static */ -- cgit v1.2.3