@@ -70,10 +70,8 @@ class NopCuller : public Culler {
70
70
NopCuller NopCuller::instance = NopCuller();
71
71
class VectorCuller : public Culler {
72
72
public:
73
- VectorCuller (sk_sp<const DlRTree> rtree, const std::vector<int >& rect_indices)
74
- : rtree_(std::move(rtree)),
75
- cur_ (rect_indices.begin()),
76
- end_(rect_indices.end()) {}
73
+ VectorCuller (const DlRTree* rtree, const std::vector<int >& rect_indices)
74
+ : rtree_(rtree), cur_(rect_indices.begin()), end_(rect_indices.end()) {}
77
75
78
76
bool init (DispatchContext& context) override {
79
77
if (cur_ < end_) {
@@ -100,7 +98,7 @@ class VectorCuller : public Culler {
100
98
}
101
99
102
100
private:
103
- const sk_sp< const DlRTree> rtree_;
101
+ const DlRTree* rtree_;
104
102
std::vector<int >::const_iterator cur_;
105
103
std::vector<int >::const_iterator end_;
106
104
};
@@ -117,16 +115,17 @@ void DisplayList::Dispatch(Dispatcher& ctx, const SkRect& cull_rect) {
117
115
Dispatch (ctx);
118
116
return ;
119
117
}
120
- FML_DCHECK (rtree () != nullptr );
121
- if (rtree () == nullptr ) {
118
+ const DlRTree* rtree = this ->rtree ().get ();
119
+ FML_DCHECK (rtree != nullptr );
120
+ if (rtree == nullptr ) {
122
121
FML_LOG (ERROR) << " dispatched with culling rect on DL with no rtree" ;
123
122
Dispatch (ctx);
124
123
return ;
125
124
}
126
125
uint8_t * ptr = storage_.get ();
127
126
std::vector<int > rect_indices;
128
- rtree () ->search (cull_rect, &rect_indices);
129
- VectorCuller culler (rtree () , rect_indices);
127
+ rtree->search (cull_rect, &rect_indices);
128
+ VectorCuller culler (rtree, rect_indices);
130
129
Dispatch (ctx, ptr, ptr + byte_count_, culler);
131
130
}
132
131
0 commit comments