Commit 9a8e96b6 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Do not early out from the prepaint tree walk if a subtree walk is needed

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I36517164645aad4ac3132c8a510bb8ddab024a9f
Reviewed-on: https://chromium-review.googlesource.com/1086274
Commit-Queue: Philip Rogers <pdr@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566425}
parent cdb62454
......@@ -596,7 +596,7 @@ void PaintInvalidator::InvalidatePaint(
UpdatePaintInvalidationContainer(object, context);
UpdateEmptyVisualRectFlag(object, context);
if (!object.ShouldCheckForPaintInvalidation() && !context.subtree_flags)
if (!object.ShouldCheckForPaintInvalidation() && !context.NeedsSubtreeWalk())
return;
unsigned tree_builder_index = 0;
......
......@@ -54,6 +54,14 @@ struct CORE_EXPORT PaintInvalidatorContext {
(subtree_flags & PaintInvalidatorContext::kSubtreeVisualRectUpdate);
}
bool NeedsSubtreeWalk() const {
return subtree_flags &
(kSubtreeInvalidationChecking | kSubtreeVisualRectUpdate |
kSubtreeFullInvalidation |
kSubtreeFullInvalidationForStackedContents |
kSubtreeSVGResourceChange);
}
const PaintInvalidatorContext* ParentContext() const {
return parent_context_accessor_.ParentContext();
}
......@@ -64,6 +72,7 @@ struct CORE_EXPORT PaintInvalidatorContext {
ParentContextAccessor parent_context_accessor_;
public:
// When adding new subtree flags, ensure |NeedsSubtreeWalk| is updated.
enum SubtreeFlag {
kSubtreeInvalidationChecking = 1 << 0,
kSubtreeVisualRectUpdate = 1 << 1,
......
......@@ -364,6 +364,7 @@ void PrePaintTreeWalk::Walk(const LayoutObject& object) {
// Early out from the tree walk if possible.
if (!needs_tree_builder_context_update &&
!object.ShouldCheckForPaintInvalidation() &&
!parent_context().paint_invalidator_context.NeedsSubtreeWalk() &&
!NeedsEffectiveWhitelistedTouchActionUpdate(object, parent_context()) &&
!NeedsHitTestingPaintInvalidation(object, parent_context())) {
return;
......
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