OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/paint/NGBlockFlowPainter.h" |
| 6 |
| 7 #include "core/layout/ng/layout_ng_block_flow.h" |
| 8 #include "core/layout/ng/ng_physical_box_fragment.h" |
| 9 #include "core/paint/NGBoxFragmentPainter.h" |
| 10 #include "core/paint/PaintInfo.h" |
| 11 #include "platform/RuntimeEnabledFeatures.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 void NGBlockFlowPainter::PaintContents(const PaintInfo& paint_info, |
| 16 const LayoutPoint& paint_offset) { |
| 17 const NGPhysicalFragment* fragment = layout_ng_block_flow_.RootFragment(); |
| 18 DCHECK(fragment); |
| 19 |
| 20 if (fragment && fragment->Type() == NGPhysicalBoxFragment::kFragmentBox) { |
| 21 const NGPhysicalBoxFragment* box_fragment = |
| 22 ToNGPhysicalBoxFragment(fragment); |
| 23 PaintNGBox(box_fragment, paint_info, paint_offset); |
| 24 } |
| 25 } |
| 26 |
| 27 void NGBlockFlowPainter::PaintNGBox(const NGPhysicalBoxFragment* fragment, |
| 28 const PaintInfo& paint_info, |
| 29 const LayoutPoint& paint_offset) { |
| 30 PaintInfo ng_paint_info(paint_info); |
| 31 |
| 32 LayoutRect overflow_rect(layout_ng_block_flow_.VisualOverflowRect()); |
| 33 overflow_rect.MoveBy(paint_offset); |
| 34 |
| 35 NGBoxFragmentPainter box_painter(fragment); |
| 36 |
| 37 if (paint_info.phase == kPaintPhaseForeground) { |
| 38 box_painter.PaintBoxDecorationBackground(ng_paint_info, paint_offset); |
| 39 } |
| 40 |
| 41 box_painter.Paint(ng_paint_info, paint_offset); |
| 42 } |
| 43 |
| 44 } // namespace blink |
OLD | NEW |