Commit 938737c5 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[layoutng] Speed up NGPaintFragment::ResetInlineFragmentsFor

No need for the vector here

R=yosin@chromium.org,kojii@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I420acd918a937b1a01071f5fe9ada44db16a1d53
Reviewed-on: https://chromium-review.googlesource.com/1196369Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587606}
parent d9f2b8fa
......@@ -359,13 +359,12 @@ void NGPaintFragment::ResetInlineFragmentsFor(
// Because |next_for_same_layout_object_| can be the last reference, we should
// have another reference during resetting |next_for_same_layout_object_|
// |FragmentRange|..
const FragmentRange range = InlineFragmentsFor(layout_object);
Vector<scoped_refptr<NGPaintFragment>> fragments;
fragments.ReserveCapacity(range.size());
for (NGPaintFragment* fragment : range)
fragments.push_back(fragment);
for (const auto& fragment : fragments)
fragment->next_for_same_layout_object_.reset();
scoped_refptr<NGPaintFragment> current = layout_object->FirstInlineFragment();
while (current) {
scoped_refptr<NGPaintFragment> next;
next.swap(current->next_for_same_layout_object_);
current.swap(next);
}
}
bool NGPaintFragment::FlippedLocalVisualRectFor(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment