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

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

Issue 2842983002: [LayoutNG] Paint inlines from the fragment tree
Patch Set: Basic box painting support 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/BoxPainter.h b/third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h
similarity index 50%
copy from third_party/WebKit/Source/core/paint/BoxPainter.h
copy to third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h
index 32ce82329497ce0343981a1bab338f2bc6510189..c544649d6e6217c35a63158ba34e15ca28bae8e7 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainter.h
+++ b/third_party/WebKit/Source/core/paint/NGBoxFragmentPainter.h
@@ -1,9 +1,9 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// 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 BoxPainter_h
-#define BoxPainter_h
+#ifndef NGBoxFragmentPainter_h
+#define NGBoxFragmentPainter_h
#include "core/layout/BackgroundBleedAvoidance.h"
#include "core/paint/BoxPainterBase.h"
@@ -16,41 +16,29 @@ namespace blink {
class ComputedStyle;
class FillLayer;
-class GraphicsContext;
-class Image;
-class InlineFlowBox;
class LayoutPoint;
class LayoutRect;
-class NinePieceImage;
+class NGPhysicalBoxFragment;
+class NGPhysicalLineBoxFragment;
+class NGPhysicalFragment;
struct PaintInfo;
-class LayoutBox;
-class LayoutObject;
-class LayoutBoxModelObject;
+class Document;
-class BoxPainter : public BoxPainterBase {
+class NGBoxFragmentPainter : public BoxPainterBase {
STACK_ALLOCATED();
public:
- BoxPainter(const LayoutBox& layout_box) : layout_box_(layout_box) {}
+ 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 PaintMask(const PaintInfo&, const LayoutPoint&);
- void PaintClippingMask(const PaintInfo&, const LayoutPoint&);
-
- typedef Vector<const FillLayer*, 8> FillLayerOcclusionOutputList;
- // Returns true if the result fill layers have non-associative blending or
- // compositing mode. (i.e. The rendering will be different without creating
- // isolation group by context.saveLayer().) Note that the output list will be
- // in top-bottom order.
- bool CalculateFillLayerOcclusionCulling(
- FillLayerOcclusionOutputList& reversed_paint_list,
- const FillLayer&);
-
- // Returns true if the fill layer will certainly occlude anything painted
- // behind it.
- static bool IsFillLayerOpaque(const FillLayer&, const LayoutObject&);
void PaintFillLayers(const PaintInfo&,
const Color&,
@@ -58,32 +46,23 @@ class BoxPainter : public BoxPainterBase {
const LayoutRect&,
BackgroundBleedAvoidance = kBackgroundBleedNone,
SkBlendMode = SkBlendMode::kSrcOver,
- const LayoutObject* background_object = nullptr);
- void PaintMaskImages(const PaintInfo&, const LayoutRect&);
+ const NGPhysicalFragment* bg_fragment = nullptr);
+
void PaintBoxDecorationBackgroundWithRect(const PaintInfo&,
const LayoutPoint&,
const LayoutRect&);
- static void PaintFillLayer(const LayoutBoxModelObject&,
+ static void PaintFillLayer(const NGPhysicalBoxFragment*,
const PaintInfo&,
const Color&,
const FillLayer&,
const LayoutRect&,
BackgroundBleedAvoidance,
- const InlineFlowBox* = nullptr,
+ const NGPhysicalFragment* = nullptr,
const LayoutSize& = LayoutSize(),
SkBlendMode = SkBlendMode::kSrcOver,
- const LayoutObject* background_object = nullptr);
- static InterpolationQuality ChooseInterpolationQuality(const LayoutObject&,
- Image*,
- const void*,
- const LayoutSize&);
- static bool PaintNinePieceImage(const LayoutBoxModelObject&,
- GraphicsContext&,
- const LayoutRect&,
- const ComputedStyle&,
- const NinePieceImage&,
- SkBlendMode = SkBlendMode::kSrcOver);
- static void PaintBorder(const LayoutBoxModelObject&,
+ const NGPhysicalFragment* bg_object = nullptr);
+
+ static void PaintBorder(const NGPhysicalBoxFragment*,
const PaintInfo&,
const LayoutRect&,
const ComputedStyle&,
@@ -94,19 +73,16 @@ class BoxPainter : public BoxPainterBase {
LayoutRect BoundsForDrawingRecorder(const PaintInfo&,
const LayoutPoint& adjusted_paint_offset);
- static bool IsPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer(
- const LayoutBoxModelObject*,
- const PaintInfo&);
-
private:
+ const Document& GetDocument() const;
void PaintBackground(const PaintInfo&,
const LayoutRect&,
const Color& background_color,
BackgroundBleedAvoidance = kBackgroundBleedNone);
- const LayoutBox& layout_box_;
+ const NGPhysicalBoxFragment* box_fragment_;
};
} // namespace blink
-#endif
+#endif // NGBoxFragmentPainter_h

Powered by Google App Engine
This is Rietveld 408576698