From 01cd151a04cbe57c77543e3e365e46b9a71463bc Mon Sep 17 00:00:00 2001 From: sotaro Date: Sat, 20 Nov 2021 22:52:14 +0000 Subject: [PATCH] Bug 1741775 - Remove LayersBackend::LAYERS_OPENGL r=gfx-reviewers,nical LayersBackend::LAYERS_OPENGL is not used any more. Code under widget/uikit is dead code. Differential Revision: https://phabricator.services.mozilla.com/D131461 --- gfx/layers/CanvasRenderer.cpp | 1 - gfx/layers/LayersTypes.cpp | 2 -- gfx/layers/LayersTypes.h | 7 +------ gfx/layers/client/TextureClient.cpp | 5 ++--- widget/uikit/nsWindow.mm | 3 +-- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/gfx/layers/CanvasRenderer.cpp b/gfx/layers/CanvasRenderer.cpp index e7a7a130eb8c..6aad84bd57c2 100644 --- a/gfx/layers/CanvasRenderer.cpp +++ b/gfx/layers/CanvasRenderer.cpp @@ -93,7 +93,6 @@ TextureType TexTypeForWebgl(KnowsCompositor* const knowsCompositor) { case LayersBackend::LAYERS_NONE: return TextureType::Unknown; - case LayersBackend::LAYERS_OPENGL: case LayersBackend::LAYERS_WR: break; } diff --git a/gfx/layers/LayersTypes.cpp b/gfx/layers/LayersTypes.cpp index bb2b67f668bf..b89fad22af23 100644 --- a/gfx/layers/LayersTypes.cpp +++ b/gfx/layers/LayersTypes.cpp @@ -30,8 +30,6 @@ const char* GetLayersBackendName(LayersBackend aBackend) { switch (aBackend) { case LayersBackend::LAYERS_NONE: return "none"; - case LayersBackend::LAYERS_OPENGL: - return "opengl"; case LayersBackend::LAYERS_WR: MOZ_ASSERT(gfx::gfxVars::UseWebRender()); if (gfx::gfxVars::UseSoftwareWebRender()) { diff --git a/gfx/layers/LayersTypes.h b/gfx/layers/LayersTypes.h index 1ab76939c061..11025ab635d3 100644 --- a/gfx/layers/LayersTypes.h +++ b/gfx/layers/LayersTypes.h @@ -165,12 +165,7 @@ typedef BaseTransactionId CompositionOpportunityId; /// content in the window. enum class WindowKind : int8_t { MAIN = 0, SECONDARY, LAST }; -enum class LayersBackend : int8_t { - LAYERS_NONE = 0, - LAYERS_OPENGL, - LAYERS_WR, - LAYERS_LAST -}; +enum class LayersBackend : int8_t { LAYERS_NONE = 0, LAYERS_WR, LAYERS_LAST }; enum class WebRenderBackend : int8_t { HARDWARE = 0, SOFTWARE, LAST }; diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index 230813edb428..73937820fbf4 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -275,9 +275,8 @@ static TextureType GetTextureType(gfx::SurfaceFormat aFormat, #endif #ifdef MOZ_WAYLAND - if ((layersBackend == LayersBackend::LAYERS_OPENGL || - (layersBackend == LayersBackend::LAYERS_WR && - !aKnowsCompositor->UsingSoftwareWebRender())) && + if ((layersBackend == LayersBackend::LAYERS_WR && + !aKnowsCompositor->UsingSoftwareWebRender()) && widget::GetDMABufDevice()->IsDMABufTexturesEnabled() && aFormat != SurfaceFormat::A8) { return TextureType::DMABUF; diff --git a/widget/uikit/nsWindow.mm b/widget/uikit/nsWindow.mm index 702a8b97ebb1..da5cbf3fb48b 100644 --- a/widget/uikit/nsWindow.mm +++ b/widget/uikit/nsWindow.mm @@ -239,8 +239,7 @@ class nsAutoRetainUIKitObject { - (BOOL)isUsingMainThreadOpenGL { if (!mGeckoChild || ![self window]) return NO; - return mGeckoChild->GetLayerManager(nullptr)->GetBackendType() == - mozilla::layers::LayersBackend::LAYERS_OPENGL; + return NO; } - (void)drawUsingOpenGL {