tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit c94f5fca4f33fc2bafc0ea1767f57e189484ce71
parent d6f9ff3ebcdbb2ef0ea043a5897c680c6845fec3
Author: Lee Salzman <lsalzman@mozilla.com>
Date:   Fri, 24 Oct 2025 19:01:03 +0000

Bug 1996104 - Remove Feature::DIRECT2D and related queries. r=aosmond,geckoview-reviewers,media-playback-reviewers,win-reviewers,webcompat-reviewers,toolkit-telemetry-reviewers,layout-reviewers,gstoll,twisniewski,emilio,m_kato

Now that Direct2D is no longer supported, we can start removing the associated Feature
and queries of it.

This patch does the awkward work of removing Direct2D feature testing throughout Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D269855

Diffstat:
Maccessible/tests/mochitest/attributes/test_obj.html | 10----------
Maccessible/windows/msaa/ApplicationAccessibleWrap.cpp | 9---------
Mbrowser/components/reportbrokensite/test/browser/send_more_info.js | 1-
Mdom/canvas/test/test_canvas.html | 156+++++++++++++++++++++++++++++++++-----------------------------------------------
Mdom/media/ipc/RDDParent.cpp | 1-
Mgfx/config/gfxConfig.cpp | 3---
Mgfx/config/gfxFeature.h | 1-
Mgfx/ipc/GPUChild.cpp | 1-
Mgfx/ipc/GPUParent.cpp | 1-
Mgfx/ipc/GraphicsMessages.ipdlh | 1-
Mgfx/tests/gtest/TestConfigManager.cpp | 3---
Mgfx/tests/mochitest/test_acceleration.html | 10++--------
Mgfx/thebes/gfxPlatform.cpp | 6+-----
Mgfx/thebes/gfxUtils.cpp | 10+---------
Mgfx/thebes/gfxWindowsPlatform.cpp | 177++-----------------------------------------------------------------------------
Mgfx/thebes/gfxWindowsPlatform.h | 13-------------
Mgfx/vr/ipc/VRChild.cpp | 1-
Mgfx/vr/ipc/VRParent.cpp | 1-
Mipc/glue/UtilityMediaServiceParent.cpp | 1-
Mlayout/generic/test/test_selection_underline.html | 18------------------
Mlayout/tools/reftest/reftest-content.js | 2--
Mtesting/condprofile/condprof/tests/profile/prefs.js | 2+-
Mtoolkit/components/reportbrokensite/ReportBrokenSiteParent.sys.mjs | 1-
Mtoolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs | 4----
Mtoolkit/components/telemetry/docs/data/environment.rst | 1-
Mtoolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs | 11-----------
Mtoolkit/content/aboutSupport.js | 1-
Mtoolkit/modules/Troubleshoot.sys.mjs | 5-----
Mtoolkit/modules/tests/browser/browser_Troubleshoot.js | 16----------------
Mtoolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist.json | 24++++++++++++------------
Mtoolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist_AllOS.json | 8++++----
Mtoolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist_OSVersion.json | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Device.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_DriverNew.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_DriverNew.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_DriverOld.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_OK.js | 5+----
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_GTE_DriverOld.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_GTE_OK.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_No_Comparison.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OK.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OS.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_match.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_mismatch_DriverVersion.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_mismatch_OSVersion.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Vendor.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Version.js | 2+-
Mtoolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_prefs.js | 10+++++-----
Mwidget/GfxInfoBase.cpp | 25-------------------------
Mwidget/GfxInfoFeatureDefs.h | 2--
Mwidget/android/GfxInfo.cpp | 5-----
Mwidget/android/GfxInfo.h | 1-
Mwidget/cocoa/GfxInfo.h | 1-
Mwidget/cocoa/GfxInfo.mm | 3---
Mwidget/gtk/GfxInfo.cpp | 3---
Mwidget/gtk/GfxInfo.h | 1-
Mwidget/metrics.yaml | 49-------------------------------------------------
Mwidget/nsIGfxInfo.idl | 3+--
Mwidget/uikit/GfxInfo.cpp | 3---
Mwidget/uikit/GfxInfo.h | 1-
Mwidget/windows/GfxInfo.cpp | 128++-----------------------------------------------------------------------------
Mwidget/windows/GfxInfo.h | 1-
62 files changed, 112 insertions(+), 658 deletions(-)

