Commit 0fe98e02 authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

content-visibility: Resume graphics layer building if it was blocked.

This patch ensures that if we blocked a graphics layer rebuild because
of a display lock that we continue such a rebuild when the context
is unlocked (or rather we ensure that we rebuild the graphics layer
tree again).

R=wangxianzhu@chromium.org, chrishtr@chromium.org

Fixed: 1113838
Change-Id: I3b904f7c89c74c4d1a370b63382241c6729e1f3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2342464
Commit-Queue: vmpstr <vmpstr@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795928}
parent fd1b1e39
...@@ -737,6 +737,10 @@ bool DisplayLockContext::MarkForCompositingUpdatesIfNeeded() { ...@@ -737,6 +737,10 @@ bool DisplayLockContext::MarkForCompositingUpdatesIfNeeded() {
layout_box->Layer()->SetNeedsCompositingInputsUpdate(); layout_box->Layer()->SetNeedsCompositingInputsUpdate();
needs_compositing_dependent_flag_update_ = false; needs_compositing_dependent_flag_update_ = false;
if (needs_graphics_layer_rebuild_)
layout_box->Layer()->SetNeedsGraphicsLayerRebuild();
needs_graphics_layer_rebuild_ = false;
return true; return true;
} }
return false; return false;
......
...@@ -162,6 +162,11 @@ class CORE_EXPORT DisplayLockContext final ...@@ -162,6 +162,11 @@ class CORE_EXPORT DisplayLockContext final
needs_compositing_dependent_flag_update_ = true; needs_compositing_dependent_flag_update_ = true;
} }
void NotifyGraphicsLayerRebuildBlocked() {
DCHECK(!RuntimeEnabledFeatures::CompositeAfterPaintEnabled());
needs_graphics_layer_rebuild_ = true;
}
// Notify this element will be disconnected. // Notify this element will be disconnected.
void NotifyWillDisconnect(); void NotifyWillDisconnect();
...@@ -363,6 +368,8 @@ class CORE_EXPORT DisplayLockContext final ...@@ -363,6 +368,8 @@ class CORE_EXPORT DisplayLockContext final
// again at the start of the lifecycle. // again at the start of the lifecycle.
bool keep_unlocked_until_lifecycle_ = false; bool keep_unlocked_until_lifecycle_ = false;
bool needs_graphics_layer_rebuild_ = false;
enum class RenderAffectingState : int { enum class RenderAffectingState : int {
kLockRequested, kLockRequested,
kIntersectsViewport, kIntersectsViewport,
......
...@@ -88,6 +88,15 @@ void GraphicsLayerTreeBuilder::RebuildRecursive( ...@@ -88,6 +88,15 @@ void GraphicsLayerTreeBuilder::RebuildRecursive(
bool recursion_blocked_by_display_lock = bool recursion_blocked_by_display_lock =
layer.GetLayoutObject().PrePaintBlockedByDisplayLock( layer.GetLayoutObject().PrePaintBlockedByDisplayLock(
DisplayLockLifecycleTarget::kChildren); DisplayLockLifecycleTarget::kChildren);
// If the recursion is blocked meaningfully (i.e. we would have recursed,
// since the layer has children), then we should inform the display-lock
// context that we blocked a graphics layer recursion, so that we can ensure
// to rebuild the tree once we're unlocked.
if (recursion_blocked_by_display_lock && layer.FirstChild()) {
auto* context = layer.GetLayoutObject().GetDisplayLockContext();
DCHECK(context);
context->NotifyGraphicsLayerRebuildBlocked();
}
if (layer.IsStackingContextWithNegativeZOrderChildren()) { if (layer.IsStackingContextWithNegativeZOrderChildren()) {
if (!recursion_blocked_by_display_lock) { if (!recursion_blocked_by_display_lock) {
......
...@@ -1055,6 +1055,11 @@ void PaintLayer::SetNeedsCompositingInputsUpdate(bool mark_ancestor_flags) { ...@@ -1055,6 +1055,11 @@ void PaintLayer::SetNeedsCompositingInputsUpdate(bool mark_ancestor_flags) {
MarkAncestorChainForFlagsUpdate(NeedsDescendantDependentUpdate); MarkAncestorChainForFlagsUpdate(NeedsDescendantDependentUpdate);
} }
void PaintLayer::SetNeedsGraphicsLayerRebuild() {
if (Compositor())
Compositor()->SetNeedsCompositingUpdate(kCompositingUpdateRebuildTree);
}
void PaintLayer::SetNeedsCheckRasterInvalidation() { void PaintLayer::SetNeedsCheckRasterInvalidation() {
DCHECK_EQ(GetLayoutObject().GetDocument().Lifecycle().GetState(), DCHECK_EQ(GetLayoutObject().GetDocument().Lifecycle().GetState(),
DocumentLifecycle::kInPrePaint); DocumentLifecycle::kInPrePaint);
......
...@@ -821,6 +821,10 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient { ...@@ -821,6 +821,10 @@ class CORE_EXPORT PaintLayer : public DisplayItemClient {
void SetNeedsVisualOverflowRecalc(); void SetNeedsVisualOverflowRecalc();
void SetNeedsCompositingInputsUpdate(bool mark_ancestor_flags = true); void SetNeedsCompositingInputsUpdate(bool mark_ancestor_flags = true);
// Notifies the Compositor if one exists that it should rebuild the graphics
// layer tree.
void SetNeedsGraphicsLayerRebuild();
// Mark this PaintLayer as needing raster invalidation checking after the // Mark this PaintLayer as needing raster invalidation checking after the
// next compositing update step. // next compositing update step.
void SetNeedsCheckRasterInvalidation(); void SetNeedsCheckRasterInvalidation();
......
...@@ -41,7 +41,6 @@ crbug.com/802915 css3/blending/isolation-should-include-non-local-background.htm ...@@ -41,7 +41,6 @@ crbug.com/802915 css3/blending/isolation-should-include-non-local-background.htm
crbug.com/918155 virtual/prefer_compositing_to_lcd_text/scrollbars/overlay-scrollbar-over-child-layer-nested-2.html [ Pass ] crbug.com/918155 virtual/prefer_compositing_to_lcd_text/scrollbars/overlay-scrollbar-over-child-layer-nested-2.html [ Pass ]
crbug.com/918155 virtual/prefer_compositing_to_lcd_text/scrollbars/overlay-scrollbar-over-child-layer-nested.html [ Pass ] crbug.com/918155 virtual/prefer_compositing_to_lcd_text/scrollbars/overlay-scrollbar-over-child-layer-nested.html [ Pass ]
paint/invalidation/compositing/subpixel-offset-scaled-transform-composited.html [ Pass ] paint/invalidation/compositing/subpixel-offset-scaled-transform-composited.html [ Pass ]
crbug.com/1113838 external/wpt/css/css-contain/content-visibility/content-visibility-074.html [ Pass ]
# With CompositeAfterPaint and LayoutNGFragmentItem enabled # With CompositeAfterPaint and LayoutNGFragmentItem enabled
crbug.com/1103138 paint/invalidation/compositing/float-under-composited-inline.html [ Pass Crash ] crbug.com/1103138 paint/invalidation/compositing/float-under-composited-inline.html [ Pass Crash ]
......
...@@ -270,9 +270,6 @@ crbug.com/936084 external/wpt/css/css-sizing/max-content-input-001.html [ Failur ...@@ -270,9 +270,6 @@ crbug.com/936084 external/wpt/css/css-sizing/max-content-input-001.html [ Failur
# Incorrect blending with foreignObject and svg descendants. # Incorrect blending with foreignObject and svg descendants.
crbug.com/1102803 external/wpt/svg/extensibility/foreignObject/isolation-with-svg.html [ Failure ] crbug.com/1102803 external/wpt/svg/extensibility/foreignObject/isolation-with-svg.html [ Failure ]
# Display locking failures
crbug.com/1113838 external/wpt/css/css-contain/content-visibility/content-visibility-074.html [ Failure ]
crbug.com/849459 fragmentation/repeating-thead-under-repeating-thead.html [ Failure ] crbug.com/849459 fragmentation/repeating-thead-under-repeating-thead.html [ Failure ]
# These fail when device_scale_factor is changed, but only for anti-aliasing: # These fail when device_scale_factor is changed, but only for anti-aliasing:
......
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