Commit 200dac5b authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[SPv175+] Fix PaintLayerPaintPainter::AdjustForPaintOffsetTranslation

When the original root layer doesn't have PaintOffsetTranslation,
we need to add the original root layer's paint offset to
paint_dirty_rect.

Bug: 771643
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ife14340612c36edb8206d8f4523f01843b422b6a
Reviewed-on: https://chromium-review.googlesource.com/822031Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523637}
parent 3b89bbaa
...@@ -75,13 +75,10 @@ crbug.com/769942 virtual/spv175/paint/invalidation/svg/image-with-clip-path.svg ...@@ -75,13 +75,10 @@ crbug.com/769942 virtual/spv175/paint/invalidation/svg/image-with-clip-path.svg
crbug.com/769942 virtual/spv175/paint/invalidation/svg/js-late-clipPath-and-object-creation.svg [ Failure ] crbug.com/769942 virtual/spv175/paint/invalidation/svg/js-late-clipPath-and-object-creation.svg [ Failure ]
crbug.com/769942 virtual/spv175/paint/invalidation/svg/js-late-clipPath-creation.svg [ Failure ] crbug.com/769942 virtual/spv175/paint/invalidation/svg/js-late-clipPath-creation.svg [ Failure ]
crbug.com/771643 virtual/spv175/compositing/fixed-body-background-positioned.html [ Failure Pass ]
crbug.com/771643 virtual/spv175/compositing/geometry/repaint-foreground-layer.html [ Crash ] crbug.com/771643 virtual/spv175/compositing/geometry/repaint-foreground-layer.html [ Crash ]
crbug.com/771643 virtual/spv175/compositing/images/direct-image-dynamic-border-radius.html [ Failure ] crbug.com/771643 virtual/spv175/compositing/images/direct-image-dynamic-border-radius.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/overflow/nested-border-radius-clipping.html [ Failure ] crbug.com/771643 virtual/spv175/compositing/overflow/nested-border-radius-clipping.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/overflow/scroll-ancestor-update.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/overflow/scroll-neg-z-index-and-composited-child.html [ Failure ] crbug.com/771643 virtual/spv175/compositing/overflow/scroll-neg-z-index-and-composited-child.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/squashing/squash-composited-input.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/squashing/squash-overflow-hidden-scrolltop.html [ Failure ] crbug.com/771643 virtual/spv175/compositing/squashing/squash-overflow-hidden-scrolltop.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/squashing/squash-with-ancestor-reflection.html [ Failure ] crbug.com/771643 virtual/spv175/compositing/squashing/squash-with-ancestor-reflection.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/visibility/visibility-image-layers.html [ Failure Pass ] crbug.com/771643 virtual/spv175/compositing/visibility/visibility-image-layers.html [ Failure Pass ]
......
...@@ -267,10 +267,20 @@ void PaintLayerPainter::AdjustForPaintOffsetTranslation( ...@@ -267,10 +267,20 @@ void PaintLayerPainter::AdjustForPaintOffsetTranslation(
if (const auto* properties = if (const auto* properties =
paint_layer_.GetLayoutObject().FirstFragment().PaintProperties()) { paint_layer_.GetLayoutObject().FirstFragment().PaintProperties()) {
if (properties->PaintOffsetTranslation()) { if (properties->PaintOffsetTranslation()) {
painting_info.root_layer = &paint_layer_; // Map paint_dirty_rect from the original root layer to the current layer,
// and make the current layer the new root layer.
painting_info.paint_dirty_rect = painting_info.paint_dirty_rect =
properties->PaintOffsetTranslation()->Matrix().Inverse().MapRect( properties->PaintOffsetTranslation()->Matrix().Inverse().MapRect(
painting_info.paint_dirty_rect); painting_info.paint_dirty_rect);
// If the original root layer doesn't have PaintOffsetTranslation which
// means that paint_layer_'s PaintOffsetTranslation includes root layer's
// paint offset, then we need to add the root layer's paint offset.
const auto& root_fragment =
painting_info.root_layer->GetLayoutObject().FirstFragment();
if (!root_fragment.PaintProperties() ||
!root_fragment.PaintProperties()->PaintOffsetTranslation())
painting_info.paint_dirty_rect.MoveBy(root_fragment.PaintOffset());
painting_info.root_layer = &paint_layer_;
// TODO(chrishtr): is this correct for fragmentation? // TODO(chrishtr): is this correct for fragmentation?
painting_info.sub_pixel_accumulation = ToLayoutSize( painting_info.sub_pixel_accumulation = ToLayoutSize(
......
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