diff options
author | Moonchild <moonchild@palemoon.org> | 2021-11-17 23:02:46 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-04-04 22:15:34 +0200 |
commit | ef5083db5f52156bebeffbe73317efcf35350228 (patch) | |
tree | d2a456633aa98a074593ae589cd65c6efad79054 /gfx/thebes | |
parent | cff9ef7fb81b46264caea00ac3c7a99677d8b856 (diff) | |
download | uxp-ef5083db5f52156bebeffbe73317efcf35350228.tar.gz |
Issue #1841 - Part 2: Remove D3D9 layer compositor references and
layer fallback code.
Diffstat (limited to 'gfx/thebes')
-rw-r--r-- | gfx/thebes/gfxPrefs.h | 2 | ||||
-rwxr-xr-x | gfx/thebes/gfxWindowsPlatform.cpp | 66 | ||||
-rw-r--r-- | gfx/thebes/gfxWindowsPlatform.h | 1 | ||||
-rw-r--r-- | gfx/thebes/gfxWindowsSurface.cpp | 8 | ||||
-rw-r--r-- | gfx/thebes/gfxWindowsSurface.h | 3 | ||||
-rw-r--r-- | gfx/thebes/moz.build | 2 |
6 files changed, 6 insertions, 76 deletions
diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index c061a3f04b..143d9199ca 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -450,7 +450,6 @@ private: DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.print-histogram", FPSPrintHistogram, bool, false); DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.write-to-file", WriteFPSToFile, bool, false); DECL_GFX_PREF(Once, "layers.acceleration.force", LayersAccelerationForceEnabledDoNotUseDirectly, bool, false); - DECL_GFX_PREF(Skip, "layers.allow-d3d9-fallback", LayersAllowD3D9Fallback, bool, false); DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled", LayersAMDSwitchableGfxEnabled, bool, false); DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled", AsyncPanZoomEnabledDoNotUseDirectly, bool, true); DECL_GFX_PREF(Once, "layers.async-pan-zoom.separate-event-thread", AsyncPanZoomSeparateEventThread, bool, false); @@ -495,7 +494,6 @@ private: DECL_GFX_PREF(Live, "layers.offmainthreadcomposition.frame-rate", LayersCompositionFrameRate, int32_t,-1); DECL_GFX_PREF(Live, "layers.orientation.sync.timeout", OrientationSyncMillis, uint32_t, (uint32_t)0); DECL_GFX_PREF(Once, "layers.overzealous-gralloc-unlocking", OverzealousGrallocUnlocking, bool, false); - DECL_GFX_PREF(Skip, "layers.prefer-d3d9", LayersPreferD3D9, bool, false); DECL_GFX_PREF(Once, "layers.prefer-opengl", LayersPreferOpenGL, bool, false); DECL_GFX_PREF(Live, "layers.progressive-paint", ProgressivePaint, bool, false); DECL_GFX_PREF(Live, "layers.shared-buffer-provider.enabled", PersistentBufferProviderSharedEnabled, bool, false); diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 78cfaf24ef..2a86340787 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -35,7 +35,6 @@ #include "gfxGDIFont.h" #include "mozilla/layers/CompositorThread.h" -#include "DeviceManagerD3D9.h" #include "mozilla/layers/ReadbackManagerD3D11.h" #include "gfxDWriteFontList.h" @@ -324,7 +323,6 @@ gfxWindowsPlatform::~gfxWindowsPlatform() { mozilla::gfx::Factory::D2DCleanup(); - DeviceManagerD3D9::Shutdown(); DeviceManagerDx::Shutdown(); /* @@ -356,7 +354,6 @@ gfxWindowsPlatform::InitAcceleration() mFeatureLevels.AppendElement(D3D_FEATURE_LEVEL_9_3); DeviceManagerDx::Init(); - DeviceManagerD3D9::Init(); InitializeConfig(); InitializeDevices(); @@ -380,7 +377,7 @@ gfxWindowsPlatform::CanUseHardwareVideoDecoding() if (!dm) { return false; } - if (!gfxPrefs::LayersPreferD3D9() && !dm->TextureSharingWorks()) { + if (!dm->TextureSharingWorks()) { return false; } return !dm->IsWARP() && gfxPlatform::CanUseHardwareVideoDecoding(); @@ -1338,7 +1335,6 @@ gfxWindowsPlatform::InitializeConfig() if (XRE_IsParentProcess()) { // The parent process first determines which features can be attempted. // This information is relayed to content processes and the GPU process. - InitializeD3D9Config(); InitializeD3D11Config(); InitializeANGLEConfig(); InitializeD2DConfig(); @@ -1349,40 +1345,6 @@ gfxWindowsPlatform::InitializeConfig() } void -gfxWindowsPlatform::InitializeD3D9Config() -{ - MOZ_ASSERT(XRE_IsParentProcess()); - - FeatureState& d3d9 = gfxConfig::GetFeature(Feature::D3D9_COMPOSITING); - - if (!gfxConfig::IsEnabled(Feature::HW_COMPOSITING)) { - d3d9.DisableByDefault(FeatureStatus::Unavailable, "Hardware compositing is disabled", - NS_LITERAL_CSTRING("FEATURE_FAILURE_D3D9_NEED_HWCOMP")); - return; - } - - d3d9.SetDefaultFromPref( - gfxPrefs::GetLayersAllowD3D9FallbackPrefName(), - true, - gfxPrefs::GetLayersAllowD3D9FallbackPrefDefault()); - - if (!d3d9.IsEnabled() && gfxPrefs::LayersPreferD3D9()) { - d3d9.UserEnable("Direct3D9 enabled via layers.prefer-d3d9"); - } - - nsCString message; - nsCString failureId; - if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, &message, - failureId)) { - d3d9.Disable(FeatureStatus::Blacklisted, message.get(), failureId); - } - - if (gfxConfig::IsForcedOnByUser(Feature::HW_COMPOSITING)) { - d3d9.UserForceEnable("Hardware compositing is force-enabled"); - } -} - -void gfxWindowsPlatform::InitializeD3D11Config() { MOZ_ASSERT(XRE_IsParentProcess()); @@ -1412,13 +1374,6 @@ gfxWindowsPlatform::InitializeD3D11Config() } } - // If the user prefers D3D9, act as though they disabled D3D11. - if (gfxPrefs::LayersPreferD3D9()) { - d3d11.UserDisable("Disabled due to user preference for Direct3D 9", - NS_LITERAL_CSTRING("FEATURE_FAILURE_D3D11_PREF")); - return; - } - nsCString message; nsCString failureId; if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, &message, failureId)) { @@ -1481,8 +1436,8 @@ gfxWindowsPlatform::InitializeD3D11() // is not blacklisted for D3D11 layers. This first attempt will try to create // a hardware accelerated device. If this creation fails or the hardware is // blacklisted, then this function will abort if WARP is disabled, causing us - // to fallback to D3D9 or Basic layers. If WARP is not disabled it will use - // a WARP device which should always be available on Windows 7 and higher. + // to fallback to Basic layers. If WARP is not disabled it will use a WARP + // device which should always be available on Windows 7 and higher. if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { return; } @@ -1604,8 +1559,8 @@ gfxWindowsPlatform::InitGPUProcessSupport() NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_D3D11")); } else if (!IsWin7SP1OrLater()) { // On Windows 7 Pre-SP1, DXGI 1.2 is not available and remote presentation - // for D3D11 will not work. Rather than take a regression and use D3D9, we - // revert back to in-process rendering. + // for D3D11 will not work. Rather than take a regression we revert back to + // in-process rendering. gpuProc.Disable( FeatureStatus::Unavailable, "Windows 7 Pre-SP1 cannot use the GPU process", @@ -1941,17 +1896,9 @@ gfxWindowsPlatform::GetAcceleratedCompositorBackends(nsTArray<LayersBackend>& aB aBackends.AppendElement(LayersBackend::LAYERS_OPENGL); } - if (gfxConfig::IsEnabled(Feature::D3D9_COMPOSITING) && gfxPrefs::LayersPreferD3D9()) { - aBackends.AppendElement(LayersBackend::LAYERS_D3D9); - } - if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { aBackends.AppendElement(LayersBackend::LAYERS_D3D11); } - - if (gfxConfig::IsEnabled(Feature::D3D9_COMPOSITING) && !gfxPrefs::LayersPreferD3D9()) { - aBackends.AppendElement(LayersBackend::LAYERS_D3D9); - } } void @@ -1962,7 +1909,6 @@ gfxWindowsPlatform::ImportGPUDeviceData(const mozilla::gfx::GPUDeviceData& aData gfxPlatform::ImportGPUDeviceData(aData); gfxConfig::ImportChange(Feature::D3D11_COMPOSITING, aData.d3d11Compositing()); - gfxConfig::ImportChange(Feature::D3D9_COMPOSITING, aData.d3d9Compositing()); DeviceManagerDx* dm = DeviceManagerDx::Get(); if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { @@ -2000,7 +1946,6 @@ gfxWindowsPlatform::ImportContentDeviceData(const mozilla::gfx::ContentDeviceDat const DevicePrefs& prefs = aData.prefs(); gfxConfig::Inherit(Feature::D3D11_COMPOSITING, prefs.d3d11Compositing()); - gfxConfig::Inherit(Feature::D3D9_COMPOSITING, prefs.d3d9Compositing()); gfxConfig::Inherit(Feature::DIRECT2D, prefs.useD2D1()); if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { @@ -2019,7 +1964,6 @@ gfxWindowsPlatform::BuildContentDeviceData(ContentDeviceData* aOut) const FeatureState& d3d11 = gfxConfig::GetFeature(Feature::D3D11_COMPOSITING); aOut->prefs().d3d11Compositing() = d3d11.GetValue(); - aOut->prefs().d3d9Compositing() = gfxConfig::GetValue(Feature::D3D9_COMPOSITING); aOut->prefs().useD2D1() = gfxConfig::GetValue(Feature::DIRECT2D); if (d3d11.IsEnabled()) { diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h index b56dab338a..111f294591 100644 --- a/gfx/thebes/gfxWindowsPlatform.h +++ b/gfx/thebes/gfxWindowsPlatform.h @@ -49,7 +49,6 @@ class FeatureState; class DeviceManagerDx; } namespace layers { -class DeviceManagerD3D9; class ReadbackManagerD3D11; } } diff --git a/gfx/thebes/gfxWindowsSurface.cpp b/gfx/thebes/gfxWindowsSurface.cpp index e2d90883bb..5a993aba0b 100644 --- a/gfx/thebes/gfxWindowsSurface.cpp +++ b/gfx/thebes/gfxWindowsSurface.cpp @@ -21,14 +21,6 @@ gfxWindowsSurface::gfxWindowsSurface(HDC dc, uint32_t flags) : InitWithDC(flags); } -gfxWindowsSurface::gfxWindowsSurface(IDirect3DSurface9 *surface, uint32_t flags) : - mOwnsDC(false), mDC(0), mWnd(nullptr) -{ - cairo_surface_t *surf = cairo_win32_surface_create_with_d3dsurface9(surface); - Init(surf); -} - - void gfxWindowsSurface::MakeInvalid(mozilla::gfx::IntSize& size) { diff --git a/gfx/thebes/gfxWindowsSurface.h b/gfx/thebes/gfxWindowsSurface.h index 594357a260..c425f18185 100644 --- a/gfx/thebes/gfxWindowsSurface.h +++ b/gfx/thebes/gfxWindowsSurface.h @@ -27,9 +27,6 @@ public: gfxWindowsSurface(HDC dc, uint32_t flags = 0); - // Create from a shared d3d9surface - gfxWindowsSurface(IDirect3DSurface9 *surface, uint32_t flags = 0); - // Create a DIB surface gfxWindowsSurface(const mozilla::gfx::IntSize& size, gfxImageFormat imageFormat = mozilla::gfx::SurfaceFormat::X8R8G8B8_UINT32); diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build index 6339f36c7a..bee77cbbec 100644 --- a/gfx/thebes/moz.build +++ b/gfx/thebes/moz.build @@ -197,7 +197,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): DEFINES['MOZ_ENABLE_FREETYPE'] = True if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': - for var in ('MOZ_ENABLE_D3D9_LAYER', 'MOZ_ENABLE_D3D10_LAYER'): + for var in ('MOZ_ENABLE_D3D10_LAYER'): if CONFIG[var]: DEFINES[var] = True |