#include "components/viz/service/display/overlay_strategy_single_on_top.h"
#include <vector>
#include "base/check_op.h"
#include "components/viz/common/display/overlay_strategy.h"
#include "components/viz/common/quads/draw_quad.h"
#include "components/viz/common/quads/texture_draw_quad.h"
#include "components/viz/service/display/overlay_candidate.h"
#include "components/viz/service/display/overlay_candidate_factory.h"
#include "components/viz/service/display/overlay_proposed_candidate.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/geometry/rect_conversions.h"
namespace viz {
namespace {
OverlayProposedCandidateIndex;
bool CalculateOcclusionByRoundedDisplayMaskCandidate(
OverlayProposedCandidate& candidate_with_display_masks,
std::vector<OverlayProposedCandidate>* candidates,
OverlayProposedCandidateIndex single_on_top_candidates_begin,
OverlayProposedCandidateIndex single_on_top_candidates_end) { … }
}
OverlayStrategySingleOnTop::OverlayStrategySingleOnTop(
OverlayProcessorUsingStrategy* capability_checker)
: … { … }
OverlayStrategySingleOnTop::~OverlayStrategySingleOnTop() = default;
void OverlayStrategySingleOnTop::Propose(
const SkM44& output_color_matrix,
const OverlayProcessorInterface::FilterOperationsMap& render_pass_filters,
const OverlayProcessorInterface::FilterOperationsMap&
render_pass_backdrop_filters,
const DisplayResourceProvider* resource_provider,
AggregatedRenderPassList* render_pass_list,
SurfaceDamageRectList* surface_damage_rect_list,
const PrimaryPlane* primary_plane,
std::vector<OverlayProposedCandidate>* candidates,
std::vector<gfx::Rect>* content_bounds) { … }
bool OverlayStrategySingleOnTop::Attempt(
const SkM44& output_color_matrix,
const OverlayProcessorInterface::FilterOperationsMap& render_pass_filters,
const OverlayProcessorInterface::FilterOperationsMap&
render_pass_backdrop_filters,
const DisplayResourceProvider* resource_provider,
AggregatedRenderPassList* render_pass_list,
SurfaceDamageRectList* surface_damage_rect_list,
const PrimaryPlane* primary_plane,
OverlayCandidateList* candidate_list,
std::vector<gfx::Rect>* content_bounds,
const OverlayProposedCandidate& proposed_candidate) { … }
bool OverlayStrategySingleOnTop::TryOverlay(
AggregatedRenderPass* render_pass,
const PrimaryPlane* primary_plane,
OverlayCandidateList* candidate_list,
const OverlayProposedCandidate& proposed_candidate) { … }
void OverlayStrategySingleOnTop::CommitCandidate(
const OverlayProposedCandidate& proposed_candidate,
AggregatedRenderPass* render_pass) { … }
OverlayStrategy OverlayStrategySingleOnTop::GetUMAEnum() const { … }
}