[For CT only] Stat opaqueness to hit test [chromium/src : main]

0 views
Skip to first unread message

Xianzhu Wang (Gerrit)

unread,
Jun 8, 2023, 10:48:09 PM6/8/23
to Philip Rogers, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, pdr+graphi...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, zol...@webkit.org

Attention is currently required from: Philip Rogers.

Xianzhu Wang would like Philip Rogers to review this change.

View Change

[For CT only] Stat opaqueness to hit test

Change-Id: Ia237422ab5ccf76aa5fca75725911276b2a8dcf9
---
M base/trace_event/builtin_categories.h
M cc/layers/layer.cc
M cc/layers/layer.h
M third_party/blink/renderer/core/exported/web_plugin_container_impl.cc
M third_party/blink/renderer/core/layout/layout_object.cc
M third_party/blink/renderer/core/layout/layout_object.h
M third_party/blink/renderer/core/paint/box_painter.cc
M third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
M third_party/blink/renderer/core/paint/svg_model_object_painter.cc
M third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper.cc
M third_party/blink/renderer/platform/graphics/compositing/chunk_to_layer_mapper.h
M third_party/blink/renderer/platform/graphics/compositing/layers_as_json.cc
M third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc
M third_party/blink/renderer/platform/graphics/paint/paint_artifact.cc
M third_party/blink/renderer/platform/graphics/paint/paint_chunk.cc
M third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
M third_party/blink/renderer/platform/graphics/paint/paint_chunker.cc
M third_party/blink/renderer/platform/graphics/paint/paint_chunker.h
M third_party/blink/renderer/platform/graphics/paint/paint_controller.cc
M third_party/blink/renderer/platform/graphics/paint/paint_controller.h
20 files changed, 150 insertions(+), 36 deletions(-)


To view, visit change 4596916. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia237422ab5ccf76aa5fca75725911276b2a8dcf9
Gerrit-Change-Number: 4596916
Gerrit-PatchSet: 4
Gerrit-Owner: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Philip Rogers <p...@chromium.org>

Xianzhu Wang (Gerrit)

unread,
Jun 8, 2023, 10:48:12 PM6/8/23
to blink-revi...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, pdr+graphi...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, zol...@webkit.org, Philip Rogers, chromium...@chromium.org, Dirk Schulze, Stephen Chenney

Attention is currently required from: Philip Rogers.

View Change

1 comment:

To view, visit change 4596916. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia237422ab5ccf76aa5fca75725911276b2a8dcf9
Gerrit-Change-Number: 4596916
Gerrit-PatchSet: 4
Gerrit-Owner: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Fri, 09 Jun 2023 02:48:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Philip Rogers (Gerrit)

unread,
Jun 9, 2023, 11:19:20 AM6/9/23
to Xianzhu Wang, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, pdr+graphi...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, zol...@webkit.org, chromium...@chromium.org, Dirk Schulze, Stephen Chenney

Attention is currently required from: Xianzhu Wang.

View Change

3 comments:

  • Patchset:

    • Patch Set #4:

      Philip, can you review this patch (for CT only)? I would like to have another pair of eyes to verify […]

      The comment descriptions in the spreadsheet helped me a lot.

      Do you have a takeaway from the current data? One thing I noticed is "a/layer-opaque-hit-area/value" is high. Do you think this indicates enough of an opportunity to try considering opaque-for-hit-testing layers as reliable? Or do you think it would be better to add this plumbing for the purposes of metrics first?

      Because of all of the non-opaque-for-hit-test reasons (border radius, pointer events, non-composited clips, etc), I am a little worried that a fully generic solution here would be complex. Would it be worth looking at some of the pages identified in the data to see if there is a pattern?

      Because "a/layer-not-opaque-hit-squash-area/value" is small, can we conclude that optimizations to avoid squashing non-hit-test-opaque chunks are not worth pursuing? Initially, I thought yes, but there are many chunks per layer ("a/chunk-opaque-hit/value" + "a/chunk-not-opaque-hit/value" vs "a/layer-opaque-hit/value" + "a/layer-not-opaque-hit-chunk/value"), and chunks seem to be only ~50% opaque to hit testing, so a low ratio is expected. Can we conclude anything about the potential in pursuing optimizations to avoid squashing non-hit-test-opaque chunks?

  • File third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc:

    • Patch Set #4, Line 1157: if (layer_.bounds().IsEmpty() ||

      This will over-count frequently-repainted layers. Do you think it would be worth trying a snapshot approach where the analysis is run once per page by looping over all layers after loading has completed?

      If you want to try this, one hacky way is to add a sleep(40) in ValidateAndMeasurePage in "tools/perf/contrib/cluster_telemetry/generic_trace.py" to make the page wait quite a while, and then do the analysis for local frame roots in Document::ImplicitClose + a timer.

  • File third_party/blink/renderer/platform/graphics/paint/paint_chunker.cc:

    • Patch Set #4, Line 180: if (opaque_to_hit_test) {

      What if we have a paint chunk with a solid background (opaque to hit testing) and a child with pointer-events: none? Will this result in a paint chunk that is considered opaque to hit testing, even though the pointer-events: none should make it non-opaque?

To view, visit change 4596916. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia237422ab5ccf76aa5fca75725911276b2a8dcf9
Gerrit-Change-Number: 4596916
Gerrit-PatchSet: 4
Gerrit-Owner: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Comment-Date: Fri, 09 Jun 2023 15:19:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Xianzhu Wang <wangx...@chromium.org>

Xianzhu Wang (Gerrit)

unread,
Jun 10, 2023, 11:52:01 PM6/10/23
to blink-revi...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, pdr+graphi...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, zol...@webkit.org, Philip Rogers, chromium...@chromium.org, Dirk Schulze, Stephen Chenney

