Commit 0a61eede authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Force DC overlay for hardware protected video with any blend mode

For protected video, it must be protected and decoded by hardware through
Direct Composition overlay swap chain. It's fine if the blend mode is not
handled correctly.

Bug:843814

Change-Id: I07c3ed40716fd9979f3f83c395a593fa1f0b5dd5
Reviewed-on: https://chromium-review.googlesource.com/c/1357647Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612921}
parent 404d04e5
...@@ -121,8 +121,6 @@ DCLayerOverlayProcessor::DCLayerResult DCLayerOverlayProcessor::FromDrawQuad( ...@@ -121,8 +121,6 @@ DCLayerOverlayProcessor::DCLayerResult DCLayerOverlayProcessor::FromDrawQuad(
QuadList::ConstIterator quad_list_begin, QuadList::ConstIterator quad_list_begin,
QuadList::ConstIterator quad, QuadList::ConstIterator quad,
DCLayerOverlay* dc_layer_overlay) { DCLayerOverlay* dc_layer_overlay) {
if (quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver)
return DC_LAYER_FAILED_QUAD_BLEND_MODE;
DCLayerResult result; DCLayerResult result;
switch (quad->material) { switch (quad->material) {
...@@ -137,6 +135,12 @@ DCLayerOverlayProcessor::DCLayerResult DCLayerOverlayProcessor::FromDrawQuad( ...@@ -137,6 +135,12 @@ DCLayerOverlayProcessor::DCLayerResult DCLayerOverlayProcessor::FromDrawQuad(
if (result != DC_LAYER_SUCCESS) if (result != DC_LAYER_SUCCESS)
return result; return result;
// Hardware protected video must use Direct Composition Overlay
if (quad->shared_quad_state->blend_mode != SkBlendMode::kSrcOver &&
dc_layer_overlay->protected_video_type !=
ui::ProtectedVideoType::kHardwareProtected)
return DC_LAYER_FAILED_QUAD_BLEND_MODE;
// To support software protected video on machines without hardware overlay // To support software protected video on machines without hardware overlay
// capability. Don't do dc layer overlay if no hardware support. // capability. Don't do dc layer overlay if no hardware support.
if (!has_hw_overlay_support_ && if (!has_hw_overlay_support_ &&
......
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