Commit 9a54665a authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Remove unused UseDCOverlaysForSoftwareProtectedVideo feature.

The way this is implemented will lead to overlays being enabled on
paths where a blacklist may be applied. The variable names are
changed to make it clear that this affects all overlay support, not
just hardware ones.

R=sunnyps, zmo

Bug: 906722, 1056267
Change-Id: I25ae0e465376f1cb9d19b279b7498802021a23fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2176269Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: default avatarMaggie Chen <magchen@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#765332}
parent 7bf37ef4
......@@ -69,18 +69,12 @@ gfx::RectF ClippedQuadRectangle(const DrawQuad* quad) {
DCLayerResult ValidateYUVQuad(
const YUVVideoDrawQuad* quad,
const std::vector<gfx::Rect>& backdrop_filter_rects,
bool has_hw_overlay_support,
bool has_overlay_support,
int current_frame_processed_overlay_count,
DisplayResourceProvider* resource_provider) {
// To support software protected video on machines without hardware overlay
// capability. Don't do dc layer overlay if no hardware support.
gfx::ProtectedVideoType protected_video_type = quad->protected_video_type;
bool allow_video_overlay =
has_hw_overlay_support ||
(protected_video_type == gfx::ProtectedVideoType::kSoftwareProtected &&
base::FeatureList::IsEnabled(
features::kUseDCOverlaysForSoftwareProtectedVideo));
if (!allow_video_overlay)
// Note: Do not override this value based on base::Feature values. It is the
// result after the GPU blacklist has been consulted.
if (!has_overlay_support)
return DC_LAYER_FAILED_UNSUPPORTED_QUAD;
// Check that resources are overlay compatible first so that subsequent
......@@ -91,29 +85,30 @@ DCLayerResult ValidateYUVQuad(
}
// Hardware protected video must use Direct Composition Overlay
if (protected_video_type != gfx::ProtectedVideoType::kHardwareProtected) {
if (quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver)
return DC_LAYER_FAILED_QUAD_BLEND_MODE;
bool is_axis_aligned = quad->shared_quad_state->quad_to_target_transform
.Preserves2dAxisAlignment();
if (!is_axis_aligned && !base::FeatureList::IsEnabled(
features::kDirectCompositionComplexOverlays)) {
return DC_LAYER_FAILED_COMPLEX_TRANSFORM;
}
if (quad->protected_video_type == gfx::ProtectedVideoType::kHardwareProtected)
return DC_LAYER_SUCCESS;
if (quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver)
return DC_LAYER_FAILED_QUAD_BLEND_MODE;
if (current_frame_processed_overlay_count > 0)
return DC_LAYER_FAILED_TOO_MANY_OVERLAYS;
bool is_axis_aligned = quad->shared_quad_state->quad_to_target_transform
.Preserves2dAxisAlignment();
if (!is_axis_aligned && !base::FeatureList::IsEnabled(
features::kDirectCompositionComplexOverlays)) {
return DC_LAYER_FAILED_COMPLEX_TRANSFORM;
}
// Rounded corner on overlays are not supported.
if (!quad->shared_quad_state->rounded_corner_bounds.IsEmpty())
return DC_LAYER_FAILED_ROUNDED_CORNERS;
if (current_frame_processed_overlay_count > 0)
return DC_LAYER_FAILED_TOO_MANY_OVERLAYS;
auto quad_target_rect = gfx::ToEnclosingRect(ClippedQuadRectangle(quad));
for (const auto& filter_target_rect : backdrop_filter_rects) {
if (filter_target_rect.Intersects(quad_target_rect))
return DC_LAYER_FAILED_BACKDROP_FILTERS;
}
// Rounded corner on overlays are not supported.
if (!quad->shared_quad_state->rounded_corner_bounds.IsEmpty())
return DC_LAYER_FAILED_ROUNDED_CORNERS;
auto quad_target_rect = gfx::ToEnclosingRect(ClippedQuadRectangle(quad));
for (const auto& filter_target_rect : backdrop_filter_rects) {
if (filter_target_rect.Intersects(quad_target_rect))
return DC_LAYER_FAILED_BACKDROP_FILTERS;
}
return DC_LAYER_SUCCESS;
......@@ -348,7 +343,7 @@ DCLayerOverlayProcessor::DCLayerOverlayProcessor(
}
DCLayerOverlayProcessor::DCLayerOverlayProcessor()
: has_hw_overlay_support_(true), show_debug_borders_(false) {}
: has_overlay_support_(true), show_debug_borders_(false) {}
DCLayerOverlayProcessor::~DCLayerOverlayProcessor() {
ui::GpuSwitchingManager::GetInstance()->RemoveObserver(this);
......@@ -357,7 +352,7 @@ DCLayerOverlayProcessor::~DCLayerOverlayProcessor() {
// Called on the Viz Compositor thread
void DCLayerOverlayProcessor::UpdateHasHwOverlaySupport() {
DCHECK(viz_task_runner_->BelongsToCurrentThread());
has_hw_overlay_support_ = gl::AreOverlaysSupportedWin();
has_overlay_support_ = gl::AreOverlaysSupportedWin();
}
// Not on the Viz Compositor thread
......@@ -581,7 +576,7 @@ void DCLayerOverlayProcessor::ProcessRenderPass(
result = ValidateYUVQuad(
YUVVideoDrawQuad::MaterialCast(*it),
render_pass_data_[render_pass->id].backdrop_filter_rects,
has_hw_overlay_support_, current_frame_processed_overlay_count_,
has_overlay_support_, current_frame_processed_overlay_count_,
resource_provider);
break;
case DrawQuad::Material::kTextureContent:
......
......@@ -145,7 +145,7 @@ class VIZ_SERVICE_EXPORT DCLayerOverlayProcessor
RenderPass* root_render_pass,
gfx::Rect* damage_rect);
bool has_hw_overlay_support_;
bool has_overlay_support_;
const bool show_debug_borders_;
gfx::Rect previous_frame_underlay_rect_;
......
......@@ -85,12 +85,6 @@ const base::Feature kMetal{"Metal", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSharedImageManager{"SharedImageManager",
base::FEATURE_DISABLED_BY_DEFAULT};
// For Windows only. Use overlay swapchain to present software protected videos
// for all GPUs
const base::Feature kUseDCOverlaysForSoftwareProtectedVideo{
"UseDCOverlaysForSoftwareProtectedVideo",
base::FEATURE_DISABLED_BY_DEFAULT};
// Controls the decode acceleration of JPEG images (as opposed to camera
// captures) in Chrome OS using the VA-API.
// TODO(andrescj): remove or enable by default in Chrome OS once
......
......@@ -44,8 +44,6 @@ GPU_EXPORT extern const base::Feature kMetal;
GPU_EXPORT extern const base::Feature kSharedImageManager;
GPU_EXPORT extern const base::Feature kUseDCOverlaysForSoftwareProtectedVideo;
GPU_EXPORT extern const base::Feature kVaapiJpegImageDecodeAcceleration;
GPU_EXPORT extern const base::Feature kVaapiWebPImageDecodeAcceleration;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment