diff --git a/gfx/config/gfxFeature.h b/gfx/config/gfxFeature.h index d32daad4d984..3811ce2a1199 100644 --- a/gfx/config/gfxFeature.h +++ b/gfx/config/gfxFeature.h @@ -40,6 +40,7 @@ namespace gfx { _(DMABUF, Feature, "DMABUF") \ _(WINDOW_OCCLUSION, Feature, "WINDOW_OCCLUSION") \ _(VAAPI, Feature, "VA-API video decoding") \ + _(VIDEO_OVERLAY, Feature, "video overlay") \ /* Add new entries above this comment */ enum class Feature : uint32_t { diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 9b982f1c42ea..249acb401139 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2654,13 +2654,22 @@ void gfxPlatform::InitWebRenderConfig() { if (StaticPrefs::gfx_webrender_software_d3d11_AtStartup()) { gfxVars::SetAllowSoftwareWebRenderD3D11(true); } + + bool useVideoOverlay = false; if (StaticPrefs::gfx_webrender_dcomp_video_overlay_win_AtStartup()) { if (IsWin10AnniversaryUpdateOrLater() && gfxConfig::IsEnabled(Feature::WEBRENDER_COMPOSITOR)) { MOZ_ASSERT(gfxConfig::IsEnabled(Feature::WEBRENDER_DCOMP_PRESENT)); - gfxVars::SetUseWebRenderDCompVideoOverlayWin(true); + useVideoOverlay = true; } } + + if (useVideoOverlay) { + FeatureState& feature = gfxConfig::GetFeature(Feature::VIDEO_OVERLAY); + feature.EnableByDefault(); + gfxVars::SetUseWebRenderDCompVideoOverlayWin(true); + } + if (Preferences::GetBool("gfx.webrender.flip-sequential", false)) { if (UseWebRender() && gfxVars::UseWebRenderANGLE()) { gfxVars::SetUseWebRenderFlipSequentialWin(true);