55#include < type_traits>
66
77#include " flutter/display_list/display_list.h"
8+ #include " flutter/display_list/display_list_builder.h"
89#include " flutter/display_list/display_list_canvas_dispatcher.h"
910#include " flutter/display_list/display_list_ops.h"
10- #include " flutter/display_list/display_list_utils.h"
1111#include " flutter/fml/trace_event.h"
1212
1313namespace flutter {
@@ -23,24 +23,24 @@ DisplayList::DisplayList()
2323 nested_op_count_(0 ),
2424 unique_id_(0 ),
2525 bounds_({0 , 0 , 0 , 0 }),
26- bounds_cull_({0 , 0 , 0 , 0 }),
2726 can_apply_group_opacity_(true ) {}
2827
2928DisplayList::DisplayList (uint8_t * ptr,
3029 size_t byte_count,
3130 unsigned int op_count,
3231 size_t nested_byte_count,
3332 unsigned int nested_op_count,
34- const SkRect& cull_rect,
35- bool can_apply_group_opacity)
33+ const SkRect& bounds,
34+ bool can_apply_group_opacity,
35+ sk_sp<const DlRTree> rtree)
3636 : storage_(ptr),
3737 byte_count_(byte_count),
3838 op_count_(op_count),
3939 nested_byte_count_(nested_byte_count),
4040 nested_op_count_(nested_op_count),
41- bounds_({ 0 , 0 , - 1 , - 1 } ),
42- bounds_cull_(cull_rect ),
43- can_apply_group_opacity_(can_apply_group_opacity ) {
41+ bounds_(bounds ),
42+ can_apply_group_opacity_(can_apply_group_opacity ),
43+ rtree_(std::move(rtree) ) {
4444 static std::atomic<uint32_t > next_id{1 };
4545 do {
4646 unique_id_ = next_id.fetch_add (+1 , std::memory_order_relaxed);
@@ -52,26 +52,6 @@ DisplayList::~DisplayList() {
5252 DisposeOps (ptr, ptr + byte_count_);
5353}
5454
55- void DisplayList::ComputeBounds () {
56- RectBoundsAccumulator accumulator;
57- DisplayListBoundsCalculator calculator (accumulator, &bounds_cull_);
58- Dispatch (calculator);
59- if (calculator.is_unbounded ()) {
60- FML_LOG (INFO) << " returning partial bounds for unbounded DisplayList" ;
61- }
62- bounds_ = accumulator.bounds ();
63- }
64-
65- void DisplayList::ComputeRTree () {
66- RTreeBoundsAccumulator accumulator;
67- DisplayListBoundsCalculator calculator (accumulator, &bounds_cull_);
68- Dispatch (calculator);
69- if (calculator.is_unbounded ()) {
70- FML_LOG (INFO) << " returning partial rtree for unbounded DisplayList" ;
71- }
72- rtree_ = accumulator.rtree ();
73- }
74-
7555void DisplayList::Dispatch (Dispatcher& dispatcher,
7656 uint8_t * ptr,
7757 uint8_t * end) const {
0 commit comments