Commit 92523f96 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

Refactor PaintBackgroundWithRect for NGTables

TablesNG needs to call this routine without DrawingRecorder preamble.

Change-Id: Ifc95780106f0e14a10d21345d4114c2b536545af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136701Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756714}
parent 8d0e65a0
...@@ -831,16 +831,11 @@ void NGBoxFragmentPainter::PaintBoxDecorationBackground( ...@@ -831,16 +831,11 @@ void NGBoxFragmentPainter::PaintBoxDecorationBackground(
RecordScrollHitTestData(paint_info, *background_client); RecordScrollHitTestData(paint_info, *background_client);
} }
// TODO(kojii): This logic is kept in sync with BoxPainter. Not much efforts to
// eliminate LayoutObject dependency were done yet.
void NGBoxFragmentPainter::PaintBoxDecorationBackgroundWithRect( void NGBoxFragmentPainter::PaintBoxDecorationBackgroundWithRect(
const PaintInfo& paint_info, const PaintInfo& paint_info,
const PhysicalRect& paint_rect, const PhysicalRect& paint_rect,
const DisplayItemClient& background_client) { const DisplayItemClient& background_client) {
const LayoutObject& layout_object = *box_fragment_.GetLayoutObject(); const LayoutBox& layout_box = ToLayoutBox(*box_fragment_.GetLayoutObject());
const LayoutBox& layout_box = ToLayoutBox(layout_object);
const ComputedStyle& style = box_fragment_.Style();
base::Optional<DisplayItemCacheSkipper> cache_skipper; base::Optional<DisplayItemCacheSkipper> cache_skipper;
if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() && if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() &&
...@@ -858,6 +853,21 @@ void NGBoxFragmentPainter::PaintBoxDecorationBackgroundWithRect( ...@@ -858,6 +853,21 @@ void NGBoxFragmentPainter::PaintBoxDecorationBackgroundWithRect(
DrawingRecorder recorder(paint_info.context, background_client, DrawingRecorder recorder(paint_info.context, background_client,
DisplayItem::kBoxDecorationBackground); DisplayItem::kBoxDecorationBackground);
PaintBoxDecorationBackgroundWithRectImpl(paint_info, paint_rect,
box_decoration_data);
}
// TODO(kojii): This logic is kept in sync with BoxPainter. Not much efforts to
// eliminate LayoutObject dependency were done yet.
void NGBoxFragmentPainter::PaintBoxDecorationBackgroundWithRectImpl(
const PaintInfo& paint_info,
const PhysicalRect& paint_rect,
const BoxDecorationData& box_decoration_data) {
const LayoutObject& layout_object = *box_fragment_.GetLayoutObject();
const LayoutBox& layout_box = ToLayoutBox(layout_object);
const ComputedStyle& style = box_fragment_.Style();
GraphicsContextStateSaver state_saver(paint_info.context, false); GraphicsContextStateSaver state_saver(paint_info.context, false);
const NGBorderEdges& border_edges = BorderEdges(); const NGBorderEdges& border_edges = BorderEdges();
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
namespace blink { namespace blink {
class BoxDecorationData;
class FillLayer; class FillLayer;
class HitTestLocation; class HitTestLocation;
class HitTestRequest; class HitTestRequest;
...@@ -71,6 +72,10 @@ class NGBoxFragmentPainter : public BoxPainterBase { ...@@ -71,6 +72,10 @@ class NGBoxFragmentPainter : public BoxPainterBase {
const PhysicalOffset& accumulated_offset, const PhysicalOffset& accumulated_offset,
HitTestFilter = kHitTestAll); HitTestFilter = kHitTestAll);
void PaintBoxDecorationBackgroundWithRectImpl(const PaintInfo&,
const PhysicalRect&,
const BoxDecorationData&);
protected: protected:
LayoutRectOutsets ComputeBorders() const override; LayoutRectOutsets ComputeBorders() const override;
LayoutRectOutsets ComputePadding() const override; LayoutRectOutsets ComputePadding() const override;
...@@ -109,6 +114,7 @@ class NGBoxFragmentPainter : public BoxPainterBase { ...@@ -109,6 +114,7 @@ class NGBoxFragmentPainter : public BoxPainterBase {
void PaintBoxDecorationBackgroundWithRect(const PaintInfo&, void PaintBoxDecorationBackgroundWithRect(const PaintInfo&,
const PhysicalRect&, const PhysicalRect&,
const DisplayItemClient&); const DisplayItemClient&);
void PaintColumnRules(const PaintInfo&, const PhysicalOffset& paint_offset); void PaintColumnRules(const PaintInfo&, const PhysicalOffset& paint_offset);
void PaintInternal(const PaintInfo&); void PaintInternal(const PaintInfo&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment