| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/PrePaintTreeWalk.h" | 5 #include "core/paint/PrePaintTreeWalk.h" |
| 6 | 6 |
| 7 #include "core/dom/DocumentLifecycle.h" | 7 #include "core/dom/DocumentLifecycle.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" | 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return descendantsFullyUpdated; | 121 return descendantsFullyUpdated; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // This must happen before updateContextForBoxPosition, because the | 124 // This must happen before updateContextForBoxPosition, because the |
| 125 // latter reads some of the state computed uere. | 125 // latter reads some of the state computed uere. |
| 126 updateAuxiliaryObjectProperties(object, context); | 126 updateAuxiliaryObjectProperties(object, context); |
| 127 | 127 |
| 128 // Ensure the current context takes into account the box's position. This can | 128 // Ensure the current context takes into account the box's position. This can |
| 129 // force a subtree update due to paint offset changes and must precede any | 129 // force a subtree update due to paint offset changes and must precede any |
| 130 // early out from the treewalk. | 130 // early out from the treewalk. |
| 131 LayoutPoint oldPaintOffset = object.paintOffset(); |
| 131 m_propertyTreeBuilder.updateContextForBoxPosition(object, | 132 m_propertyTreeBuilder.updateContextForBoxPosition(object, |
| 132 context.treeBuilderContext); | 133 context.treeBuilderContext); |
| 133 | 134 |
| 134 // Early out from the treewalk if possible. | 135 // Early out from the treewalk if possible. |
| 135 if (!object.needsPaintPropertyUpdate() && | 136 if (!object.needsPaintPropertyUpdate() && |
| 136 !object.descendantNeedsPaintPropertyUpdate() && | 137 !object.descendantNeedsPaintPropertyUpdate() && |
| 137 !context.treeBuilderContext.forceSubtreeUpdate && | 138 !context.treeBuilderContext.forceSubtreeUpdate && |
| 138 !context.paintInvalidatorContext.forcedSubtreeInvalidationFlags && | 139 !context.paintInvalidatorContext.forcedSubtreeInvalidationFlags && |
| 139 !object | 140 !object |
| 140 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState())
{ | 141 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState())
{ |
| 141 // Even though the subtree was not walked, we know that a walk will not | 142 // Even though the subtree was not walked, we know that a walk will not |
| 142 // change anything and can return true as if the subtree was fully updated. | 143 // change anything and can return true as if the subtree was fully updated. |
| 143 return true; | 144 return true; |
| 144 } | 145 } |
| 145 | 146 |
| 146 m_propertyTreeBuilder.updatePropertiesForSelf(object, | 147 m_propertyTreeBuilder.updatePropertiesForSelf(object, |
| 147 context.treeBuilderContext); | 148 context.treeBuilderContext); |
| 148 m_paintInvalidator.invalidatePaintIfNeeded(object, | 149 m_paintInvalidator.invalidatePaintIfNeeded(object, oldPaintOffset, |
| 149 context.paintInvalidatorContext); | 150 context.paintInvalidatorContext); |
| 150 m_propertyTreeBuilder.updatePropertiesForChildren(object, | 151 m_propertyTreeBuilder.updatePropertiesForChildren(object, |
| 151 context.treeBuilderContext); | 152 context.treeBuilderContext); |
| 152 | 153 |
| 153 bool descendantsFullyUpdated = true; | 154 bool descendantsFullyUpdated = true; |
| 154 for (const LayoutObject* child = object.slowFirstChild(); child; | 155 for (const LayoutObject* child = object.slowFirstChild(); child; |
| 155 child = child->nextSibling()) { | 156 child = child->nextSibling()) { |
| 156 // Column spanners are walked through their placeholders. See above. | 157 // Column spanners are walked through their placeholders. See above. |
| 157 if (child->isColumnSpanAll()) | 158 if (child->isColumnSpanAll()) |
| 158 continue; | 159 continue; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 179 | 180 |
| 180 if (descendantsFullyUpdated) { | 181 if (descendantsFullyUpdated) { |
| 181 // If descendants were not updated, do not clear flags. During the next | 182 // If descendants were not updated, do not clear flags. During the next |
| 182 // PrePaintTreeWalk, these flags will be used again. | 183 // PrePaintTreeWalk, these flags will be used again. |
| 183 object.getMutableForPainting().clearPaintFlags(); | 184 object.getMutableForPainting().clearPaintFlags(); |
| 184 } | 185 } |
| 185 return descendantsFullyUpdated; | 186 return descendantsFullyUpdated; |
| 186 } | 187 } |
| 187 | 188 |
| 188 } // namespace blink | 189 } // namespace blink |
| OLD | NEW |