#include "components/viz/service/display/overlay_processor_delegated.h"
#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/viz/common/features.h"
#include "components/viz/common/viz_utils.h"
#include "components/viz/service/debugger/viz_debugger.h"
#include "components/viz/service/display/display_resource_provider.h"
#include "components/viz/service/display/output_surface.h"
#include "components/viz/service/display/overlay_candidate.h"
#include "components/viz/service/display/overlay_candidate_factory.h"
#include "components/viz/service/display/overlay_processor_delegated_support.h"
#include "components/viz/service/display/overlay_processor_interface.h"
#include "gpu/command_buffer/client/shared_image_interface.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/transform.h"
#include "ui/ozone/public/overlay_manager_ozone.h"
#include "ui/ozone/public/ozone_platform.h"
namespace {
DBG_FLAG_FBOOL("delegated.fd.usage", usage_every_frame)
void RecordFDUsageUMA() { … }
constexpr int kCopyRequestBlockFrames = …;
}
namespace viz {
OverlayProcessorDelegated::OverlayProcessorDelegated(
std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates,
std::vector<OverlayStrategy> available_strategies,
gpu::SharedImageInterface* shared_image_interface)
: … { … }
OverlayProcessorDelegated::~OverlayProcessorDelegated() = default;
DBG_FLAG_FBOOL("delegated.enable.quad_split", quad_split)
bool OverlayProcessorDelegated::DisableSplittingQuads() const { … }
constexpr size_t kTooManyQuads = …;
bool OverlayProcessorDelegated::AttemptWithStrategies(
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,
OverlayProcessorInterface::OutputSurfaceOverlayPlane* primary_plane,
OverlayCandidateList* candidates,
std::vector<gfx::Rect>* content_bounds) { … }
gfx::RectF OverlayProcessorDelegated::GetPrimaryPlaneDisplayRect(
const OverlayProcessorInterface::OutputSurfaceOverlayPlane* primary_plane) { … }
void OverlayProcessorDelegated::ProcessForOverlays(
DisplayResourceProvider* resource_provider,
AggregatedRenderPassList* render_passes,
const SkM44& output_color_matrix,
const OverlayProcessorInterface::FilterOperationsMap& render_pass_filters,
const OverlayProcessorInterface::FilterOperationsMap&
render_pass_backdrop_filters,
SurfaceDamageRectList surface_damage_rect_list,
OutputSurfaceOverlayPlane* output_surface_plane,
CandidateList* candidates,
gfx::Rect* damage_rect,
std::vector<gfx::Rect>* content_bounds) { … }
void OverlayProcessorDelegated::AdjustOutputSurfaceOverlay(
std::optional<OutputSurfaceOverlayPlane>* output_surface_plane) { … }
gfx::RectF OverlayProcessorDelegated::GetUnassignedDamage() const { … }
bool OverlayProcessorDelegated::BlockForCopyRequests(
const AggregatedRenderPassList* render_pass_list) { … }
}