From e8b225b85f81c236308e6eb182c3003718a93f7c Mon Sep 17 00:00:00 2001 From: sotaro Date: Thu, 10 Oct 2019 23:17:01 +0000 Subject: [PATCH] Bug 1586555 - Disable double buffering with D3D compositor when Glass is used r=bas Differential Revision: https://phabricator.services.mozilla.com/D48469 --HG-- extra : moz-landing-system : lando --- widget/windows/nsWindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index d09740ee3b38..b70f57a59467 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -132,6 +132,7 @@ #include "mozilla/dom/MouseEventBinding.h" #include "mozilla/dom/Touch.h" #include "mozilla/gfx/2D.h" +#include "mozilla/gfx/GPUProcessManager.h" #include "nsIAppStartup.h" #include "mozilla/WindowsVersion.h" #include "mozilla/TextEvents.h" // For WidgetKeyboardEvent @@ -7470,6 +7471,14 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode) { reinterpret_cast(GetStockObject(BLACK_BRUSH))); ReleaseDC(mWnd, hdc); } + + // Disable double buffering with D3D compositor for disabling compositor + // window usage. + if (HasGlass() && !gfxVars::UseWebRender() && + gfxVars::UseDoubleBufferingWithCompositor()) { + gfxVars::SetUseDoubleBufferingWithCompositor(false); + GPUProcessManager::Get()->ResetCompositors(); + } } #endif // MOZ_XUL