Bug 1740673 - Ensure d3d device re-creation before sessions re-creation in GPUProcessManager::OnInProcessDeviceReset() r=nical,gfx-reviewers

Current code is not explicit about device recreation before session re-creation. It is actually done by nsWindow::OnPaint() before OnInProcessDeviceReset() call. But it is not explicit.

gfxWindowsPlatform::HandleDeviceReset() does d3d device re-creation if it is necessary.

Differential Revision: https://phabricator.services.mozilla.com/D130957
This commit is contained in:
sotaro 2021-11-16 08:25:09 +00:00
parent 6233ec443f
commit dc41fd6a96

View file

@ -57,6 +57,10 @@
# include "mozilla/layers/UiCompositorControllerChild.h" # include "mozilla/layers/UiCompositorControllerChild.h"
#endif // defined(MOZ_WIDGET_ANDROID) #endif // defined(MOZ_WIDGET_ANDROID)
#if defined(XP_WIN)
# include "gfxWindowsPlatform.h"
#endif
namespace mozilla { namespace mozilla {
namespace gfx { namespace gfx {
@ -606,7 +610,11 @@ void GPUProcessManager::OnInProcessDeviceReset(bool aTrackThreshold) {
DisableWebRenderConfig(wr::WebRenderError::EXCESSIVE_RESETS, nsCString()); DisableWebRenderConfig(wr::WebRenderError::EXCESSIVE_RESETS, nsCString());
#endif #endif
} }
#ifdef XP_WIN
// Ensure device reset handling before re-creating in process sessions.
// Normally nsWindow::OnPaint() already handled it.
gfxWindowsPlatform::GetPlatform()->HandleDeviceReset();
#endif
RebuildInProcessSessions(); RebuildInProcessSessions();
NotifyListenersOnCompositeDeviceReset(); NotifyListenersOnCompositeDeviceReset();
} }