From 4f3833aa2f7c3abb64f590044ee258a9aee5e004 Mon Sep 17 00:00:00 2001 From: sotaro Date: Wed, 17 Nov 2021 22:05:47 +0000 Subject: [PATCH] Bug 1741111 - Remove LayersBackend::LAYERS_BASIC r=gfx-reviewers,bradwerth LayersBackend::LAYERS_BASIC is not used any more. Differential Revision: https://phabricator.services.mozilla.com/D131104 --- dom/canvas/ClientWebGLContext.cpp | 1 - dom/ipc/BrowserChild.cpp | 2 +- dom/media/platforms/wmf/WMFDecoderModule.cpp | 3 +-- gfx/layers/BufferTexture.cpp | 3 +-- gfx/layers/CanvasRenderer.cpp | 1 - gfx/layers/LayersTypes.cpp | 2 -- gfx/layers/LayersTypes.h | 1 - layout/painting/WindowRenderer.cpp | 2 +- widget/cocoa/nsChildView.mm | 6 ++---- widget/gtk/nsWindow.cpp | 3 +-- widget/uikit/nsWindow.mm | 6 ------ widget/windows/CompositorWidgetParent.cpp | 3 --- widget/windows/InProcessWinCompositorWidget.cpp | 3 --- widget/windows/nsWindowGfx.cpp | 7 ++----- 14 files changed, 9 insertions(+), 34 deletions(-) diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp index 744a045adde3..4b5e0287ee9e 100644 --- a/dom/canvas/ClientWebGLContext.cpp +++ b/dom/canvas/ClientWebGLContext.cpp @@ -575,7 +575,6 @@ bool ClientWebGLContext::CreateHostContext(const uvec2& requestedSize) { if (options.failIfMajorPerformanceCaveat) { const auto backend = GetCompositorBackendType(); bool isCompositorSlow = false; - isCompositorSlow |= (backend == layers::LayersBackend::LAYERS_BASIC); isCompositorSlow |= (backend == layers::LayersBackend::LAYERS_WR && gfx::gfxVars::UseSoftwareWebRender()); diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp index 74fb293b0d7a..235b2e6ba1a7 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp @@ -2844,7 +2844,7 @@ void BrowserChild::InitRenderingState( // remote layer manager though, so that's fine. MOZ_ASSERT(!mPuppetWidget->HasLayerManager() || mPuppetWidget->GetWindowRenderer()->GetBackendType() == - layers::LayersBackend::LAYERS_BASIC); + layers::LayersBackend::LAYERS_NONE); bool success = false; if (mLayersConnected == Some(true)) { success = CreateRemoteLayerManager(compositorChild); diff --git a/dom/media/platforms/wmf/WMFDecoderModule.cpp b/dom/media/platforms/wmf/WMFDecoderModule.cpp index fdfe055856a1..d67694522e36 100644 --- a/dom/media/platforms/wmf/WMFDecoderModule.cpp +++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp @@ -81,8 +81,7 @@ static bool IsRemoteAcceleratedCompositor( TextureFactoryIdentifier ident = aKnowsCompositor->GetTextureFactoryIdentifier(); - return ident.mParentBackend != LayersBackend::LAYERS_BASIC && - !aKnowsCompositor->UsingSoftwareWebRender() && + return !aKnowsCompositor->UsingSoftwareWebRender() && ident.mParentProcessType == GeckoProcessType_GPU; } diff --git a/gfx/layers/BufferTexture.cpp b/gfx/layers/BufferTexture.cpp index e8c32cebf188..231a6450293b 100644 --- a/gfx/layers/BufferTexture.cpp +++ b/gfx/layers/BufferTexture.cpp @@ -106,8 +106,7 @@ bool ComputeHasIntermediateBuffer(gfx::SurfaceFormat aFormat, return false; } - return aLayersBackend != LayersBackend::LAYERS_BASIC || - aFormat == gfx::SurfaceFormat::UNKNOWN; + return aFormat == gfx::SurfaceFormat::UNKNOWN; } BufferTextureData* BufferTextureData::Create( diff --git a/gfx/layers/CanvasRenderer.cpp b/gfx/layers/CanvasRenderer.cpp index 6b7ea323e2da..03daded6461d 100644 --- a/gfx/layers/CanvasRenderer.cpp +++ b/gfx/layers/CanvasRenderer.cpp @@ -91,7 +91,6 @@ TextureType TexTypeForWebgl(KnowsCompositor* const knowsCompositor) { MOZ_CRASH("Unexpected LayersBackend::LAYERS_LAST"); case LayersBackend::LAYERS_NONE: - case LayersBackend::LAYERS_BASIC: return TextureType::Unknown; case LayersBackend::LAYERS_D3D11: diff --git a/gfx/layers/LayersTypes.cpp b/gfx/layers/LayersTypes.cpp index 2a3406064c75..194537e06599 100644 --- a/gfx/layers/LayersTypes.cpp +++ b/gfx/layers/LayersTypes.cpp @@ -46,8 +46,6 @@ const char* GetLayersBackendName(LayersBackend aBackend) { return "webrender_software"; } return "webrender"; - case LayersBackend::LAYERS_BASIC: - return "basic"; default: MOZ_ASSERT_UNREACHABLE("unknown layers backend"); return "unknown"; diff --git a/gfx/layers/LayersTypes.h b/gfx/layers/LayersTypes.h index 92fc97d6fa27..c9a52b666944 100644 --- a/gfx/layers/LayersTypes.h +++ b/gfx/layers/LayersTypes.h @@ -167,7 +167,6 @@ enum class WindowKind : int8_t { MAIN = 0, SECONDARY, LAST }; enum class LayersBackend : int8_t { LAYERS_NONE = 0, - LAYERS_BASIC, LAYERS_OPENGL, LAYERS_D3D11, LAYERS_WR, diff --git a/layout/painting/WindowRenderer.cpp b/layout/painting/WindowRenderer.cpp index edb5608a5ff9..288908289afd 100644 --- a/layout/painting/WindowRenderer.cpp +++ b/layout/painting/WindowRenderer.cpp @@ -198,7 +198,7 @@ void FallbackRenderer::EndTransactionWithList(nsDisplayListBuilder* aBuilder, DrawTarget* dt = mTarget->GetDrawTarget(); BackendType backend = gfxPlatform::GetPlatform()->GetContentBackendFor( - LayersBackend::LAYERS_BASIC); + LayersBackend::LAYERS_NONE); RefPtr dest = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend( backend, dt->GetSize(), dt->GetFormat()); diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index a397c7bfd264..cfe7521d23e2 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -1358,8 +1358,7 @@ bool nsChildView::PaintWindowInDrawTarget(gfx::DrawTarget* aDT, targetContext->Clip(); nsAutoRetainCocoaObject kungFuDeathGrip(mView); - if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE || - GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_BASIC) { + if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE) { nsBaseWidget::AutoLayerManagerSetup setupLayerManager(this, targetContext, BufferMode::BUFFER_NONE); return PaintWindow(aRegion); @@ -1406,8 +1405,7 @@ void nsChildView::PaintWindowInContentLayer() { void nsChildView::HandleMainThreadCATransaction() { WillPaintWindow(); - if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE || - GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_BASIC) { + if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE) { // We're in BasicLayers mode, i.e. main thread software compositing. // Composite the window into our layer's surface. PaintWindowInContentLayer(); diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 0dde38cd9bad..3acc0eb12b60 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -3646,8 +3646,7 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) { bool painted = false; { - if (renderer->GetBackendType() == LayersBackend::LAYERS_NONE || - renderer->GetBackendType() == LayersBackend::LAYERS_BASIC) { + if (renderer->GetBackendType() == LayersBackend::LAYERS_NONE) { if (GetTransparencyMode() == eTransparencyTransparent && layerBuffering == BufferMode::BUFFER_NONE && mHasAlphaVisual) { // If our draw target is unbuffered and we use an alpha channel, diff --git a/widget/uikit/nsWindow.mm b/widget/uikit/nsWindow.mm index af1afa986ab4..702a8b97ebb1 100644 --- a/widget/uikit/nsWindow.mm +++ b/widget/uikit/nsWindow.mm @@ -347,12 +347,6 @@ class nsAutoRetainUIKitObject { // nsAutoRetainCocoaObject kungFuDeathGrip(self); bool painted = false; - if (mGeckoChild->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_BASIC) { - nsBaseWidget::AutoLayerManagerSetup setupLayerManager(mGeckoChild, targetContext, - BufferMode::BUFFER_NONE); - painted = mGeckoChild->PaintWindow(region); - } - targetContext = nullptr; targetSurface = nullptr; diff --git a/widget/windows/CompositorWidgetParent.cpp b/widget/windows/CompositorWidgetParent.cpp index c114ab7e4600..a79caed3e07c 100644 --- a/widget/windows/CompositorWidgetParent.cpp +++ b/widget/windows/CompositorWidgetParent.cpp @@ -113,9 +113,6 @@ CompositorWidgetParent::EndBackBufferDrawing() { } bool CompositorWidgetParent::InitCompositor(layers::Compositor* aCompositor) { - if (aCompositor->GetBackendType() == layers::LayersBackend::LAYERS_BASIC) { - DeviceManagerDx::Get()->InitializeDirectDraw(); - } return true; } diff --git a/widget/windows/InProcessWinCompositorWidget.cpp b/widget/windows/InProcessWinCompositorWidget.cpp index 27c45e260676..f9a864e48e72 100644 --- a/widget/windows/InProcessWinCompositorWidget.cpp +++ b/widget/windows/InProcessWinCompositorWidget.cpp @@ -228,9 +228,6 @@ InProcessWinCompositorWidget::EndBackBufferDrawing() { bool InProcessWinCompositorWidget::InitCompositor( layers::Compositor* aCompositor) { - if (aCompositor->GetBackendType() == layers::LayersBackend::LAYERS_BASIC) { - DeviceManagerDx::Get()->InitializeDirectDraw(); - } return true; } diff --git a/widget/windows/nsWindowGfx.cpp b/widget/windows/nsWindowGfx.cpp index 61191f1e4008..33f54f97f7c6 100644 --- a/widget/windows/nsWindowGfx.cpp +++ b/widget/windows/nsWindowGfx.cpp @@ -197,9 +197,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) { mLastPaintBounds = mBounds; #ifdef MOZ_XUL - if (!aDC && - (renderer->GetBackendType() == LayersBackend::LAYERS_NONE || - renderer->GetBackendType() == LayersBackend::LAYERS_BASIC) && + if (!aDC && (renderer->GetBackendType() == LayersBackend::LAYERS_NONE) && (eTransparencyTransparent == mTransparencyMode)) { // For layered translucent windows all drawing should go to memory DC and no // WM_PAINT messages are normally generated. To support asynchronous @@ -273,8 +271,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) { #endif // WIDGET_DEBUG_OUTPUT switch (renderer->GetBackendType()) { - case LayersBackend::LAYERS_NONE: - case LayersBackend::LAYERS_BASIC: { + case LayersBackend::LAYERS_NONE: { RefPtr targetSurface; #if defined(MOZ_XUL)