Chromium Code Reviews| Index: cc/output/overlay_strategy_single_on_top.cc |
| diff --git a/cc/output/overlay_strategy_single_on_top.cc b/cc/output/overlay_strategy_single_on_top.cc |
| index f55a4350d6a327c053669b89ab78ce97401dc0ed..30fd0174fc3aaec2a1611d707335d66261e0a8ac 100644 |
| --- a/cc/output/overlay_strategy_single_on_top.cc |
| +++ b/cc/output/overlay_strategy_single_on_top.cc |
| @@ -7,10 +7,15 @@ |
| #include "cc/base/math_util.h" |
| #include "cc/output/overlay_candidate_validator.h" |
| #include "cc/quads/draw_quad.h" |
| +#include "ui/gfx/buffer_types.h" |
| #include "ui/gfx/geometry/rect_conversions.h" |
| namespace cc { |
|
reveman
2017/03/16 04:57:34
nit: remove blank line
Daniele Castagna
2017/03/16 05:04:20
Done.
|
| +namespace { |
| +const gfx::BufferFormat kOverlayFormatsWithAlpha[] = { |
|
reveman
2017/03/16 04:57:34
nit: add blank line before this
Daniele Castagna
2017/03/16 05:04:20
Done.
|
| + gfx::BufferFormat::RGBA_8888, gfx::BufferFormat::BGRA_8888}; |
| +} |
|
reveman
2017/03/16 04:57:34
nit: add blank line after this :)
Daniele Castagna
2017/03/16 05:04:20
Done.
|
| OverlayStrategySingleOnTop::OverlayStrategySingleOnTop( |
| OverlayCandidateValidator* capability_checker) |
| : capability_checker_(capability_checker) { |
| @@ -34,6 +39,17 @@ bool OverlayStrategySingleOnTop::Attempt( |
| // TODO(dcastagna): Remove this once drm platform supports transforms. |
| candidate.transform == gfx::OVERLAY_TRANSFORM_NONE && |
| !OverlayCandidate::IsOccluded(candidate, quad_list->cbegin(), it)) { |
| + // We currently reject quads with alpha that do not request alpha blending |
| + // since the alpha channel might not be set to 1 and we're not disabling |
| + // blending when scanning out. |
| + // TODO(dcastagna): We should support alpha formats without blending using |
| + // the opaque FB at scanout. |
| + if (std::find(std::begin(kOverlayFormatsWithAlpha), |
| + std::end(kOverlayFormatsWithAlpha), |
| + candidate.format) != std::end(kOverlayFormatsWithAlpha) && |
| + it->shared_quad_state->blend_mode == SkBlendMode::kSrc) |
| + continue; |
| + |
| if (candidate.display_rect.size().GetArea() > |
| best_candidate.display_rect.size().GetArea()) { |
| best_candidate = candidate; |