New issue
Advanced search Search tips

Issue 757082 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 732609



Sign in to add a comment

[SPv2] Over raster invalidation caused by subsequence existence change

Project Member Reported by wangxianzhu@chromium.org, Aug 18 2017

Issue description

For example, paint/invalidation/absolute-display-block-to-none.html:

<!DOCTYPE html>
<script src="resources/text-based-repaint.js"></script>
<script>
function repaintTest() {
  document.getElementById('absolute').style.display = 'none';
}
onload = runRepaintAndPixelTest;
</script>
When an absolute positioned element is set display:none, we should not invalidate the whole body.
<div id="absolute" style="position: absolute; width: 100px; height: 100px; top: 100px; left: 100px; background-color: red"></div>

We should invalidate the disappeared absolute-position object only, but we actually invalidate the whole HTML because we no longer create subsequence for HTML whose PaintLayerStackingNode becomes a leaf:

current display item list: [
  {
    "subsequence": "client: 0x33f91da14010 LayoutView #document",
    "chunks": [
      {
        "chunk": "client: 0x33f91da14010 LayoutView #document",
        "displayItems": [
          {
            "index": 0,
            "type": 213,
            "visualRect": "0,0 800x600"
          }
        ]
      },
      {
        "subsequence": "client: 0x33f91da140e8 LayoutBlockFlow HTML",
        "chunks": [
          {
            "chunk": "client: 0x33f91da140e8 LayoutBlockFlow HTML",
            "displayItems": [
              {
                "index": 1,
                "type": 213,
                "visualRect": "8,8 621x19"
              },
              {
                "index": 2,
                "clientIsAlive": false,
                "type": 12,
                "visualRect": "100,100 100x100"
              }
            ]
          }
        ]
      }
    ]
  }
]

new display item list: [
  {
    "subsequence": "client: 0x33f91da14010 LayoutView #document",
    "chunks": [
      {
        "chunk": "client: 0x33f91da14010 LayoutView #document",
        "displayItems": [
          {
            "index": 0,
            "clientDebugName": "LayoutView #document",
            "type": 16,
            "visualRect": "0,0 800x600"
          },
          {
            "index": 1,
            "clientDebugName": "InlineTextBox 'When an absolute positioned element is set display:none, we should not invalidate the whole body.'",
            "type": 4,
            "visualRect": "8,8 621x19"
          }
        ]
      }
    ]
  }
]

We invalidate the whole HTML because the chunk created for its subsequence disappeared.

One simple fix is to create subsequence for leaf PaintLayerStackingNode if we created subsequence for it in the previous paint. However, this won't work for over invalidation caused by new subsequences.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1db10196d999bf95545aaa30da897e9eb6a26b60

commit 1db10196d999bf95545aaa30da897e9eb6a26b60
Author: Xianzhu Wang <wangxianzhu@chromium.org>
Date: Thu Aug 24 22:16:16 2017

Also create subsequences for leaf stacking contexts

We didn't create subsequences for leaf stacking contexts to reduce
number of subsequences. This was useful when we created paired display
items for subsequences to reduce memory and cpu usage for subsequences.

Now that we no longer create paired display items for subsequences,
this CL removes the optimization to reduce changes of existence of
subsequences causing full chunk raster invalidation on SPv2.

Cluster telemetry results [1][2] showed that this patch slightly
degraded performance of record_time_painting_disabled by about 0.6%,
while had no significant effect on other results.

[1] https://ct.skia.org/results/cluster-telemetry/tasks/chromium_perf_runs/wangxianzhu-20170822215458/html/index.html
[2] https://ct.skia.org/results/cluster-telemetry/tasks/chromium_perf_runs/wangxianzhu-20170822215428/html/index.html
BUG= 757082 

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I3518b103a5ea354c9eb780a75f5dc4b86763e874
Reviewed-on: https://chromium-review.googlesource.com/627027
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497209}
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/absolute-display-block-to-none-expected.txt
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/background-image-paint-invalidation-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/block-layout-inline-children-float-positioned-expected.txt
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/details-open-repaint-expected.txt
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/erase-overflow-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/float-in-new-block-with-layout-delta-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/iframe-display-none-to-display-block-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/invalidation-with-zero-size-object-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/remove-block-after-layout-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/remove-inline-layer-after-layout-expected.txt
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/repaint-during-scroll-with-zoom-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/static-to-positioned-expected.txt
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/text-in-relative-positioned-inline-expected.txt
[add] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/trailing-floats-root-line-box-overflow-expected.txt
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/LayoutTests/flag-specific/enable-slimming-paint-v2/paint/invalidation/view-background-from-body-2-expected.txt
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/Source/core/paint/PaintLayer.cpp
[modify] https://crrev.com/1db10196d999bf95545aaa30da897e9eb6a26b60/third_party/WebKit/Source/core/paint/PaintLayerTest.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment