| 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
|
|
|