| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 context.forceSubtreeUpdate = true; | 208 context.forceSubtreeUpdate = true; |
| 209 } | 209 } |
| 210 | 210 |
| 211 paintLayer.setPreviousPaintingClipRects(*clipRects); | 211 paintLayer.setPreviousPaintingClipRects(*clipRects); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void PrePaintTreeWalk::walk(const LayoutObject& object, | 214 void PrePaintTreeWalk::walk(const LayoutObject& object, |
| 215 const PrePaintTreeWalkContext& parentContext) { | 215 const PrePaintTreeWalkContext& parentContext) { |
| 216 PrePaintTreeWalkContext context(parentContext); | 216 PrePaintTreeWalkContext context(parentContext); |
| 217 | 217 |
| 218 // This must happen before updateContextForBoxPosition, because the | |
| 219 // latter reads some of the state computed uere. | |
| 220 updateAuxiliaryObjectProperties(object, context); | |
| 221 | |
| 222 // Ensure the current context takes into account the box's position. This can | |
| 223 // force a subtree update due to paint offset changes and must precede any | |
| 224 // early out from the treewalk. | |
| 225 m_propertyTreeBuilder.updateContextForBoxPosition(object, | |
| 226 context.treeBuilderContext); | |
| 227 | |
| 228 // Early out from the treewalk if possible. | 218 // Early out from the treewalk if possible. |
| 229 if (!object.needsPaintPropertyUpdate() && | 219 if (!object.needsPaintPropertyUpdate() && |
| 230 !object.descendantNeedsPaintPropertyUpdate() && | 220 !object.descendantNeedsPaintPropertyUpdate() && |
| 231 !context.treeBuilderContext.forceSubtreeUpdate && | 221 !context.treeBuilderContext.forceSubtreeUpdate && |
| 232 !context.paintInvalidatorContext.forcedSubtreeInvalidationFlags && | 222 !context.paintInvalidatorContext.forcedSubtreeInvalidationFlags && |
| 233 !object | 223 !object |
| 234 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState())
{ | 224 .shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState()) |
| 235 return; | 225 return; |
| 236 } | 226 |
| 227 // This must happen before updatePropertiesForSelf, because the latter reads |
| 228 // some of the state computed here. |
| 229 updateAuxiliaryObjectProperties(object, context); |
| 237 | 230 |
| 238 m_propertyTreeBuilder.updatePropertiesForSelf(object, | 231 m_propertyTreeBuilder.updatePropertiesForSelf(object, |
| 239 context.treeBuilderContext); | 232 context.treeBuilderContext); |
| 240 m_paintInvalidator.invalidatePaintIfNeeded(object, | 233 m_paintInvalidator.invalidatePaintIfNeeded(object, |
| 241 context.paintInvalidatorContext); | 234 context.paintInvalidatorContext); |
| 242 m_propertyTreeBuilder.updatePropertiesForChildren(object, | 235 m_propertyTreeBuilder.updatePropertiesForChildren(object, |
| 243 context.treeBuilderContext); | 236 context.treeBuilderContext); |
| 244 | 237 |
| 245 if (object.isBoxModelObject() && object.hasLayer()) { | 238 if (object.isBoxModelObject() && object.hasLayer()) { |
| 246 if (object.styleRef().hasTransform() || | 239 if (object.styleRef().hasTransform() || |
| (...skipping 27 matching lines...) Expand all Loading... |
| 274 roundedIntPoint(context.treeBuilderContext.current.paintOffset); | 267 roundedIntPoint(context.treeBuilderContext.current.paintOffset); |
| 275 walk(*toFrameView(widget), context); | 268 walk(*toFrameView(widget), context); |
| 276 } | 269 } |
| 277 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 270 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 278 } | 271 } |
| 279 | 272 |
| 280 object.getMutableForPainting().clearPaintFlags(); | 273 object.getMutableForPainting().clearPaintFlags(); |
| 281 } | 274 } |
| 282 | 275 |
| 283 } // namespace blink | 276 } // namespace blink |
| OLD | NEW |