Commit a08daf92 authored by Koji Ishii's avatar Koji Ishii Committed by Chromium LUCI CQ

Remove NGPaintFragment in LayoutNGBlockFlowMixin::Paint

This patch removes |NGPaintFragment| support in |Paint|.

By eliminating |NGFragmentItem| specific code,
|LayoutNGBlockFlowMixin::Paint| becomes equivalent to
|LayoutNGMixin::Paint| that it is removed.

Bug: 1154531
Change-Id: Iac72b27256a5e6219eb49a689e671f0477f03e3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567145
Commit-Queue: Koji Ishii <kojii@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Auto-Submit: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832702}
parent 6b2bd756
......@@ -216,49 +216,6 @@ void LayoutNGBlockFlowMixin<Base>::SetPaintFragment(
}
}
template <typename Base>
void LayoutNGBlockFlowMixin<Base>::Paint(const PaintInfo& paint_info) const {
// When |this| is NG block fragmented, the painter should traverse fragments
// instead of |LayoutObject|, because this function cannot handle block
// fragmented objects. We can come here only when |this| cannot traverse
// fragments, or the parent is legacy.
DCHECK(!Base::CanTraversePhysicalFragments() ||
!Base::Parent()->CanTraversePhysicalFragments());
DCHECK_LE(Base::PhysicalFragmentCount(), 1u);
// Avoid painting dirty objects because descendants maybe already destroyed.
if (UNLIKELY(Base::NeedsLayout() &&
!Base::ChildLayoutBlockedByDisplayLock())) {
NOTREACHED();
return;
}
if (UNLIKELY(RuntimeEnabledFeatures::LayoutNGFragmentItemEnabled())) {
if (Base::PhysicalFragmentCount()) {
const NGPhysicalBoxFragment* fragment = Base::GetPhysicalFragment(0);
DCHECK(fragment);
if (fragment->HasItems()) {
NGBoxFragmentPainter(*fragment).Paint(paint_info);
return;
}
}
}
if (const NGPaintFragment* paint_fragment = PaintFragment()) {
NGBoxFragmentPainter(*paint_fragment).Paint(paint_info);
return;
}
if (Base::PhysicalFragmentCount()) {
const NGPhysicalBoxFragment* fragment = Base::GetPhysicalFragment(0);
DCHECK(fragment);
NGBoxFragmentPainter(*fragment).Paint(paint_info);
return;
}
Base::Paint(paint_info);
}
template <typename Base>
bool LayoutNGBlockFlowMixin<Base>::NodeAtPoint(
HitTestResult& result,
......
......@@ -41,8 +41,6 @@ class LayoutNGBlockFlowMixin : public LayoutNGMixin<Base> {
LayoutUnit FirstLineBoxBaseline() const final;
LayoutUnit InlineBlockBaseline(LineDirectionMode) const final;
void Paint(const PaintInfo&) const override;
bool NodeAtPoint(HitTestResult&,
const HitTestLocation&,
const PhysicalOffset& accumulated_offset,
......
......@@ -55,7 +55,11 @@ void LayoutNGMixin<Base>::Paint(const PaintInfo& paint_info) const {
const NGPhysicalBoxFragment* fragment = Base::GetPhysicalFragment(0);
DCHECK(fragment);
NGBoxFragmentPainter(*fragment).Paint(paint_info);
return;
}
NOTREACHED();
Base::Paint(paint_info);
}
template <typename Base>
......
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