Bug 1741123 - Remove LayersBackend::LAYERS_D3D11 r=gfx-reviewers,bradwerth,nical

Remove LayersBackend::LAYERS_D3D11 is not used any more.

Differential Revision: https://phabricator.services.mozilla.com/D131107
This commit is contained in:
sotaro
2021-11-18 21:27:48 +00:00
parent f61ae048f3
commit d0b2d3c8ca
11 changed files with 7 additions and 52 deletions

View File

@@ -93,7 +93,6 @@ TextureType TexTypeForWebgl(KnowsCompositor* const knowsCompositor) {
case LayersBackend::LAYERS_NONE:
return TextureType::Unknown;
case LayersBackend::LAYERS_D3D11:
case LayersBackend::LAYERS_OPENGL:
case LayersBackend::LAYERS_WR:
break;

View File

@@ -299,8 +299,6 @@ class Compositor : public TextureSourceProvider {
virtual const char* Name() const = 0;
#endif // MOZ_DUMP_PAINTING
virtual LayersBackend GetBackendType() const = 0;
virtual CompositorD3D11* AsCompositorD3D11() { return nullptr; }
Compositor* AsCompositor() override { return this; }

View File

@@ -32,8 +32,6 @@ const char* GetLayersBackendName(LayersBackend aBackend) {
return "none";
case LayersBackend::LAYERS_OPENGL:
return "opengl";
case LayersBackend::LAYERS_D3D11:
return "d3d11";
case LayersBackend::LAYERS_WR:
MOZ_ASSERT(gfx::gfxVars::UseWebRender());
if (gfx::gfxVars::UseSoftwareWebRender()) {

View File

@@ -168,7 +168,6 @@ enum class WindowKind : int8_t { MAIN = 0, SECONDARY, LAST };
enum class LayersBackend : int8_t {
LAYERS_NONE = 0,
LAYERS_OPENGL,
LAYERS_D3D11,
LAYERS_WR,
LAYERS_LAST
};

View File

@@ -263,9 +263,8 @@ static TextureType GetTextureType(gfx::SurfaceFormat aFormat,
#ifdef XP_WIN
int32_t maxTextureSize = aKnowsCompositor->GetMaxTextureSize();
if ((layersBackend == LayersBackend::LAYERS_D3D11 ||
(layersBackend == LayersBackend::LAYERS_WR &&
!aKnowsCompositor->UsingSoftwareWebRender())) &&
if ((layersBackend == LayersBackend::LAYERS_WR &&
!aKnowsCompositor->UsingSoftwareWebRender()) &&
(moz2DBackend == gfx::BackendType::DIRECT2D ||
moz2DBackend == gfx::BackendType::DIRECT2D1_1 ||
(!!(aAllocFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT))) &&
@@ -1206,8 +1205,7 @@ already_AddRefed<TextureClient> TextureClient::CreateFromSurface(
int32_t maxTextureSize = aAllocator->GetMaxTextureSize();
if ((layersBackend == LayersBackend::LAYERS_D3D11 ||
layersBackend == LayersBackend::LAYERS_WR) &&
if (layersBackend == LayersBackend::LAYERS_WR &&
(moz2DBackend == gfx::BackendType::DIRECT2D ||
moz2DBackend == gfx::BackendType::DIRECT2D1_1 ||
(!!(aAllocFlags & ALLOC_FOR_OUT_OF_BAND_CONTENT) &&

View File

@@ -96,10 +96,6 @@ class CompositorD3D11 : public Compositor {
const char* Name() const override { return "Direct3D 11"; }
#endif
LayersBackend GetBackendType() const override {
return LayersBackend::LAYERS_D3D11;
}
// For TextureSourceProvider.
ID3D11Device* GetD3D11Device() const override { return mDevice; }

View File

@@ -628,8 +628,6 @@ void ImageBridgeChild::UpdateTextureFactoryIdentifier(
#if defined(XP_WIN)
RefPtr<ID3D11Device> device = gfx::DeviceManagerDx::Get()->GetImageDevice();
needsDrop |= !!mImageDevice && mImageDevice != device &&
GetCompositorBackendType() == LayersBackend::LAYERS_D3D11;
mImageDevice = device;
#endif

View File

@@ -121,12 +121,10 @@ class KnowsCompositor {
bool SupportsD3D11() const {
auto lock = mData.Lock();
return lock.ref().mTextureFactoryIdentifier.mParentBackend ==
layers::LayersBackend::LAYERS_D3D11 ||
(lock.ref().mTextureFactoryIdentifier.mParentBackend ==
layers::LayersBackend::LAYERS_WR &&
(lock.ref().mTextureFactoryIdentifier.mCompositorUseANGLE ||
lock.ref().mTextureFactoryIdentifier.mWebRenderCompositor ==
layers::WebRenderCompositor::D3D11));
layers::LayersBackend::LAYERS_WR &&
(lock.ref().mTextureFactoryIdentifier.mCompositorUseANGLE ||
lock.ref().mTextureFactoryIdentifier.mWebRenderCompositor ==
layers::WebRenderCompositor::D3D11);
}
bool GetCompositorUseANGLE() const {

View File

@@ -186,10 +186,6 @@ class CompositorOGL final : public Compositor {
const char* Name() const override { return "OGL"; }
#endif // MOZ_DUMP_PAINTING
LayersBackend GetBackendType() const override {
return LayersBackend::LAYERS_OPENGL;
}
void Pause() override;
bool Resume() override;

View File

@@ -71,18 +71,6 @@ static already_AddRefed<TextureClient> CreateYCbCrTextureClientWithBackend(
gfx::ColorRange::LIMITED, TextureFlags::DEALLOCATE_CLIENT);
}
#ifdef XP_WIN
RefPtr<ID3D11Device> device =
mozilla::gfx::DeviceManagerDx::Get()->GetImageDevice();
if (device && aLayersBackend == LayersBackend::LAYERS_D3D11) {
DXGIYCbCrTextureAllocationHelper helper(clientData, TextureFlags::DEFAULT,
device);
RefPtr<TextureClient> texture = helper.Allocate(nullptr);
return texture.forget();
}
#endif
if (data) {
return MakeAndAddRef<TextureClient>(data, TextureFlags::DEALLOCATE_CLIENT,
nullptr);
@@ -109,15 +97,6 @@ static already_AddRefed<TextureClient> CreateTextureClientWithBackend(
return nullptr;
}
#ifdef XP_WIN
if (aLayersBackend == LayersBackend::LAYERS_D3D11 &&
(moz2DBackend == BackendType::DIRECT2D ||
moz2DBackend == BackendType::DIRECT2D1_1)) {
// Create D3D11TextureData.
data = D3D11TextureData::Create(size, format, allocFlags);
}
#endif
if (!data && aLayersBackend == LayersBackend::LAYERS_BASIC) {
// Create BufferTextureData.
data = BufferTextureData::Create(size, format, moz2DBackend, aLayersBackend,

View File

@@ -513,10 +513,6 @@ mozilla::gfx::BackendType gfxWindowsPlatform::GetContentBackendFor(
mozilla::layers::LayersBackend aLayers) {
mozilla::gfx::BackendType defaultBackend =
gfxPlatform::GetDefaultContentBackend();
if (aLayers == LayersBackend::LAYERS_D3D11) {
return defaultBackend;
}
if (aLayers == LayersBackend::LAYERS_WR &&
gfx::gfxVars::UseWebRenderANGLE()) {
return defaultBackend;