#include "components/viz/service/display/occlusion_culler.h"
#include <algorithm>
#include "cc/base/math_util.h"
#include "cc/base/region.h"
#include "components/viz/common/display/renderer_settings.h"
#include "components/viz/common/quads/aggregated_render_pass_draw_quad.h"
#include "components/viz/service/display/overlay_processor_interface.h"
#include "ui/gfx/geometry/rect_conversions.h"
namespace viz {
namespace {
gfx::Rect SafeConvertRectForRegion(const gfx::Rect& r) { … }
bool CanSplitQuad(const DrawQuad::Material quad_material,
const std::vector<gfx::Rect>& visible_region_rects,
const gfx::Size& visible_region_bounding_size,
int minimum_fragments_reduced,
const float device_scale_factor) { … }
gfx::RectF GetOccludingRectForRRectF(const gfx::RRectF& bounds) { … }
bool ReduceComplexity(const cc::Region& region,
size_t complexity_limit,
std::vector<gfx::Rect>* reduced_region) { … }
}
OcclusionCuller::OcclusionCuller(
OverlayProcessorInterface* overlay_processor,
const RendererSettings::OcclusionCullerSettings& settings)
: … { … }
OcclusionCuller::~OcclusionCuller() = default;
void OcclusionCuller::RemoveOverdrawQuads(AggregatedFrame* frame,
float device_scale_factor) { … }
}