Skip to content

Commit

Permalink
Get bounds from RTree in DLBuilder::Build()
Browse files Browse the repository at this point in the history
  • Loading branch information
flar committed Feb 1, 2024
1 parent dd4c79a commit 61782fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions display_list/dl_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ sk_sp<DisplayList> DisplayListBuilder::Build() {
bool is_safe = is_ui_thread_safe_;
bool affects_transparency = current_layer_->affects_transparent_layer();

sk_sp<DlRTree> rtree = this->rtree();
SkRect bounds = rtree ? rtree->bounds() : this->bounds();

used_ = allocated_ = render_op_count_ = op_index_ = 0;
nested_bytes_ = nested_op_count_ = 0;
is_ui_thread_safe_ = true;
Expand All @@ -86,8 +89,8 @@ sk_sp<DisplayList> DisplayListBuilder::Build() {
current_ = DlPaint();

return sk_sp<DisplayList>(new DisplayList(
std::move(storage_), bytes, count, nested_bytes, nested_count, bounds(),
compatible, is_safe, affects_transparency, rtree()));
std::move(storage_), bytes, count, nested_bytes, nested_count, bounds,
compatible, is_safe, affects_transparency, std::move(rtree)));
}

DisplayListBuilder::DisplayListBuilder(const SkRect& cull_rect,
Expand Down
2 changes: 1 addition & 1 deletion display_list/dl_op_records.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ struct SetRuntimeEffectColorSourceOp : DLOp {
struct SetSceneColorSourceOp : DLOp {
static const auto kType = DisplayListOpType::kSetSceneColorSource;

SetSceneColorSourceOp(const DlSceneColorSource* source)
explicit SetSceneColorSourceOp(const DlSceneColorSource* source)
: source(source->scene_node(), source->camera_matrix()) {}

const DlSceneColorSource source;
Expand Down

0 comments on commit 61782fe

Please sign in to comment.