| Index: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| index bc59d57869f2f1cd2c9e5df2f5555e721242fad7..e617cb16368927db90ca409c5640c6e06dfe0653 100644
|
| --- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
|
| @@ -60,12 +60,15 @@ void PrePaintTreeWalk::walk(FrameView& frameView,
|
| if (localContext.needToUpdatePaintPropertySubtree)
|
| frameView.setNeedsPaintPropertyUpdate();
|
|
|
| - m_propertyTreeBuilder.updateProperties(frameView,
|
| - localContext.treeBuilderContext);
|
| + auto propertyTreeStructureChanged = m_propertyTreeBuilder.updateProperties(
|
| + frameView, localContext.treeBuilderContext);
|
|
|
| m_paintInvalidator.invalidatePaintIfNeeded(
|
| frameView, localContext.paintInvalidatorContext);
|
|
|
| + if (propertyTreeStructureChanged)
|
| + localContext.needToUpdatePaintPropertySubtree = true;
|
| +
|
| if (LayoutView* layoutView = frameView.layoutView())
|
| walk(*layoutView, localContext);
|
|
|
| @@ -99,6 +102,17 @@ void PrePaintTreeWalk::walk(const LayoutObject& object,
|
| }
|
| }
|
|
|
| + // Early out from the treewalk if possible.
|
| + if (!object.descendantNeedsPaintPropertyUpdate() &&
|
| + !localContext.needToUpdatePaintPropertySubtree &&
|
| + !context.paintInvalidatorContext.forcedSubtreeInvalidationFlags &&
|
| + !object.shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()) {
|
| + object.getMutableForPainting().clearPaintInvalidationFlags();
|
| + object.getMutableForPainting().clearNeedsPaintPropertyUpdate();
|
| + object.getMutableForPainting().clearDescendantNeedsPaintPropertyUpdate();
|
| + return;
|
| + }
|
| +
|
| // Paint properties can depend on their ancestor properties so ensure the
|
| // entire subtree is rebuilt on any changes.
|
| // TODO(pdr): Add additional granularity to the needs update approach such as
|
| @@ -114,19 +128,25 @@ void PrePaintTreeWalk::walk(const LayoutObject& object,
|
| // positioned descendants if their containers are between the multi-column
|
| // container and the spanner. See PaintPropertyTreeBuilder for details.
|
| localContext.treeBuilderContext.isUnderMultiColumnSpanner = true;
|
| - walk(*toLayoutMultiColumnSpannerPlaceholder(object)
|
| - .layoutObjectInFlowThread(),
|
| - localContext);
|
| + const auto& placeholder = toLayoutMultiColumnSpannerPlaceholder(object);
|
| + walk(*placeholder.layoutObjectInFlowThread(), localContext);
|
| object.getMutableForPainting().clearPaintInvalidationFlags();
|
| + object.getMutableForPainting().clearNeedsPaintPropertyUpdate();
|
| + object.getMutableForPainting().clearDescendantNeedsPaintPropertyUpdate();
|
| return;
|
| }
|
|
|
| - m_propertyTreeBuilder.updatePropertiesForSelf(
|
| + bool propertyTreeStructureChanged = false;
|
| + propertyTreeStructureChanged |= m_propertyTreeBuilder.updatePropertiesForSelf(
|
| object, localContext.treeBuilderContext);
|
| m_paintInvalidator.invalidatePaintIfNeeded(
|
| object, localContext.paintInvalidatorContext);
|
| - m_propertyTreeBuilder.updatePropertiesForChildren(
|
| - object, localContext.treeBuilderContext);
|
| + propertyTreeStructureChanged |=
|
| + m_propertyTreeBuilder.updatePropertiesForChildren(
|
| + object, localContext.treeBuilderContext);
|
| +
|
| + if (propertyTreeStructureChanged)
|
| + localContext.needToUpdatePaintPropertySubtree = true;
|
|
|
| for (const LayoutObject* child = object.slowFirstChild(); child;
|
| child = child->nextSibling()) {
|
| @@ -152,6 +172,7 @@ void PrePaintTreeWalk::walk(const LayoutObject& object,
|
|
|
| object.getMutableForPainting().clearPaintInvalidationFlags();
|
| object.getMutableForPainting().clearNeedsPaintPropertyUpdate();
|
| + object.getMutableForPainting().clearDescendantNeedsPaintPropertyUpdate();
|
| }
|
|
|
| } // namespace blink
|
|
|