Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: third_party/WebKit/Source/core/paint/NGBlockFlowPainter.cpp

Issue 2842983002: [LayoutNG] Paint inlines from the fragment tree
Patch Set: Rebase w/HEAD Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/NGBlockFlowPainter.h ('k') | third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698