Bug 1758865 - Add Feature::VIDEO_OVERLAY r=gfx-reviewers,lsalzman

With Feature::VIDEO_OVERLAY, we could know if video overlay is enabled from about:support.

Differential Revision: https://phabricator.services.mozilla.com/D140706
This commit is contained in:
sotaro 2022-03-10 23:58:18 +00:00
parent 8df33a3b36
commit c7c684492c
2 changed files with 11 additions and 1 deletions

View File

@ -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 {

View File

@ -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);