Attention is currently required from: Philip Rogers.

View Change

3 comments:

  • Patchset:

    • Patch Set #4:

      Do you have a takeaway from the current data? One thing I noticed is "a/layer-opaque-hit-area/value" is high. Do you think this indicates enough of an opportunity to try considering opaque-for-hit-testing layers as reliable? Or do you think it would be better to add this plumbing for the purposes of metrics first?

      I think that indicates a potential opportunity, but I would like to get some real world data with UMA metrics first. The CT data are not properly weighed for real world scroll hit tests.


    • > Because of all of the non-opaque-for-hit-test reasons (border radius, pointer events, non-composited clips, etc), I am a little worried that a fully generic solution here would be complex. Would it be worth looking at some of the pages identified in the data to see if there is a pattern?
    • For opaqueness-for-hit-test of paint chunks, we only need to consider the reasons not caused by paint properties. Border radius is considered because the background is clipped using paint operations instead of paint properties during painting.

      Non-opaque-for-hit-test caused by paint properties will cause the result of GeometryMapper::LocalToAncestorVisualRect() to be not tight, which affects opaqueness-for-hit-test of the cc::Layer during PAC update.

      Yes, I think it will be worth looking at some pages.

    • Because "a/layer-not-opaque-hit-squash-area/value" is small, can we conclude that optimizations to avoid squashing non-hit-test-opaque chunks are not worth pursuing? Initially, I thought yes, but there are many chunks per layer ("a/chunk-opaque-hit/value" + "a/chunk-not-opaque-hit/value" vs "a/layer-opaque-hit/value" + "a/layer-not-opaque-hit-chunk/value"), and chunks seem to be only ~50% opaque to hit testing, so a low ratio is expected. Can we conclude anything about the potential in pursuing optimizations to avoid squashing non-hit-test-opaque chunks?

    • The current data may be not enough for us to conclude. I can experiment and get more data.

  • File third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc:

    • This will over-count frequently-repainted layers. […]

      I added g_doing_full_update to exclude repaint-only updates to avoid the over-count for some layers. It will still over-count all layers in a frequently PAC-updated pages, which gives more weight for such pages, but this doesn't seem to make the already improper weight issue of CT (compared to UMA) much worse.

  • File third_party/blink/renderer/platform/graphics/paint/paint_chunker.cc:

    • What if we have a paint chunk with a solid background (opaque to hit testing) and a child with point […]

      I thought this was a problem, but I verified that pointer-events:none just makes the element itself transparent to hit test, but doesn't affect opaque-for-hit-test of parent elements (thus doesn't affect the existing opaque-for-hit-test of the paint chunk).

To view, visit change 4596916. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia237422ab5ccf76aa5fca75725911276b2a8dcf9
Gerrit-Change-Number: 4596916
Gerrit-PatchSet: 5
Gerrit-Owner: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Sun, 11 Jun 2023 03:51:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Xianzhu Wang <wangx...@chromium.org>
Comment-In-Reply-To: Philip Rogers <p...@chromium.org>

Philip Rogers (Gerrit)

unread,
Jun 11, 2023, 9:02:47 AM6/11/23
to Xianzhu Wang, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, pdr+graphi...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, zol...@webkit.org, chromium...@chromium.org, Dirk Schulze, Stephen Chenney

Attention is currently required from: Xianzhu Wang.

View Change

3 comments:

  • Patchset:

    • Patch Set #4:

      Because of all of the non-opaque-for-hit-test reasons (border radius, pointer events, non-composited clips, etc), I am a little worried that a fully generic solution here would be complex. Would it be worth looking at some of the pages identified in the data to see if there is a pattern?

    • For opaqueness-for-hit-test of paint chunks, we only need to consider the reasons not caused by paint properties. Border radius is considered because the background is clipped using paint operations instead of paint properties during painting.

      Non-opaque-for-hit-test caused by paint properties will cause the result of GeometryMapper::LocalToAncestorVisualRect() to be not tight, which affects opaqueness-for-hit-test of the cc::Layer during PAC update.

    • Before your comment, I did not really understand that the non-tightness will handle the non-composited cases. A solution here does seem easier than I had expected.

  • File third_party/blink/renderer/platform/graphics/compositing/paint_chunks_to_cc_layer.cc:

    • I added g_doing_full_update to exclude repaint-only updates to avoid the over-count for some layers. […]

      Done

  • File third_party/blink/renderer/platform/graphics/paint/paint_chunker.cc:

    • I thought this was a problem, but I verified that pointer-events:none just makes the element itself […]

      ahh, good point!

To view, visit change 4596916. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia237422ab5ccf76aa5fca75725911276b2a8dcf9
Gerrit-Change-Number: 4596916
Gerrit-PatchSet: 5
Gerrit-Owner: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Comment-Date: Sun, 11 Jun 2023 13:02:40 +0000

Mazlum Gulnaz (Gerrit)

unread,
Jun 11, 2023, 10:54:58 PM6/11/23
to Xianzhu Wang, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, pdr+graphi...@chromium.org, spang...@chromium.org, tracing...@chromium.org, wfh+...@chromium.org, zol...@webkit.org, Philip Rogers, chromium...@chromium.org, Dirk Schulze, Stephen Chenney

Attention is currently required from: Xianzhu Wang.

View Change

1 comment:

To view, visit change 4596916. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia237422ab5ccf76aa5fca75725911276b2a8dcf9
Gerrit-Change-Number: 4596916
Gerrit-PatchSet: 5
Gerrit-Owner: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Mazlum Gulnaz <mazlumg...@gmail.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Xianzhu Wang <wangx...@chromium.org>
Gerrit-Comment-Date: Mon, 12 Jun 2023 02:54:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Reply all
Reply to author
Forward
0 new messages