Commit 15eeb8d2 authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

cc: Promote opaque RGBA/BGRA overlays

We used not to promote to overlays RGBA/BGRA quads requiring
no alpha blending, since we didn't have way of disabling alpha blending
at scanout time.

crrev.com/c/967415 introduced a way of controlling alpha blending
at scanout, that uses is_opaque flag in the overlay candidate,
that is already set correctly.
This patch removes the old check that avoided scanning out overlays
that reuqired to switch off alpha blending.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: I0015a20a27127179703d26be8dc5336febc5aac4
Reviewed-on: https://chromium-review.googlesource.com/976553Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545532}
parent 43287799
...@@ -9,11 +9,6 @@ ...@@ -9,11 +9,6 @@
#include "ui/gfx/geometry/rect_conversions.h" #include "ui/gfx/geometry/rect_conversions.h"
namespace viz { namespace viz {
namespace {
const gfx::BufferFormat kOverlayFormatsWithAlpha[] = {
gfx::BufferFormat::RGBA_8888, gfx::BufferFormat::BGRA_8888};
}
OverlayStrategySingleOnTop::OverlayStrategySingleOnTop( OverlayStrategySingleOnTop::OverlayStrategySingleOnTop(
OverlayCandidateValidator* capability_checker) OverlayCandidateValidator* capability_checker)
...@@ -38,17 +33,6 @@ bool OverlayStrategySingleOnTop::Attempt( ...@@ -38,17 +33,6 @@ bool OverlayStrategySingleOnTop::Attempt(
if (cc::OverlayCandidate::FromDrawQuad( if (cc::OverlayCandidate::FromDrawQuad(
resource_provider, output_color_matrix, *it, &candidate) && resource_provider, output_color_matrix, *it, &candidate) &&
!cc::OverlayCandidate::IsOccluded(candidate, quad_list->cbegin(), it)) { !cc::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() > if (candidate.display_rect.size().GetArea() >
best_candidate.display_rect.size().GetArea()) { best_candidate.display_rect.size().GetArea()) {
best_candidate = candidate; best_candidate = candidate;
......
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