Commit 37254d58 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[rm-for-spv175] Remove old table header/footer and fixed-pos repeating code

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ic7258e4b4e03988344412e2e15893ea30f68ae38
Reviewed-on: https://chromium-review.googlesource.com/1112939Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570097}
parent 5ec1b0db
...@@ -495,17 +495,6 @@ PaintResult PaintLayerPainter::PaintLayerContents( ...@@ -495,17 +495,6 @@ PaintResult PaintLayerPainter::PaintLayerContents(
kIgnorePlatformOverlayScrollbarSize, respect_overflow_clip, kIgnorePlatformOverlayScrollbarSize, respect_overflow_clip,
&offset_from_root, local_painting_info.sub_pixel_accumulation); &offset_from_root, local_painting_info.sub_pixel_accumulation);
layer_fragments[0].fragment_data = fragment->fragment_data; layer_fragments[0].fragment_data = fragment->fragment_data;
} else if (!RuntimeEnabledFeatures::SlimmingPaintV175Enabled() &&
paint_layer_.GetLayoutObject()
.IsFixedPositionObjectInPagedMedia()) {
PaintLayerFragments single_fragment;
paint_layer_for_fragments->AppendSingleFragmentIgnoringPagination(
single_fragment, local_painting_info.root_layer,
&local_painting_info.paint_dirty_rect,
kIgnorePlatformOverlayScrollbarSize, respect_overflow_clip,
&offset_from_root, local_painting_info.sub_pixel_accumulation);
RepeatFixedPositionObjectInPages(single_fragment[0], painting_info,
layer_fragments);
} else { } else {
paint_layer_for_fragments->CollectFragments( paint_layer_for_fragments->CollectFragments(
layer_fragments, local_painting_info.root_layer, layer_fragments, local_painting_info.root_layer,
...@@ -725,35 +714,6 @@ bool PaintLayerPainter::AtLeastOneFragmentIntersectsDamageRect( ...@@ -725,35 +714,6 @@ bool PaintLayerPainter::AtLeastOneFragmentIntersectsDamageRect(
return false; return false;
} }
void PaintLayerPainter::RepeatFixedPositionObjectInPages(
const PaintLayerFragment& single_fragment_ignored_pagination,
const PaintLayerPaintingInfo& painting_info,
PaintLayerFragments& layer_fragments) {
DCHECK(!RuntimeEnabledFeatures::SlimmingPaintV175Enabled());
DCHECK(paint_layer_.GetLayoutObject().IsFixedPositionObjectInPagedMedia());
LayoutView* view = paint_layer_.GetLayoutObject().View();
unsigned pages =
ceilf(view->DocumentRect().Height() / view->PageLogicalHeight());
// The fixed position object is offset from the top of the page, so remove
// any scroll offset.
LayoutPoint offset_from_root;
paint_layer_.ConvertToLayerCoords(painting_info.root_layer, offset_from_root);
LayoutSize offset_adjustment = paint_layer_.Location() - offset_from_root;
layer_fragments.push_back(single_fragment_ignored_pagination);
layer_fragments[0].pagination_offset += offset_adjustment;
layer_fragments[0].layer_bounds.Move(offset_adjustment);
LayoutPoint page_offset(LayoutUnit(), view->PageLogicalHeight());
for (unsigned i = 1; i < pages; i++) {
PaintLayerFragment fragment = layer_fragments[i - 1];
fragment.pagination_offset += page_offset;
fragment.layer_bounds.MoveBy(page_offset);
layer_fragments.push_back(fragment);
}
}
template <typename Function> template <typename Function>
static void ForAllFragments(GraphicsContext& context, static void ForAllFragments(GraphicsContext& context,
const PaintLayerFragments& fragments, const PaintLayerFragments& fragments,
...@@ -783,9 +743,6 @@ PaintResult PaintLayerPainter::PaintLayerWithAdjustedRoot( ...@@ -783,9 +743,6 @@ PaintResult PaintLayerPainter::PaintLayerWithAdjustedRoot(
PaintResult result = kFullyPainted; PaintResult result = kFullyPainted;
PaintLayerFragments layer_fragments; PaintLayerFragments layer_fragments;
bool is_fixed_position_object_in_paged_media =
!RuntimeEnabledFeatures::SlimmingPaintV175Enabled() &&
paint_layer_.GetLayoutObject().IsFixedPositionObjectInPagedMedia();
// This works around a bug in squashed-layer painting. // This works around a bug in squashed-layer painting.
// Squashed layers paint into a backing in its compositing container's // Squashed layers paint into a backing in its compositing container's
...@@ -796,7 +753,7 @@ PaintResult PaintLayerPainter::PaintLayerWithAdjustedRoot( ...@@ -796,7 +753,7 @@ PaintResult PaintLayerPainter::PaintLayerWithAdjustedRoot(
// appropriate ancestor clip for us, so we can simply skip it. // appropriate ancestor clip for us, so we can simply skip it.
bool is_squashed_layer = painting_info.root_layer == &paint_layer_; bool is_squashed_layer = painting_info.root_layer == &paint_layer_;
if (is_squashed_layer || is_fixed_position_object_in_paged_media) { if (is_squashed_layer) {
// We don't need to collect any fragments in the regular way here. We have // We don't need to collect any fragments in the regular way here. We have
// already calculated a clip rectangle for the ancestry if it was needed, // already calculated a clip rectangle for the ancestry if it was needed,
// and clipping this layer is something that can be done further down the // and clipping this layer is something that can be done further down the
...@@ -804,12 +761,7 @@ PaintResult PaintLayerPainter::PaintLayerWithAdjustedRoot( ...@@ -804,12 +761,7 @@ PaintResult PaintLayerPainter::PaintLayerWithAdjustedRoot(
PaintLayerFragment fragment; PaintLayerFragment fragment;
fragment.background_rect = painting_info.paint_dirty_rect; fragment.background_rect = painting_info.paint_dirty_rect;
fragment.fragment_data = &paint_layer_.GetLayoutObject().FirstFragment(); fragment.fragment_data = &paint_layer_.GetLayoutObject().FirstFragment();
if (is_fixed_position_object_in_paged_media) { layer_fragments.push_back(fragment);
RepeatFixedPositionObjectInPages(fragment, painting_info,
layer_fragments);
} else {
layer_fragments.push_back(fragment);
}
} else if (parent_layer) { } else if (parent_layer) {
ShouldRespectOverflowClipType respect_overflow_clip = ShouldRespectOverflowClipType respect_overflow_clip =
ShouldRespectOverflowClip(paint_flags, paint_layer_.GetLayoutObject()); ShouldRespectOverflowClip(paint_flags, paint_layer_.GetLayoutObject());
......
...@@ -65,16 +65,6 @@ class CORE_EXPORT PaintLayerPainter { ...@@ -65,16 +65,6 @@ class CORE_EXPORT PaintLayerPainter {
bool ShouldAdjustPaintingRoot(const PaintLayerPaintingInfo& painting_info, bool ShouldAdjustPaintingRoot(const PaintLayerPaintingInfo& painting_info,
PaintLayerFlags paint_flags); PaintLayerFlags paint_flags);
// "For paged media, boxes with fixed positions are repeated on every page."
// https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-positioning
// Repeats singleFragmentIgnoredPagination of the fixed-position object in
// each page, with paginationOffset and layerBounds adjusted for each page.
// TODO(wangxianzhu): Fold this into PaintLayer::collectFragments().
void RepeatFixedPositionObjectInPages(
const PaintLayerFragment& single_fragment_ignored_pagination,
const PaintLayerPaintingInfo&,
PaintLayerFragments&);
PaintResult PaintLayerContentsCompositingAllPhases( PaintResult PaintLayerContentsCompositingAllPhases(
GraphicsContext&, GraphicsContext&,
const PaintLayerPaintingInfo&, const PaintLayerPaintingInfo&,
......
...@@ -39,13 +39,6 @@ class TableSectionPainter { ...@@ -39,13 +39,6 @@ class TableSectionPainter {
const LayoutPoint&); const LayoutPoint&);
void PaintCell(const LayoutTableCell&, const PaintInfo&, const LayoutPoint&); void PaintCell(const LayoutTableCell&, const PaintInfo&, const LayoutPoint&);
enum ItemToPaint { kPaintCollapsedBorders, kPaintSection };
void PaintRepeatingHeaderGroup(const PaintInfo&,
const LayoutPoint&,
ItemToPaint);
void PaintRepeatingFooterGroup(const PaintInfo&,
const LayoutPoint&,
ItemToPaint);
void PaintSection(const PaintInfo&, const LayoutPoint&); void PaintSection(const PaintInfo&, const LayoutPoint&);
void PaintCollapsedSectionBorders(const PaintInfo&, const LayoutPoint&); void PaintCollapsedSectionBorders(const PaintInfo&, const LayoutPoint&);
......
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