diff --git a/accessible/tests/mochitest/attributes/test_obj.html b/accessible/tests/mochitest/attributes/test_obj.html @@ -146,16 +146,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036 // don't barf on an empty abbr element. testAbsentAttrs("th3", { "abbr": "" }); - // application accessible - if (WIN) { - var gfxInfo = Cc["@mozilla.org/gfx/info;1"]. - getService(Ci.nsIGfxInfo); - var attrs = { - "D2D": (gfxInfo.D2DEnabled ? "true" : "false"), - }; - testAttrs(getApplicationAccessible(), attrs, false); - } - // no object attributes testAbsentAttrs(getAccessible("listitem").firstChild, { "tag": "" }); diff --git a/accessible/windows/msaa/ApplicationAccessibleWrap.cpp b/accessible/windows/msaa/ApplicationAccessibleWrap.cpp @@ -22,15 +22,6 @@ NS_IMPL_ISUPPORTS_INHERITED0(ApplicationAccessibleWrap, ApplicationAccessible) already_AddRefed<AccAttributes> ApplicationAccessibleWrap::NativeAttributes() { RefPtr<AccAttributes> attributes = new AccAttributes(); - - nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service(); - if (gfxInfo) { - bool isD2DEnabled = false; - gfxInfo->GetD2DEnabled(&isD2DEnabled); - RefPtr<nsAtom> attrName = NS_Atomize(u"D2D"_ns); - attributes->SetAttribute(attrName, isD2DEnabled); - } - return attributes.forget(); } diff --git a/browser/components/reportbrokensite/test/browser/send_more_info.js b/browser/components/reportbrokensite/test/browser/send_more_info.js @@ -152,7 +152,6 @@ async function reformatExpectedWebCompatInfo(tab, overrides) { const { gfxData } = reformatted.details.additionalData; for (const optional of [ - "direct2DEnabled", "directWriteEnabled", "directWriteVersion", "clearTypeParameters", diff --git a/dom/canvas/test/test_canvas.html b/dom/canvas/test/test_canvas.html @@ -10,16 +10,6 @@ SimpleTest.requestFlakyTimeout("untriaged"); const Cc = SpecialPowers.Cc; const Cr = SpecialPowers.Cr; -function IsD2DEnabled() { - var enabled = false; - - try { - enabled = Cc["@mozilla.org/gfx/info;1"].getService(SpecialPowers.Ci.nsIGfxInfo).D2DEnabled; - } catch(e) {} - - return enabled; -} - function IsLinux() { var os = ""; @@ -5728,39 +5718,33 @@ function test_2d_gradient_interpolate_overlap() { var canvas = document.getElementById('c215'); var ctx = canvas.getContext('2d'); -if (!IsD2DEnabled()) { - // On D2D the different nature of how gradients - // are drawn makes it so we cannot guarantee these stops are completely - // hard. - - // On OS X 10.5 quartz is confused by the overlapping stops: Bug #715235 - canvas.width = 200; - var g = ctx.createLinearGradient(0, 0, 200, 0); - g.addColorStop(0, '#f00'); - g.addColorStop(0, '#ff0'); - g.addColorStop(0.25, '#00f'); - g.addColorStop(0.25, '#0f0'); - g.addColorStop(0.25, '#0f0'); - g.addColorStop(0.25, '#0f0'); - g.addColorStop(0.25, '#ff0'); - g.addColorStop(0.5, '#00f'); - g.addColorStop(0.5, '#0f0'); - g.addColorStop(0.75, '#00f'); - g.addColorStop(0.75, '#f00'); - g.addColorStop(0.75, '#ff0'); - g.addColorStop(0.5, '#0f0'); - g.addColorStop(0.5, '#0f0'); - g.addColorStop(0.5, '#ff0'); - g.addColorStop(1, '#00f'); - ctx.fillStyle = g; - ctx.fillRect(0, 0, 200, 50); - isPixel(ctx, 49,25, 0,0,255,255, 16); - isPixel(ctx, 51,25, 255,255,0,255, 16); - isPixel(ctx, 99,25, 0,0,255,255, 16); - isPixel(ctx, 101,25, 255,255,0,255, 16); - isPixel(ctx, 149,25, 0,0,255,255, 16); - isPixel(ctx, 151,25, 255,255,0,255, 16); -} +// On OS X 10.5 quartz is confused by the overlapping stops: Bug #715235 +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.25, '#00f'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#ff0'); +g.addColorStop(0.5, '#00f'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.75, '#00f'); +g.addColorStop(0.75, '#f00'); +g.addColorStop(0.75, '#ff0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +isPixel(ctx, 49,25, 0,0,255,255, 16); +isPixel(ctx, 51,25, 255,255,0,255, 16); +isPixel(ctx, 99,25, 0,0,255,255, 16); +isPixel(ctx, 101,25, 255,255,0,255, 16); +isPixel(ctx, 149,25, 0,0,255,255, 16); +isPixel(ctx, 151,25, 255,255,0,255, 16); } </script> @@ -14040,16 +14024,12 @@ function test_2d_path_rect_zero_3() { var canvas = document.getElementById('c438'); var ctx = canvas.getContext('2d'); -if (!IsD2DEnabled()) { - // Disabled for D2D until we can figure out Bug 587554. - ctx.strokeStyle = '#f00'; - ctx.lineWidth = 100; - ctx.beginPath(); - ctx.rect(50, 25, 0, 0); - ctx.stroke(); - isPixel(ctx, 50,25, 0,0,0,0, 0); -} - +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 100; +ctx.beginPath(); +ctx.rect(50, 25, 0, 0); +ctx.stroke(); +isPixel(ctx, 50,25, 0,0,0,0, 0); } </script> @@ -14454,40 +14434,36 @@ function test_2d_path_stroke_scale2() { var canvas = document.getElementById('c451'); var ctx = canvas.getContext('2d'); -if (!IsD2DEnabled()) { - // On D2D a rasterization bug causes a small discrepancy here. See bug 587316 - ctx.fillStyle = '#f00'; - ctx.fillRect(0, 0, 100, 50); - - ctx.beginPath(); - ctx.rect(25, 12.5, 50, 25); - ctx.save(); - ctx.rotate(Math.PI/2); - ctx.scale(25, 50); - ctx.strokeStyle = '#0f0'; - ctx.stroke(); - ctx.restore(); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); - ctx.beginPath(); - ctx.rect(-25, -12.5, 150, 75); - ctx.save(); - ctx.rotate(Math.PI/2); - ctx.scale(25, 50); - ctx.strokeStyle = '#f00'; - ctx.stroke(); - ctx.restore(); +ctx.beginPath(); +ctx.rect(25, 12.5, 50, 25); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#0f0'; +ctx.stroke(); +ctx.restore(); - isPixel(ctx, 0,0, 0,255,0,255, 0); - isPixel(ctx, 50,0, 0,255,0,255, 0); - isPixel(ctx, 99,0, 0,255,0,255, 0); - isPixel(ctx, 0,25, 0,255,0,255, 0); - isPixel(ctx, 50,25, 0,255,0,255, 0); - isPixel(ctx, 99,25, 0,255,0,255, 0); - isPixel(ctx, 0,49, 0,255,0,255, 0); - isPixel(ctx, 50,49, 0,255,0,255, 0); - isPixel(ctx, 99,49, 0,255,0,255, 0); -} +ctx.beginPath(); +ctx.rect(-25, -12.5, 150, 75); +ctx.save(); +ctx.rotate(Math.PI/2); +ctx.scale(25, 50); +ctx.strokeStyle = '#f00'; +ctx.stroke(); +ctx.restore(); +isPixel(ctx, 0,0, 0,255,0,255, 0); +isPixel(ctx, 50,0, 0,255,0,255, 0); +isPixel(ctx, 99,0, 0,255,0,255, 0); +isPixel(ctx, 0,25, 0,255,0,255, 0); +isPixel(ctx, 50,25, 0,255,0,255, 0); +isPixel(ctx, 99,25, 0,255,0,255, 0); +isPixel(ctx, 0,49, 0,255,0,255, 0); +isPixel(ctx, 50,49, 0,255,0,255, 0); +isPixel(ctx, 99,49, 0,255,0,255, 0); } </script> @@ -18238,14 +18214,10 @@ function test_2d_strokeRect_zero_1() { var canvas = document.getElementById('c580'); var ctx = canvas.getContext('2d'); -if (!IsD2DEnabled()) { - // Disabled for D2D until we can figure out Bug 587554. - ctx.strokeStyle = '#f00'; - ctx.lineWidth = 250; - ctx.strokeRect(50, 25, 0, 0); - isPixel(ctx, 50,25, 0,0,0,0, 0); -} - +ctx.strokeStyle = '#f00'; +ctx.lineWidth = 250; +ctx.strokeRect(50, 25, 0, 0); +isPixel(ctx, 50,25, 0,0,0,0, 0); } </script> diff --git a/dom/media/ipc/RDDParent.cpp b/dom/media/ipc/RDDParent.cpp @@ -220,7 +220,6 @@ mozilla::ipc::IPCResult RDDParent::RecvInitVideoBridge( Feature::HW_COMPOSITING, Feature::D3D11_COMPOSITING, Feature::OPENGL_COMPOSITING, - Feature::DIRECT2D, }, aContentDeviceData.prefs()); #ifdef XP_WIN diff --git a/gfx/config/gfxConfig.cpp b/gfx/config/gfxConfig.cpp @@ -166,9 +166,6 @@ void gfxConfig::Inherit(EnumSet<Feature> aFeatures, case Feature::OPENGL_COMPOSITING: status = aDevicePrefs.oglCompositing(); break; - case Feature::DIRECT2D: - status = aDevicePrefs.useD2D1(); - break; default: break; } diff --git a/gfx/config/gfxFeature.h b/gfx/config/gfxFeature.h @@ -21,7 +21,6 @@ namespace gfx { _(HW_COMPOSITING, Feature, "Compositing") \ _(D3D11_COMPOSITING, Feature, "Direct3D11 Compositing") \ _(OPENGL_COMPOSITING, Feature, "OpenGL Compositing") \ - _(DIRECT2D, Feature, "Direct2D") \ _(D3D11_HW_ANGLE, Feature, "Direct3D11 hardware ANGLE") \ _(DIRECT_DRAW, Feature, "DirectDraw") \ _(GPU_PROCESS, Feature, "GPU Process") \ diff --git a/gfx/ipc/GPUChild.cpp b/gfx/ipc/GPUChild.cpp @@ -58,7 +58,6 @@ void GPUChild::Init() { gfxConfig::GetValue(Feature::D3D11_COMPOSITING); devicePrefs.oglCompositing() = gfxConfig::GetValue(Feature::OPENGL_COMPOSITING); - devicePrefs.useD2D1() = gfxConfig::GetValue(Feature::DIRECT2D); devicePrefs.d3d11HwAngle() = gfxConfig::GetValue(Feature::D3D11_HW_ANGLE); nsTArray<LayerTreeIdMapping> mappings; diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp @@ -302,7 +302,6 @@ mozilla::ipc::IPCResult GPUParent::RecvInit( gfxConfig::Inherit(Feature::D3D11_COMPOSITING, devicePrefs.d3d11Compositing()); gfxConfig::Inherit(Feature::OPENGL_COMPOSITING, devicePrefs.oglCompositing()); - gfxConfig::Inherit(Feature::DIRECT2D, devicePrefs.useD2D1()); gfxConfig::Inherit(Feature::D3D11_HW_ANGLE, devicePrefs.d3d11HwAngle()); { // Let the crash reporter know if we've got WR enabled or not. For other diff --git a/gfx/ipc/GraphicsMessages.ipdlh b/gfx/ipc/GraphicsMessages.ipdlh @@ -34,7 +34,6 @@ struct DevicePrefs FeatureStatus hwCompositing; FeatureStatus d3d11Compositing; FeatureStatus oglCompositing; - FeatureStatus useD2D1; FeatureStatus d3d11HwAngle; }; diff --git a/gfx/tests/gtest/TestConfigManager.cpp b/gfx/tests/gtest/TestConfigManager.cpp @@ -179,9 +179,6 @@ class MockGfxInfo final : public nsIGfxInfo { } NS_IMETHOD_(void) SetCodecSupportInfo(const nsACString& aCodecSupportInfo) override {} - NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override { - return NS_ERROR_NOT_IMPLEMENTED; - } NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/gfx/tests/mochitest/test_acceleration.html b/gfx/tests/mochitest/test_acceleration.html @@ -97,15 +97,9 @@ function runTest() { } var gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo); - if (version < 6.2) { - ok(!gfxInfo.D2DEnabled, "Direct2D not supported on Windows 2008 or older"); - if (version < 6.1) { - ok(!gfxInfo.DWriteEnabled, "DirectWrite not supported on Windows 2008 or older"); - } else { - ok(gfxInfo.DWriteEnabled, "DirectWrite enabled on Windows 7 or newer"); - } + if (version < 6.1) { + ok(!gfxInfo.DWriteEnabled, "DirectWrite not supported on Windows 2008 or older"); } else { - ok(gfxInfo.D2DEnabled, "Direct2D enabled on Windows 8 or newer"); ok(gfxInfo.DWriteEnabled, "DirectWrite enabled on Windows 7 or newer"); } diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp @@ -3951,11 +3951,7 @@ bool gfxPlatform::FallbackFromAcceleration(FeatureStatus aStatus, } // We aren't using Software WebRender + D3D11 compositing, so turn off the - // D3D11 and D2D. - if (gfxConfig::IsEnabled(Feature::DIRECT2D)) { - gfxConfig::GetFeature(Feature::DIRECT2D) - .ForceDisable(aStatus, aMessage, aFailureId); - } + // D3D11. if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { gfxConfig::GetFeature(Feature::D3D11_COMPOSITING) .ForceDisable(aStatus, aMessage, aFailureId); diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp @@ -272,15 +272,7 @@ void gfxUtils::ConvertBGRAtoRGBA(uint8_t* aData, uint32_t aLength) { * alpha channel or their alpha channel is uniformly opaque. * This differs per render mode. */ -static CompositionOp OptimalFillOp() { -# ifdef XP_WIN - if (gfxWindowsPlatform::GetPlatform()->IsDirect2DBackend()) { - // D2D -really- hates operator source. - return CompositionOp::OP_OVER; - } -# endif - return CompositionOp::OP_SOURCE; -} +static CompositionOp OptimalFillOp() { return CompositionOp::OP_SOURCE; } // EXTEND_PAD won't help us here; we have to create a temporary surface to hold // the subimage of pixels we're allowed to sample. diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp @@ -96,28 +96,6 @@ DCForMetrics::DCForMetrics() { SetGraphicsMode(mDC, GM_ADVANCED); } -class GfxD2DVramReporter final : public nsIMemoryReporter { - ~GfxD2DVramReporter() {} - - public: - NS_DECL_ISUPPORTS - - NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport, - nsISupports* aData, bool aAnonymize) override { - MOZ_COLLECT_REPORT("gfx-d2d-vram-draw-target", KIND_OTHER, UNITS_BYTES, - Factory::GetD2DVRAMUsageDrawTarget(), - "Video memory used by D2D DrawTargets."); - - MOZ_COLLECT_REPORT("gfx-d2d-vram-source-surface", KIND_OTHER, UNITS_BYTES, - Factory::GetD2DVRAMUsageSourceSurface(), - "Video memory used by D2D SourceSurfaces."); - - return NS_OK; - } -}; - -NS_IMPL_ISUPPORTS(GfxD2DVramReporter, nsIMemoryReporter) - class GPUAdapterReporter final : public nsIMemoryReporter { // Callers must Release the DXGIAdapter after use or risk mem-leak static bool GetDXGIAdapter(IDXGIAdapter** aDXGIAdapter) { @@ -267,15 +245,12 @@ gfxWindowsPlatform::gfxWindowsPlatform() { */ CoInitialize(nullptr); - RegisterStrongMemoryReporter(new GfxD2DVramReporter()); RegisterStrongMemoryReporter(new GPUAdapterReporter()); RegisterStrongMemoryReporter(new D3DSharedTexturesReporter()); } } gfxWindowsPlatform::~gfxWindowsPlatform() { - mozilla::gfx::Factory::D2DCleanup(); - DeviceManagerDx::Shutdown(); // We don't initialize COM when win32k is locked down. @@ -291,7 +266,6 @@ gfxWindowsPlatform::~gfxWindowsPlatform() { void gfxWindowsPlatform::InitMemoryReportersForGPUProcess() { MOZ_RELEASE_ASSERT(XRE_IsGPUProcess()); - RegisterStrongMemoryReporter(new GfxD2DVramReporter()); RegisterStrongMemoryReporter(new GPUAdapterReporter()); RegisterStrongMemoryReporter(new D3DSharedTexturesReporter()); } @@ -494,7 +468,6 @@ bool gfxWindowsPlatform::HandleDeviceReset() { gfxConfig::Reset(Feature::D3D11_COMPOSITING); gfxConfig::Reset(Feature::D3D11_HW_ANGLE); - gfxConfig::Reset(Feature::DIRECT2D); InitializeConfig(); // XXX Add InitWebRenderConfig() calling. @@ -513,38 +486,14 @@ BackendPrefsData gfxWindowsPlatform::GetBackendPrefs() const { data.mCanvasDefault = BackendType::SKIA; data.mContentDefault = BackendType::SKIA; - if (gfxConfig::IsEnabled(Feature::DIRECT2D)) { - data.mCanvasBitmask |= BackendTypeBit(BackendType::DIRECT2D1_1); - data.mCanvasDefault = BackendType::DIRECT2D1_1; - } return data; } void gfxWindowsPlatform::UpdateBackendPrefs() { BackendPrefsData data = GetBackendPrefs(); - // Remove DIRECT2D1 preference if D2D1Device does not exist. - if (!Factory::HasD2D1Device()) { - data.mContentBitmask &= ~BackendTypeBit(BackendType::DIRECT2D1_1); - if (data.mContentDefault == BackendType::DIRECT2D1_1) { - data.mContentDefault = BackendType::SKIA; - } - - // Don't exclude DIRECT2D1_1 if using remote canvas, because DIRECT2D1_1 and - // hence the device will be used in the GPU process. - if (!gfxPlatform::UseRemoteCanvas()) { - data.mCanvasBitmask &= ~BackendTypeBit(BackendType::DIRECT2D1_1); - if (data.mCanvasDefault == BackendType::DIRECT2D1_1) { - data.mCanvasDefault = BackendType::SKIA; - } - } - } InitBackendPrefs(std::move(data)); } -bool gfxWindowsPlatform::IsDirect2DBackend() { - return GetDefaultContentBackend() == BackendType::DIRECT2D1_1; -} - void gfxWindowsPlatform::UpdateRenderMode() { bool didReset = HandleDeviceReset(); @@ -560,9 +509,6 @@ void gfxWindowsPlatform::UpdateRenderMode() { << ", D3D11 status:" << FeatureStatusToString( gfxConfig::GetValue(Feature::D3D11_COMPOSITING)) - << ", D2D1 device:" << hexa(Factory::GetD2D1Device().get()) - << ", D2D1 status:" - << FeatureStatusToString(gfxConfig::GetValue(Feature::DIRECT2D)) << ", content:" << int(GetDefaultContentBackend()) << ", compositor:" << int(GetCompositorBackend()); MOZ_CRASH( @@ -573,38 +519,11 @@ void gfxWindowsPlatform::UpdateRenderMode() { mozilla::gfx::BackendType gfxWindowsPlatform::GetContentBackendFor( mozilla::layers::LayersBackend aLayers) { - mozilla::gfx::BackendType defaultBackend = - gfxPlatform::GetDefaultContentBackend(); - if (aLayers == LayersBackend::LAYERS_WR && - gfx::gfxVars::UseWebRenderANGLE()) { - return defaultBackend; - } - - if (defaultBackend == BackendType::DIRECT2D1_1) { - // We can't have D2D without D3D11 layers, so fallback to Skia. - return BackendType::SKIA; - } - - // Otherwise we have some non-accelerated backend and that's ok. - return defaultBackend; + return gfxPlatform::GetDefaultContentBackend(); } mozilla::gfx::BackendType gfxWindowsPlatform::GetPreferredCanvasBackend() { - mozilla::gfx::BackendType backend = gfxPlatform::GetPreferredCanvasBackend(); - - if (backend == BackendType::DIRECT2D1_1) { - if (!gfx::gfxVars::UseWebRenderANGLE()) { - // We can't have D2D without ANGLE when WebRender is enabled, so fallback - // to Skia. - return BackendType::SKIA; - } - - // Fall back to software when remote canvas has been deactivated. - if (CanvasChild::Deactivated()) { - return BackendType::SKIA; - } - } - return backend; + return gfxPlatform::GetPreferredCanvasBackend(); } bool gfxWindowsPlatform::CreatePlatformFontList() { @@ -1420,7 +1339,6 @@ void gfxWindowsPlatform::InitializeConfig() { // This information is relayed to content processes and the GPU process. InitializeD3D11Config(); InitializeANGLEConfig(); - InitializeD2DConfig(); } else { ImportCachedContentDeviceData(); InitializeANGLEConfig(); @@ -1532,22 +1450,11 @@ void gfxWindowsPlatform::InitializeDevices() { gfxConfig::SetFailed( Feature::D3D11_COMPOSITING, FeatureStatus::CrashedOnStartup, "Harware acceleration crashed during startup in a previous session"); - gfxConfig::SetFailed( - Feature::DIRECT2D, FeatureStatus::CrashedOnStartup, - "Harware acceleration crashed during startup in a previous session"); return; } - bool shouldUseD2D = gfxConfig::IsEnabled(Feature::DIRECT2D); - - // First, initialize D3D11. If this succeeds we attempt to use Direct2D. + // First, initialize D3D11. InitializeD3D11(); - InitializeD2D(); - - if (!gfxConfig::IsEnabled(Feature::DIRECT2D) && XRE_IsContentProcess() && - shouldUseD2D) { - RecordContentDeviceFailure(TelemetryDeviceCode::D2D1); - } } void gfxWindowsPlatform::InitializeD3D11() { @@ -1580,74 +1487,6 @@ void gfxWindowsPlatform::InitializeD3D11() { } } -void gfxWindowsPlatform::InitializeD2DConfig() { - FeatureState& d2d1 = gfxConfig::GetFeature(Feature::DIRECT2D); - - d2d1.DisableByDefault(FeatureStatus::Unavailable, "Direct2D is not supported", - "FEATURE_FAILURE_DIRECT2D_NOT_SUPPORTED"_ns); -} - -void gfxWindowsPlatform::InitializeD2D() { - ScopedGfxFeatureReporter d2d1_1("D2D1.1"); - - FeatureState& d2d1 = gfxConfig::GetFeature(Feature::DIRECT2D); - - DeviceManagerDx* dm = DeviceManagerDx::Get(); - - // We don't know this value ahead of time, but the user can force-override - // it, so we use Disable instead of SetFailed. - if (dm->IsWARP()) { - d2d1.Disable(FeatureStatus::Blocked, - "Direct2D is not compatible with Direct3D11 WARP", - "FEATURE_FAILURE_D2D_WARP_BLOCK"_ns); - } - - // If we pass all the initial checks, we can proceed to runtime decisions. - if (!d2d1.IsEnabled()) { - return; - } - - if (!Factory::SupportsD2D1()) { - d2d1.SetFailed(FeatureStatus::Unavailable, - "Failed to acquire a Direct2D 1.1 factory", - "FEATURE_FAILURE_D2D_FACTORY"_ns); - return; - } - - if (!dm->GetContentDevice()) { - d2d1.SetFailed(FeatureStatus::Failed, - "Failed to acquire a Direct3D 11 content device", - "FEATURE_FAILURE_D2D_DEVICE"_ns); - return; - } - - if (!dm->TextureSharingWorks()) { - d2d1.SetFailed(FeatureStatus::Failed, - "Direct3D11 device does not support texture sharing", - "FEATURE_FAILURE_D2D_TXT_SHARING"_ns); - return; - } - - // Using Direct2D depends on DWrite support. - if (!DWriteEnabled() && !InitDWriteSupport()) { - d2d1.SetFailed(FeatureStatus::Failed, - "Failed to initialize DirectWrite support", - "FEATURE_FAILURE_D2D_DWRITE"_ns); - return; - } - - // Verify that Direct2D device creation succeeded. - RefPtr<ID3D11Device> contentDevice = dm->GetContentDevice(); - if (!Factory::SetDirect3D11Device(contentDevice)) { - d2d1.SetFailed(FeatureStatus::Failed, "Failed to create a Direct2D device", - "FEATURE_FAILURE_D2D_CREATE_FAILED"_ns); - return; - } - - MOZ_ASSERT(d2d1.IsEnabled()); - d2d1_1.SetSuccessful(); -} - class D3DVsyncSource final : public VsyncSource { public: D3DVsyncSource() @@ -1932,14 +1771,6 @@ void gfxWindowsPlatform::ImportGPUDeviceData( } else { // There should be no devices, so this just takes away the device status. dm->ResetDevices(); - - // Make sure we disable D2D if content processes might use it. - FeatureState& d2d1 = gfxConfig::GetFeature(Feature::DIRECT2D); - if (d2d1.IsEnabled()) { - d2d1.SetFailed(FeatureStatus::Unavailable, - "Direct2D requires Direct3D 11 compositing", - "FEATURE_FAILURE_D2D_D3D11_COMP"_ns); - } } // Hardware video decoding depends on d3d11 state, so update the cache. @@ -1959,7 +1790,6 @@ void gfxWindowsPlatform::ImportContentDeviceData( const DevicePrefs& prefs = aData.prefs(); gfxConfig::Inherit(Feature::D3D11_COMPOSITING, prefs.d3d11Compositing()); - gfxConfig::Inherit(Feature::DIRECT2D, prefs.useD2D1()); if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { DeviceManagerDx* dm = DeviceManagerDx::Get(); @@ -1975,7 +1805,6 @@ void gfxWindowsPlatform::BuildContentDeviceData(ContentDeviceData* aOut) { const FeatureState& d3d11 = gfxConfig::GetFeature(Feature::D3D11_COMPOSITING); aOut->prefs().d3d11Compositing() = d3d11.GetValue(); - aOut->prefs().useD2D1() = gfxConfig::GetValue(Feature::DIRECT2D); if (d3d11.IsEnabled()) { DeviceManagerDx* dm = DeviceManagerDx::Get(); diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h @@ -103,23 +103,12 @@ class gfxWindowsPlatform final : public gfxPlatform { virtual already_AddRefed<gfxASurface> CreateOffscreenSurface( const IntSize& aSize, gfxImageFormat aFormat) override; - bool IsDirect2DBackend(); - /** * Updates render mode with relation to the current preferences and * available devices. */ void UpdateRenderMode(); - /** - * Verifies a D2D device is present and working, will attempt to create one - * it is non-functional or non-existant. - * - * \param aAttemptForce Attempt to force D2D cairo device creation by using - * cairo device creation routines. - */ - void VerifyD2DDevice(bool aAttemptForce); - void GetCommonFallbackFonts(uint32_t aCh, Script aRunScript, FontPresentation aPresentation, nsTArray<const char*>& aFontList) override; @@ -202,13 +191,11 @@ class gfxWindowsPlatform final : public gfxPlatform { void InitializeDevices(); void InitializeD3D11(); - void InitializeD2D(); bool InitDWriteSupport(); void InitializeConfig(); void InitializeD3D9Config(); void InitializeD3D11Config(); - void InitializeD2DConfig(); void InitializeDirectDrawConfig(); void RecordStartupTelemetry(); diff --git a/gfx/vr/ipc/VRChild.cpp b/gfx/vr/ipc/VRChild.cpp @@ -106,7 +106,6 @@ void VRChild::Init() { gfxConfig::GetValue(Feature::D3D11_COMPOSITING); devicePrefs.oglCompositing() = gfxConfig::GetValue(Feature::OPENGL_COMPOSITING); - devicePrefs.useD2D1() = gfxConfig::GetValue(Feature::DIRECT2D); SendInit(updates, devicePrefs); diff --git a/gfx/vr/ipc/VRParent.cpp b/gfx/vr/ipc/VRParent.cpp @@ -54,7 +54,6 @@ IPCResult VRParent::RecvInit(nsTArray<GfxVarUpdate>&& vars, gfxConfig::Inherit(Feature::D3D11_COMPOSITING, devicePrefs.d3d11Compositing()); gfxConfig::Inherit(Feature::OPENGL_COMPOSITING, devicePrefs.oglCompositing()); - gfxConfig::Inherit(Feature::DIRECT2D, devicePrefs.useD2D1()); #if defined(XP_WIN) if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { diff --git a/ipc/glue/UtilityMediaServiceParent.cpp b/ipc/glue/UtilityMediaServiceParent.cpp @@ -163,7 +163,6 @@ mozilla::ipc::IPCResult UtilityMediaServiceParent::RecvInitVideoBridge( gfx::Feature::HW_COMPOSITING, gfx::Feature::D3D11_COMPOSITING, gfx::Feature::OPENGL_COMPOSITING, - gfx::Feature::DIRECT2D, }, aContentDeviceData.prefs()); diff --git a/layout/generic/test/test_selection_underline.html b/layout/generic/test/test_selection_underline.html @@ -115,25 +115,7 @@ const kDecorations = [ ]; -function IsD2DEnabled() { - var enabled = false; - - try { - enabled = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo).D2DEnabled; - } catch(e) {} - - return enabled; -} - function getFuzz(test) { - // Only failing on Windows with Direct2D enabled, and only for 16 permutations. - if (IsD2DEnabled() && - test.decoration.styleName == "solid" && - test.decoration.relativeSize == "1" && - test.font.family == "mplusTest" && - test.selection.typeName != "SpellCheck") { - return { numDifferentPixels: 194, maxDifference: 1 }; - } return null; } diff --git a/layout/tools/reftest/reftest-content.js b/layout/tools/reftest/reftest-content.js @@ -1443,11 +1443,9 @@ function SendContentReady() { let info = {}; try { - info.D2DEnabled = gfxInfo.D2DEnabled; info.DWriteEnabled = gfxInfo.DWriteEnabled; info.EmbeddedInFirefoxReality = gfxInfo.EmbeddedInFirefoxReality; } catch (e) { - info.D2DEnabled = false; info.DWriteEnabled = false; info.EmbeddedInFirefoxReality = false; } diff --git a/testing/condprofile/condprof/tests/profile/prefs.js b/testing/condprofile/condprof/tests/profile/prefs.js @@ -1 +1 @@ -user_pref("gfx.blacklist.direct2d", 1); +user_pref("gfx.blacklist.dx_nv12", 1); diff --git a/toolkit/components/reportbrokensite/ReportBrokenSiteParent.sys.mjs b/toolkit/components/reportbrokensite/ReportBrokenSiteParent.sys.mjs @@ -129,7 +129,6 @@ export class ReportBrokenSiteParent extends JSWindowActorParent { ); return clean({ - direct2DEnabled: get("direct2DEnabled"), directWriteEnabled: get("directWriteEnabled"), directWriteVersion: get("directWriteVersion"), hasTouchScreen: info.ApzTouchInput == 1, diff --git a/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs b/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs @@ -1739,7 +1739,6 @@ EnvironmentCache.prototype = { */ _getGFXData() { let gfxData = { - D2DEnabled: getGfxField("D2DEnabled", null), DWriteEnabled: getGfxField("DWriteEnabled", null), ContentBackend: getGfxField("ContentBackend", null), Headless: getGfxField("isHeadless", null), @@ -1750,9 +1749,6 @@ EnvironmentCache.prototype = { monitors: [], features: {}, }; - if (gfxData.D2DEnabled !== null) { - Glean.gfx.d2dEnabled.set(gfxData.D2DEnabled); - } if (gfxData.DWriteEnabled !== null) { Glean.gfx.dwriteEnabled.set(gfxData.DWriteEnabled); } diff --git a/toolkit/components/telemetry/docs/data/environment.rst b/toolkit/components/telemetry/docs/data/environment.rst @@ -171,7 +171,6 @@ Structure: }, }, gfx: { - D2DEnabled: <bool>, // null on failure DWriteEnabled: <bool>, // null on failure ContentBackend: <string> // One of "Cairo", "Skia", or "Direct2D 1.1" Headless: <bool>, // null on failure diff --git a/toolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs b/toolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs @@ -862,8 +862,6 @@ export var TelemetryEnvironmentTesting = { }, checkGfx(gfxData) { - lazy.Assert.ok("D2DEnabled" in gfxData); - lazy.Assert.equal(gfxData.D2DEnabled, Glean.gfx.d2dEnabled.testGetValue()); lazy.Assert.ok("DWriteEnabled" in gfxData); lazy.Assert.equal( gfxData.DWriteEnabled, @@ -883,7 +881,6 @@ export var TelemetryEnvironmentTesting = { Glean.gfx.textScaleFactor.testGetValue() ); if (gIsWindows) { - lazy.Assert.equal(typeof gfxData.D2DEnabled, "boolean"); lazy.Assert.equal(typeof gfxData.DWriteEnabled, "boolean"); } @@ -942,14 +939,6 @@ export var TelemetryEnvironmentTesting = { lazy.Assert.equal(typeof gfxData.features.gpuProcess.status, "string"); lazy.Assert.ok(!!Glean.gfxFeatures.gpuProcess.testGetValue().status); - if (gIsWindows && !!gfxData.features?.d2d?.version) { - lazy.Assert.equal(typeof gfxData.features.d2d.version, "string"); - lazy.Assert.equal( - gfxData.features.d2d.version, - Glean.gfxFeatures.d2d.testGetValue().version - ); - } - try { // If we've not got nsIGfxInfoDebug, then this will throw and stop us doing // this test. diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js @@ -713,7 +713,6 @@ var snapshotFormatters = { "webgl2DriverExtensions", "webgl2Extensions", ["supportsHardwareH264", "hardware-h264"], - ["direct2DEnabled", "#Direct2D"], ["windowProtocol", "graphics-window-protocol"], ["desktopEnvironment", "graphics-desktop-environment"], "targetFrameRate", diff --git a/toolkit/modules/Troubleshoot.sys.mjs b/toolkit/modules/Troubleshoot.sys.mjs @@ -642,7 +642,6 @@ var dataProviders = { adapterDriverDate2: "driverDate2", isGPU2Active: null, - D2DEnabled: "direct2DEnabled", DWriteEnabled: "directWriteEnabled", DWriteVersion: "directWriteVersion", cleartypeParameters: "clearTypeParameters", @@ -656,10 +655,6 @@ var dataProviders = { data[gfxInfoProps[prop] || prop] = gfxInfo[prop]; } catch (e) {} } - - if ("direct2DEnabled" in data && !data.direct2DEnabled) { - data.direct2DEnabledMessage = statusMsgForFeature("DIRECT2D"); - } } let doc = new DOMParser().parseFromString("<html/>", "text/html"); diff --git a/toolkit/modules/tests/browser/browser_Troubleshoot.js b/toolkit/modules/tests/browser/browser_Troubleshoot.js @@ -618,9 +618,6 @@ const SNAPSHOT_SCHEMA = { isGPU2Active: { type: "boolean", }, - direct2DEnabled: { - type: "boolean", - }, directWriteEnabled: { type: "boolean", }, @@ -687,19 +684,6 @@ const SNAPSHOT_SCHEMA = { crashGuards: { type: "array", }, - direct2DEnabledMessage: { - type: "object", - properties: { - key: { - required: true, - type: "string", - }, - args: { - required: false, - type: "object", - }, - }, - }, targetFrameRate: { type: "number", }, diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist.json b/toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist.json @@ -4,7 +4,7 @@ "os": "WINNT 6.1", "vendor": "0xabcd", "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION ", "driverVersion": " 8.52.322.2202 ", "driverVersionComparator": " LESS_THAN " @@ -23,7 +23,7 @@ "os": "WINNT 6.1", "vendor": "0xabab", "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION ", "driverVersion": " 8.52.322.2202 ", "driverVersionComparator": " GREATER_THAN_OR_EQUAL " @@ -32,7 +32,7 @@ "os": "WINNT 6.1", "vendor": "0xdcdc", "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION ", "driverVersion": " 8.52.322.1111 ", "driverVersionComparator": " EQUAL " @@ -41,21 +41,21 @@ "os": "Darwin 13", "vendor": "0xabcd", "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION " }, { "os": "Linux", "vendor": "0xabcd", "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION " }, { "os": "Android", "vendor": "abcd", "devices": ["wxyz", "asdf", "erty"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION ", "driverVersion": " 5 ", "driverVersionComparator": " LESS_THAN_OR_EQUAL " @@ -64,7 +64,7 @@ "os": "Android", "vendor": "dcdc", "devices": ["uiop", "vbnm", "hjkl"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION ", "driverVersion": " 5 ", "driverVersionComparator": " EQUAL " @@ -73,7 +73,7 @@ "os": "Android", "vendor": "abab", "devices": ["ghjk", "cvbn"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION ", "driverVersion": " 7 ", "driverVersionComparator": " GREATER_THAN_OR_EQUAL " @@ -82,28 +82,28 @@ "os": "WINNT 6.1", "vendor": "0xabcd", "devices": ["0x6666"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DEVICE " }, { "os": "Darwin 13", "vendor": "0xabcd", "devices": ["0x6666"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DEVICE " }, { "os": "Linux", "vendor": "0xabcd", "devices": ["0x6666"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DEVICE " }, { "os": "Android", "vendor": "0xabcd", "devices": ["0x6666"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DEVICE " }, { diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist_AllOS.json b/toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist_AllOS.json @@ -5,7 +5,7 @@ "vendor": "0xabcd", "versionRange": { "minVersion": "15.0", "maxVersion": "15.0" }, "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION " }, @@ -150,7 +150,7 @@ "vendor": "0xabcd", "versionRange": { "minVersion": "15.0", "maxVersion": "15.0" }, "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION " }, @@ -295,7 +295,7 @@ "vendor": "0xabcd", "versionRange": { "minVersion": "15.0", "maxVersion": "15.0" }, "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION " }, @@ -440,7 +440,7 @@ "vendor": "0xabcd", "versionRange": { "minVersion": "15.0", "maxVersion": "15.0" }, "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION " }, diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist_OSVersion.json b/toolkit/mozapps/extensions/test/xpcshell/data/test_gfxBlocklist_OSVersion.json @@ -3,7 +3,7 @@ "os": "WINNT 6.2", "vendor": "0xabcd", "devices": ["0x2783", "0x1234", "0x2782"], - "feature": " DIRECT2D ", + "feature": " DX_NV12 ", "featureStatus": " BLOCKED_DRIVER_VERSION ", "driverVersion": " 8.52.322.2202 ", "driverVersionComparator": " LESS_THAN " diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Device.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Device.js @@ -49,7 +49,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); status = gfxInfo.getFeatureStatusStr("DIRECT3D_9_LAYERS"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_DriverNew.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_DriverNew.js @@ -48,7 +48,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); status = gfxInfo.getFeatureStatusStr("DIRECT3D_9_LAYERS"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_DriverNew.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_DriverNew.js @@ -55,7 +55,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); // Make sure unrelated features aren't affected diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_DriverOld.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_DriverOld.js @@ -48,7 +48,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); // Make sure unrelated features aren't affected diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_OK.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Equal_OK.js @@ -48,11 +48,8 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); - Assert.equal(status, "BLOCKED_DRIVER_VERSION"); - // Make sure unrelated features aren't affected - status = gfxInfo.getFeatureStatusStr("DIRECT3D_9_LAYERS"); + var status = gfxInfo.getFeatureStatusStr("DIRECT3D_9_LAYERS"); Assert.equal(status, "STATUS_OK"); do_test_finished(); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_GTE_DriverOld.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_GTE_DriverOld.js @@ -48,7 +48,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); // Make sure unrelated features aren't affected diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_GTE_OK.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_GTE_OK.js @@ -50,7 +50,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "BLOCKED_DRIVER_VERSION"); // Make sure unrelated features aren't affected diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_No_Comparison.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_No_Comparison.js @@ -44,7 +44,7 @@ async function run_test() { function checkBlocklist() { var driverVersion = gfxInfo.adapterDriverVersion; if (driverVersion) { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "BLOCKED_DEVICE"); status = gfxInfo.getFeatureStatusStr("WEBRENDER"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OK.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OK.js @@ -49,7 +49,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "BLOCKED_DRIVER_VERSION"); // Make sure unrelated features aren't affected diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OS.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OS.js @@ -49,7 +49,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); status = gfxInfo.getFeatureStatusStr("DIRECT3D_9_LAYERS"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_match.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_match.js @@ -50,7 +50,7 @@ async function run_test() { function checkBlocklist() { if (Services.appinfo.OS == "WINNT") { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "BLOCKED_DRIVER_VERSION"); } else if (Services.appinfo.OS == "Darwin") { status = gfxInfo.getFeatureStatusStr("OPENGL_LAYERS"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_mismatch_DriverVersion.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_mismatch_DriverVersion.js @@ -50,7 +50,7 @@ async function run_test() { function checkBlocklist() { if (Services.appinfo.OS == "WINNT") { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); } else if (Services.appinfo.OS == "Darwin") { status = gfxInfo.getFeatureStatusStr("OPENGL_LAYERS"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_mismatch_OSVersion.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_OSVersion_mismatch_OSVersion.js @@ -51,7 +51,7 @@ async function run_test() { function checkBlocklist() { if (Services.appinfo.OS == "WINNT") { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); } else if (Services.appinfo.OS == "Darwin") { status = gfxInfo.getFeatureStatusStr("OPENGL_LAYERS"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Vendor.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Vendor.js @@ -49,7 +49,7 @@ async function run_test() { await promiseStartupManager(); function checkBlocklist() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); status = gfxInfo.getFeatureStatusStr("DIRECT3D_9_LAYERS"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Version.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_Version.js @@ -54,7 +54,7 @@ async function run_test() { var failureId = {}; var status; - status = gfxInfo.getFeatureStatusStr("DIRECT2D", failureId); + status = gfxInfo.getFeatureStatusStr("DX_NV12", failureId); Assert.equal(status, "BLOCKED_DRIVER_VERSION"); Assert.equal(failureId.value, "FEATURE_FAILURE_DL_BLOCKLIST_g1"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_prefs.js b/toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlocklist_prefs.js @@ -59,7 +59,7 @@ async function run_test() { executeSoon(ensureBlocklistSet); } function ensureBlocklistSet() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "BLOCKED_DRIVER_VERSION"); // Make sure unrelated features aren't affected @@ -67,7 +67,7 @@ async function run_test() { Assert.equal(status, "STATUS_OK"); Assert.equal( - Services.prefs.getIntPref("gfx.blacklist.direct2d"), + Services.prefs.getIntPref("gfx.blacklist.dx_nv12"), "BLOCKED_DRIVER_VERSION" ); @@ -78,7 +78,7 @@ async function run_test() { os: "WINNT 6.1", vendor: "0xabcd", devices: ["0x2783", "0x2782"], - feature: " DIRECT2D ", + feature: " DX_NV12 ", featureStatus: " BLOCKED_DRIVER_VERSION ", driverVersion: " 8.52.322.2202 ", driverVersionComparator: " LESS_THAN ", @@ -101,7 +101,7 @@ async function run_test() { executeSoon(ensureBlocklistUnset); } function ensureBlocklistUnset() { - var status = gfxInfo.getFeatureStatusStr("DIRECT2D"); + var status = gfxInfo.getFeatureStatusStr("DX_NV12"); Assert.equal(status, "STATUS_OK"); // Make sure unrelated features aren't affected @@ -110,7 +110,7 @@ async function run_test() { var exists = false; try { - Services.prefs.getIntPref("gfx.blacklist.direct2d"); + Services.prefs.getIntPref("gfx.blacklist.dx_nv12"); exists = true; } catch (e) {} diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp @@ -1001,27 +1001,6 @@ int32_t GfxInfoBase::FindBlocklistedDeviceInList( } #if defined(XP_WIN) - // As a very special case, we block D2D on machines with an NVidia 310M GPU - // as either the primary or secondary adapter. D2D is also blocked when the - // NV 310M is the primary adapter (using the standard blocklisting mechanism). - // If the primary GPU already matched something in the blocklist then we - // ignore this special rule. See bug 1008759. - if (status == nsIGfxInfo::FEATURE_STATUS_UNKNOWN && - (aFeature == nsIGfxInfo::FEATURE_DIRECT2D)) { - if (!adapterInfoFailed[1]) { - nsAString& nvVendorID = - (nsAString&)GfxDriverInfo::GetDeviceVendor(DeviceVendor::NVIDIA); - const nsString nv310mDeviceId = u"0x0A70"_ns; - if (nvVendorID.Equals(adapterVendorID[1], - nsCaseInsensitiveStringComparator) && - nv310mDeviceId.Equals(adapterDeviceID[1], - nsCaseInsensitiveStringComparator)) { - status = nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - aFailureId = "FEATURE_FAILURE_D2D_NV310M_BLOCK"; - } - } - } - // Depends on Windows driver versioning. We don't pass a GfxDriverInfo object // back to the Windows handler, so we must handle this here. if (status == FEATURE_BLOCKED_DRIVER_VERSION) { @@ -1930,10 +1909,6 @@ GfxInfoBase::GetContentBackend(nsAString& aContentBackend) { nsString outStr; switch (backend) { - case BackendType::DIRECT2D1_1: { - outStr.AppendPrintf("Direct2D 1.1"); - break; - } case BackendType::SKIA: { outStr.AppendPrintf("Skia"); break; diff --git a/widget/GfxInfoFeatureDefs.h b/widget/GfxInfoFeatureDefs.h @@ -13,8 +13,6 @@ GFXINFO_FEATURE(ALL, "ALL", "all") /* Wildcard to block all optional features, starting in 123. */ GFXINFO_FEATURE(OPTIONAL, "OPTIONAL", "optional") -/* Whether Direct2D is supported for content rendering, always present. */ -GFXINFO_FEATURE(DIRECT2D, "DIRECT2D", "direct2d") /* Whether Direct3D 9 is supported for layers, always present. */ GFXINFO_FEATURE(DIRECT3D_9_LAYERS, "DIRECT3D_9_LAYERS", "layers.direct3d9") /* Whether Direct3D 10.0 is supported for layers, always present. */ diff --git a/widget/android/GfxInfo.cpp b/widget/android/GfxInfo.cpp @@ -136,11 +136,6 @@ GfxInfo::GfxInfo() GfxInfo::~GfxInfo() {} -/* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after - * gfxPlatform initialization has occurred because they depend on it for - * information. (See bug 591561) */ -nsresult GfxInfo::GetD2DEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } - nsresult GfxInfo::GetDWriteEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } nsresult GfxInfo::GetHasBattery(bool* aHasBattery) { diff --git a/widget/android/GfxInfo.h b/widget/android/GfxInfo.h @@ -27,7 +27,6 @@ class GfxInfo : public GfxInfoBase { // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override; NS_IMETHOD GetEmbeddedInFirefoxReality( diff --git a/widget/cocoa/GfxInfo.h b/widget/cocoa/GfxInfo.h @@ -20,7 +20,6 @@ class GfxInfo : public GfxInfoBase { GfxInfo(); // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override; NS_IMETHOD GetEmbeddedInFirefoxReality( diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm @@ -244,9 +244,6 @@ nsresult GfxInfo::Init() { } NS_IMETHODIMP -GfxInfo::GetD2DEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } - -NS_IMETHODIMP GfxInfo::GetDWriteEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } /* readonly attribute bool HasBattery; */ diff --git a/widget/gtk/GfxInfo.cpp b/widget/gtk/GfxInfo.cpp @@ -1415,9 +1415,6 @@ nsresult GfxInfo::GetFeatureStatusImpl( } NS_IMETHODIMP -GfxInfo::GetD2DEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } - -NS_IMETHODIMP GfxInfo::GetDWriteEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } NS_IMETHODIMP diff --git a/widget/gtk/GfxInfo.h b/widget/gtk/GfxInfo.h @@ -18,7 +18,6 @@ class GfxInfo final : public GfxInfoBase { public: // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override; NS_IMETHOD GetEmbeddedInFirefoxReality( diff --git a/widget/metrics.yaml b/widget/metrics.yaml @@ -123,40 +123,6 @@ gfx.features: - gfx-telemetry-alerts@mozilla.com expires: never - d2d: - type: object - lifetime: application - description: | - (Windows-only) information about the D2D compositor. - * status - One of - * "unused" - This feature has not been requested. - * "unavailable" - Safe Mode or OS restriction prevents use. - * "blocked" - An internal condition (such as safe mode) prevents use. - * "blocklisted" - Blocked due to a blocklist restriction. - * "denied" - Blocked due to allowlist restrictions. - * "disabled" - User explicitly disabled this default feature. - * "failed" - Feature failed to initialize. - * "available" - User has this feature available by default. - optionally including ":" followed by a reason - e.g. "FEATURE_FAILURE_WEBRENDER_VIDEO_CRASH_INTEL_23.20.16.4973". - * version - The feature version, either "1.0" or "1.1" - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1950412 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1950412 - data_sensitivity: - - technical - structure: - type: object - properties: - status: - type: string - version: - type: string - notification_emails: - - gfx-telemetry-alerts@mozilla.com - expires: never - hw_compositing: &basic_gfx_feature type: object lifetime: application @@ -269,21 +235,6 @@ gfx.features: optionally including ":" followed by a reason e.g. "FEATURE_FAILURE_WEBRENDER_VIDEO_CRASH_INTEL_23.20.16.4973". gfx: - d2d_enabled: - type: boolean - lifetime: application - description: | - Whether Direct2D is enabled. (Windows-only) - bugs: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1950411 - data_reviews: - - https://bugzilla.mozilla.org/show_bug.cgi?id=1950411 - data_sensitivity: - - technical - notification_emails: - - gfx-telemetry-alerts@mozilla.com - expires: never - dwrite_enabled: type: boolean lifetime: application diff --git a/widget/nsIGfxInfo.idl b/widget/nsIGfxInfo.idl @@ -13,7 +13,6 @@ interface nsIGfxInfo : nsISupports /* * These are win32-specific */ - readonly attribute boolean D2DEnabled; readonly attribute boolean DWriteEnabled; readonly attribute boolean EmbeddedInFirefoxReality; readonly attribute AString AzureCanvasBackend; @@ -136,7 +135,7 @@ interface nsIGfxInfo : nsISupports #undef GFXINFO_FEATURE FEATURE_COUNT, /* This must be the first value after INVALID/ALL/OPTIONAL. */ - FEATURE_START = FEATURE_DIRECT2D + FEATURE_START = FEATURE_DIRECT3D_9_LAYERS }; /* diff --git a/widget/uikit/GfxInfo.cpp b/widget/uikit/GfxInfo.cpp @@ -18,9 +18,6 @@ GfxInfo::GfxInfo() {} GfxInfo::~GfxInfo() {} NS_IMETHODIMP -GfxInfo::GetD2DEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } - -NS_IMETHODIMP GfxInfo::GetDWriteEnabled(bool* aEnabled) { return NS_ERROR_FAILURE; } NS_IMETHODIMP diff --git a/widget/uikit/GfxInfo.h b/widget/uikit/GfxInfo.h @@ -32,7 +32,6 @@ class GfxInfo : public GfxInfoBase { // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; NS_IMETHOD GetEmbeddedInFirefoxReality( bool* aEmbeddedInFirefoxReality) override; diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp @@ -46,24 +46,6 @@ static void AssertNotWin32kLockdown() { "Invalid Windows GfxInfo API with Win32k lockdown"); } -/* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after - * gfxPlatform initialization has occurred because they depend on it for - * information. (See bug 591561) */ -nsresult GfxInfo::GetD2DEnabled(bool* aEnabled) { - // Telemetry queries this during XPCOM initialization, and there's no - // gfxPlatform by then. Just bail out if gfxPlatform isn't initialized. - if (!gfxPlatform::Initialized()) { - *aEnabled = false; - return NS_OK; - } - - // We check gfxConfig rather than the actual render mode, since the UI - // process does not use Direct2D if the GPU process is enabled. However, - // content processes can still use Direct2D. - *aEnabled = gfx::gfxConfig::IsEnabled(gfx::Feature::DIRECT2D); - return NS_OK; -} - nsresult GfxInfo::GetDWriteEnabled(bool* aEnabled) { *aEnabled = gfxWindowsPlatform::GetPlatform()->DWriteEnabled(); return NS_OK; @@ -534,7 +516,7 @@ nsresult GfxInfo::Init() { // On Windows 8 and Server 2012 hosts, we want to not block RDP // sessions from attempting hardware acceleration. RemoteFX // provides features and functionaltiy that can give a good D3D10 + - // D2D + DirectWrite experience emulated via a software GPU. + // DirectWrite experience emulated via a software GPU. // // Unfortunately, the Device ID is nullptr, and we can't enumerate // it using the setup infrastructure (SetupDiGetClassDevsW below @@ -1374,42 +1356,6 @@ const nsTArray<RefPtr<GfxDriverInfo>>& GfxInfo::GetGfxDriverInfo() { nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, \ DRIVER_LESS_THAN, driverVer, ruleId) -#define IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(winVer, devFamily, driverVer, \ - ruleId) \ - APPEND_TO_DRIVER_BLOCKLIST2(winVer, devFamily, nsIGfxInfo::FEATURE_DIRECT2D, \ - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, \ - DRIVER_BUILD_ID_LESS_THAN, driverVer, ruleId) - - IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, - DeviceFamily::IntelGMA500, 2026, - "FEATURE_FAILURE_594877_7"); - IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D( - OperatingSystem::Windows7, DeviceFamily::IntelGMA900, - GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_594877_8"); - IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, - DeviceFamily::IntelGMA950, 1930, - "FEATURE_FAILURE_594877_9"); - IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, - DeviceFamily::IntelGMA3150, 2117, - "FEATURE_FAILURE_594877_10"); - IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D(OperatingSystem::Windows7, - DeviceFamily::IntelGMAX3000, 1930, - "FEATURE_FAILURE_594877_11"); - IMPLEMENT_INTEL_DRIVER_BLOCKLIST_D2D( - OperatingSystem::Windows7, DeviceFamily::IntelHDGraphicsToSandyBridge, - 2202, "FEATURE_FAILURE_594877_12"); - - /* Disable Direct2D on Intel GMAX4500 devices because of rendering - * corruption discovered in bug 1180379. These seems to affect even the most - * recent drivers. We're black listing all of the devices to be safe even - * though we've only confirmed the issue on the G45 - */ - APPEND_TO_DRIVER_BLOCKLIST2( - OperatingSystem::Windows, DeviceFamily::IntelGMAX4500HD, - nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, - DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, - "FEATURE_FAILURE_1180379"); - IMPLEMENT_INTEL_DRIVER_BLOCKLIST( OperatingSystem::Windows7, DeviceFamily::IntelGMA500, V(5, 0, 0, 2026), "FEATURE_FAILURE_INTEL_16"); @@ -1463,16 +1409,6 @@ const nsTArray<RefPtr<GfxDriverInfo>>& GfxInfo::GetGfxDriverInfo() { "FEATURE_FAILURE_BUG_1018278", "X.X.X.2342"); /** - * Disable D2D on Win7 on Intel Haswell for graphics drivers build id <= - * 4578. See bug 1432610 - */ - APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Windows7, - DeviceFamily::IntelHaswell, - nsIGfxInfo::FEATURE_DIRECT2D, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_BUILD_ID_LESS_THAN_OR_EQUAL, 4578, - "FEATURE_FAILURE_BUG_1432610"); - /** * Disable VP8 HW decoding on Windows 8.1 on Intel Haswel and a certain * driver version. See bug 1760464 comment 6 and bug 1761332. */ @@ -1487,33 +1423,6 @@ const nsTArray<RefPtr<GfxDriverInfo>>& GfxInfo::GetGfxDriverInfo() { nsIGfxInfo::FEATURE_VP8_HW_DECODE, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_EQUAL, V(10, 18, 14, 4264), "FEATURE_FAILURE_BUG_1761332"); - /* Disable D2D on Win7 on Intel HD Graphics on driver <= 8.15.10.2302 - * See bug 806786 - */ - APPEND_TO_DRIVER_BLOCKLIST2( - OperatingSystem::Windows7, DeviceFamily::IntelMobileHDGraphics, - nsIGfxInfo::FEATURE_DIRECT2D, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN_OR_EQUAL, - V(8, 15, 10, 2302), "FEATURE_FAILURE_BUG_806786"); - - /* Disable D2D on Win8 on Intel HD Graphics on driver <= 8.15.10.2302 - * See bug 804144 and 863683 - */ - APPEND_TO_DRIVER_BLOCKLIST2( - OperatingSystem::Windows8, DeviceFamily::IntelMobileHDGraphics, - nsIGfxInfo::FEATURE_DIRECT2D, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN_OR_EQUAL, - V(8, 15, 10, 2302), "FEATURE_FAILURE_BUG_804144"); - - /* Disable D2D on Win7 on Intel HD Graphics on driver == 8.15.10.2418 - * See bug 1433790 - */ - APPEND_TO_DRIVER_BLOCKLIST2( - OperatingSystem::Windows7, DeviceFamily::IntelHDGraphicsToSandyBridge, - nsIGfxInfo::FEATURE_DIRECT2D, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_EQUAL, - V(8, 15, 10, 2418), "FEATURE_FAILURE_BUG_1433790"); - /* Disable D3D11 layers on Intel G41 express graphics and Intel GM965, Intel * X3100, for causing device resets. See bug 1116812. */ @@ -1524,25 +1433,13 @@ const nsTArray<RefPtr<GfxDriverInfo>>& GfxInfo::GetGfxDriverInfo() { GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_BUG_1116812"); /* Disable D3D11 layers on Intel GMA 3150 for failing to allocate a shared - * handle for textures. See bug 1207665. Additionally block D2D so we don't - * accidentally use WARP. + * handle for textures. See bug 1207665. */ APPEND_TO_DRIVER_BLOCKLIST2( OperatingSystem::Windows, DeviceFamily::Bug1207665, nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_BUG_1207665_1"); - APPEND_TO_DRIVER_BLOCKLIST2( - OperatingSystem::Windows, DeviceFamily::Bug1207665, - nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, - DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, - "FEATURE_FAILURE_BUG_1207665_2"); - - APPEND_TO_DRIVER_BLOCKLIST2( - OperatingSystem::Windows10or11, DeviceFamily::QualcommAll, - nsIGfxInfo::FEATURE_DIRECT2D, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, - GfxDriverInfo::allDriverVersions, "FEATURE_FAILURE_QUALCOMM"); // Bug 1548410. Disable hardware accelerated video decoding on // Qualcomm drivers used on Windows on ARM64 which are known to @@ -1554,16 +1451,6 @@ const nsTArray<RefPtr<GfxDriverInfo>>& GfxInfo::GetGfxDriverInfo() { nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN_OR_EQUAL, V(25, 18, 10440, 0), "FEATURE_FAILURE_BUG_1592826"); - /* Disable D2D on AMD Catalyst 14.4 until 14.6 - * See bug 984488 - */ - APPEND_TO_DRIVER_BLOCKLIST_RANGE( - OperatingSystem::Windows, DeviceFamily::AtiAll, - nsIGfxInfo::FEATURE_DIRECT2D, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_BETWEEN_INCLUSIVE_START, V(14, 1, 0, 0), V(14, 2, 0, 0), - "FEATURE_FAILURE_BUG_984488_1", "ATI Catalyst 14.6+"); - /* Disable D3D9 layers on NVIDIA 6100/6150/6200 series due to glitches * whilst scrolling. See bugs: 612007, 644787 & 645872. */ @@ -1580,13 +1467,6 @@ const nsTArray<RefPtr<GfxDriverInfo>>& GfxInfo::GetGfxDriverInfo() { nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, V(6, 2, 0, 0), "< 6.2.0.0", "FEATURE_FAILURE_REMOTE_FX"); - /* Bug 1008759: Optimus (NVidia) crash. Disable D2D on NV 310M. */ - APPEND_TO_DRIVER_BLOCKLIST2( - OperatingSystem::Windows, DeviceFamily::Nvidia310M, - nsIGfxInfo::FEATURE_DIRECT2D, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, - DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions, - "FEATURE_FAILURE_BUG_1008759"); - /* Bug 1139503: DXVA crashes with ATI cards on windows 10. */ APPEND_TO_DRIVER_BLOCKLIST2( OperatingSystem::Windows10or11, DeviceFamily::AtiAll, @@ -2095,10 +1975,6 @@ void GfxInfo::DescribeFeatures(JSContext* aCx, JS::Handle<JSObject*> aObj) { JS_SetProperty(aCx, obj, "blocklisted", val); } - gfx::FeatureState& d2d = gfxConfig::GetFeature(Feature::DIRECT2D); - if (!InitFeatureObject(aCx, aObj, "d2d", d2d, &obj)) { - return; - } { const char* version = "1.1"; JS::Rooted<JSString*> str(aCx, JS_NewStringCopyZ(aCx, version)); diff --git a/widget/windows/GfxInfo.h b/widget/windows/GfxInfo.h @@ -22,7 +22,6 @@ class GfxInfo : public GfxInfoBase { // We only declare the subset of nsIGfxInfo that we actually implement. The // rest is brought forward from GfxInfoBase. - NS_IMETHOD GetD2DEnabled(bool* aD2DEnabled) override; NS_IMETHOD GetDWriteEnabled(bool* aDWriteEnabled) override; NS_IMETHOD GetDWriteVersion(nsAString& aDwriteVersion) override; NS_IMETHOD GetEmbeddedInFirefoxReality(