Bug 1688096 - Part 2. Add flag to CompositorOptions to allow SW-WR on a per widget basis. r=mattwoodrow

The pref gfx.webrender.software.unaccelerated-widget.allow may be used
to allow software WebRender to be used with new windows/popups that have
transparency on Windows. Otherwise they would fallback to basic layers.

Similarly, the pref gfx.webrender.software.unaccelerated-widget.force
may be used to force software WebRender for all windows that would
fallback to basic layers.

Differential Revision: https://phabricator.services.mozilla.com/D104855
This commit is contained in:
Andrew Osmond
2021-02-24 19:40:00 +00:00
parent 1d19fa73aa
commit 293ca6b311
9 changed files with 80 additions and 11 deletions

View File

@@ -38,7 +38,7 @@ RenderCompositorD3D11SWGL::GetUploadMode() {
UniquePtr<RenderCompositor> RenderCompositorD3D11SWGL::Create(
RefPtr<widget::CompositorWidget>&& aWidget, nsACString& aError) {
if (!StaticPrefs::gfx_webrender_software_d3d11_AtStartup() ||
if (!aWidget->GetCompositorOptions().AllowSoftwareWebRenderD3D11() ||
!gfx::gfxConfig::IsEnabled(gfx::Feature::D3D11_COMPOSITING)) {
return nullptr;
}