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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/NGBlockFlowPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/NGBlockFlowPainter.cpp b/third_party/WebKit/Source/core/paint/NGBlockFlowPainter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9a0f4356ffbfc99f7e90afaeaadc38d4c3f3b78b
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/NGBlockFlowPainter.cpp
@@ -0,0 +1,44 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/paint/NGBlockFlowPainter.h"
+
+#include "core/layout/ng/layout_ng_block_flow.h"
+#include "core/layout/ng/ng_physical_box_fragment.h"
+#include "core/paint/NGBoxFragmentPainter.h"
+#include "core/paint/PaintInfo.h"
+#include "platform/RuntimeEnabledFeatures.h"
+
+namespace blink {
+
+void NGBlockFlowPainter::PaintContents(const PaintInfo& paint_info,
+ const LayoutPoint& paint_offset) {
+ const NGPhysicalFragment* fragment = layout_ng_block_flow_.RootFragment();
+ DCHECK(fragment);
+
+ if (fragment && fragment->Type() == NGPhysicalBoxFragment::kFragmentBox) {
+ const NGPhysicalBoxFragment* box_fragment =
+ ToNGPhysicalBoxFragment(fragment);
+ PaintNGBox(box_fragment, paint_info, paint_offset);
+ }
+}
+
+void NGBlockFlowPainter::PaintNGBox(const NGPhysicalBoxFragment* fragment,
+ const PaintInfo& paint_info,
+ const LayoutPoint& paint_offset) {
+ PaintInfo ng_paint_info(paint_info);
+
+ LayoutRect overflow_rect(layout_ng_block_flow_.VisualOverflowRect());
+ overflow_rect.MoveBy(paint_offset);
+
+ NGBoxFragmentPainter box_painter(fragment);
+
+ if (paint_info.phase == kPaintPhaseForeground) {
+ box_painter.PaintBoxDecorationBackground(ng_paint_info, paint_offset);
+ }
+
+ box_painter.Paint(ng_paint_info, paint_offset);
+}
+
+} // namespace blink
« 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