Commit 41e0bf69 authored by Daniel Libby's avatar Daniel Libby Committed by Commit Bot

Remove non-compositing descendant DisplayItemClient invalidation

This is currently only used for scrollbar parts, which do not have
descendant layers. Instead just set needs paint on the painting layer
and invalidate the DisplayItemClient (the same LayoutObject the
ObjectPaintInvalidator is initialized with) via
SlowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient.

There was not any unit test coverage for
InvalidatePaintIncludingNonCompositingDescendants which uses the same
traversal algorithm, so convert tests of the deleted method to use this
one instead, and validate only the paint invalidation side-effects.

Bug: 1007989

Change-Id: Ic9849f889958300941bc9a48d97cf7f04a91c786
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247157Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Daniel Libby <dlibby@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#779554}
parent 21fb68f9
......@@ -407,8 +407,8 @@ void CustomScrollbar::PositionScrollbarParts() {
void CustomScrollbar::InvalidateDisplayItemClientsOfScrollbarParts() {
for (auto& part : parts_) {
ObjectPaintInvalidator(*part.value)
.InvalidateDisplayItemClientsIncludingNonCompositingDescendants(
PaintInvalidationReason::kScrollControl);
.SlowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
*part.value, PaintInvalidationReason::kScrollControl);
}
}
......
......@@ -134,21 +134,6 @@ static void SetPaintingLayerNeedsRepaintDuringTraverse(
}
}
void ObjectPaintInvalidator::
InvalidateDisplayItemClientsIncludingNonCompositingDescendants(
PaintInvalidationReason reason) {
// This is valid because we want to invalidate the client in the display item
// list of the current backing.
DisableCompositingQueryAsserts disabler;
SlowSetPaintingLayerNeedsRepaint();
TraverseNonCompositingDescendantsInPaintOrder(
object_, [reason](const LayoutObject& object) {
SetPaintingLayerNeedsRepaintDuringTraverse(object);
object.InvalidateDisplayItemClients(reason);
});
}
void ObjectPaintInvalidator::
InvalidatePaintIncludingNonCompositingDescendants() {
DCHECK(!RuntimeEnabledFeatures::CompositeAfterPaintEnabled());
......
......@@ -36,9 +36,6 @@ class CORE_EXPORT ObjectPaintInvalidator {
InvalidateDisplayItemClient(client, reason);
}
void InvalidateDisplayItemClientsIncludingNonCompositingDescendants(
PaintInvalidationReason);
// The caller should ensure the painting layer has been SetNeedsRepaint
// before calling this function.
void InvalidateDisplayItemClient(const DisplayItemClient& client,
......
......@@ -3024,13 +3024,13 @@ void PaintLayerScrollableArea::InvalidatePaintOfScrollControlsIfNeeded(
SetScrollCornerAndResizerVisualRect(scroll_corner_and_resizer_visual_rect);
if (LayoutCustomScrollbarPart* scroll_corner = ScrollCorner()) {
ObjectPaintInvalidator(*scroll_corner)
.InvalidateDisplayItemClientsIncludingNonCompositingDescendants(
PaintInvalidationReason::kScrollControl);
.SlowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
*scroll_corner, PaintInvalidationReason::kScrollControl);
}
if (LayoutCustomScrollbarPart* resizer = Resizer()) {
ObjectPaintInvalidator(*resizer)
.InvalidateDisplayItemClientsIncludingNonCompositingDescendants(
PaintInvalidationReason::kScrollControl);
.SlowSetPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(
*resizer, PaintInvalidationReason::kScrollControl);
}
if (!GraphicsLayerForScrollCorner()) {
context.painting_layer->SetNeedsRepaint();
......
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