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

Unified Diff: third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h

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/NGBoxFragmentPainter.h
diff --git a/third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h b/third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h
new file mode 100644
index 0000000000000000000000000000000000000000..c544649d6e6217c35a63158ba34e15ca28bae8e7
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h
@@ -0,0 +1,88 @@
+// 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.
+
+#ifndef NGBoxFragmentPainter_h
+#define NGBoxFragmentPainter_h
+
+#include "core/layout/BackgroundBleedAvoidance.h"
+#include "core/paint/BoxPainterBase.h"
+#include "platform/geometry/LayoutSize.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "platform/wtf/Allocator.h"
+#include "third_party/skia/include/core/SkBlendMode.h"
+
+namespace blink {
+
+class ComputedStyle;
+class FillLayer;
+class LayoutPoint;
+class LayoutRect;
+class NGPhysicalBoxFragment;
+class NGPhysicalLineBoxFragment;
+class NGPhysicalFragment;
+struct PaintInfo;
+class Document;
+
+class NGBoxFragmentPainter : public BoxPainterBase {
+ STACK_ALLOCATED();
+
+ public:
+ NGBoxFragmentPainter(const NGPhysicalBoxFragment* box_fragment)
+ : box_fragment_(box_fragment) {}
+ ~NGBoxFragmentPainter() {}
+ void Paint(const PaintInfo&, const LayoutPoint&);
+
+ void PaintChildren(const PaintInfo&, const LayoutPoint&);
+ void PaintLineBox(const NGPhysicalLineBoxFragment*,
+ const PaintInfo&,
+ const LayoutPoint& paint_offset);
+
+ void PaintBoxDecorationBackground(const PaintInfo&, const LayoutPoint&);
+
+ void PaintFillLayers(const PaintInfo&,
+ const Color&,
+ const FillLayer&,
+ const LayoutRect&,
+ BackgroundBleedAvoidance = kBackgroundBleedNone,
+ SkBlendMode = SkBlendMode::kSrcOver,
+ const NGPhysicalFragment* bg_fragment = nullptr);
+
+ void PaintBoxDecorationBackgroundWithRect(const PaintInfo&,
+ const LayoutPoint&,
+ const LayoutRect&);
+ static void PaintFillLayer(const NGPhysicalBoxFragment*,
+ const PaintInfo&,
+ const Color&,
+ const FillLayer&,
+ const LayoutRect&,
+ BackgroundBleedAvoidance,
+ const NGPhysicalFragment* = nullptr,
+ const LayoutSize& = LayoutSize(),
+ SkBlendMode = SkBlendMode::kSrcOver,
+ const NGPhysicalFragment* bg_object = nullptr);
+
+ static void PaintBorder(const NGPhysicalBoxFragment*,
+ const PaintInfo&,
+ const LayoutRect&,
+ const ComputedStyle&,
+ BackgroundBleedAvoidance = kBackgroundBleedNone,
+ bool include_logical_left_edge = true,
+ bool include_logical_right_edge = true);
+
+ LayoutRect BoundsForDrawingRecorder(const PaintInfo&,
+ const LayoutPoint& adjusted_paint_offset);
+
+ private:
+ const Document& GetDocument() const;
+ void PaintBackground(const PaintInfo&,
+ const LayoutRect&,
+ const Color& background_color,
+ BackgroundBleedAvoidance = kBackgroundBleedNone);
+
+ const NGPhysicalBoxFragment* box_fragment_;
+};
+
+} // namespace blink
+
+#endif // NGBoxFragmentPainter_h

Powered by Google App Engine
This is Rietveld 408576698