5#ifndef FLUTTER_DISPLAY_LIST_GEOMETRY_DL_RTREE_H_
6#define FLUTTER_DISPLAY_LIST_GEOMETRY_DL_RTREE_H_
12#include "flutter/display_list/geometry/dl_region.h"
13#include "flutter/fml/logging.h"
31 static constexpr int kMaxChildren = 11;
67 const int ids[] =
nullptr,
68 bool predicate(
int id) = [](
int) {
return true; },
81 void search(
const SkRect& query, std::vector<int>* results)
const;
85 int id(
int result_index)
const {
86 return (result_index >= 0 && result_index < leaf_count_)
87 ? nodes_[result_index].id
98 return (result_index >= 0 && result_index < leaf_count_)
99 ? nodes_[result_index].bounds
105 return sizeof(
DlRTree) +
sizeof(Node) * nodes_.size();
127 bool deband =
true)
const;
144 std::vector<int>* results)
const;
146 std::vector<Node> nodes_;
149 mutable std::optional<DlRegion> region_;
int id(int result_index) const
const SkRect & bounds() const
void search(const SkRect &query, std::vector< int > *results) const
DlRTree(const SkRect rects[], int N, const int ids[]=nullptr, bool predicate(int id)=[](int) { return true;}, int invalid_id=-1)
const DlRegion & region() const
size_t bytes_used() const
Returns the bytes used by the object and all of its node data.
const SkRect & bounds(int result_index) const
std::list< SkRect > searchAndConsolidateRects(const SkRect &query, bool deband=true) const
DlRegion region(const SkRect &query) const
static DlRegion MakeIntersection(const DlRegion &a, const DlRegion &b)
static constexpr SkRect MakeEmpty()
void roundOut(SkIRect *dst) const