| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 void PrePaintTreeWalk::walk(FrameView& frameView, | 38 void PrePaintTreeWalk::walk(FrameView& frameView, |
| 39 const PrePaintTreeWalkContext& context) { | 39 const PrePaintTreeWalkContext& context) { |
| 40 if (frameView.shouldThrottleRendering()) | 40 if (frameView.shouldThrottleRendering()) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 PrePaintTreeWalkContext localContext(context); | 43 PrePaintTreeWalkContext localContext(context); |
| 44 m_propertyTreeBuilder.buildTreeNodes(frameView, | 44 m_propertyTreeBuilder.buildTreeNodes(frameView, |
| 45 localContext.treeBuilderContext); | 45 localContext.treeBuilderContext); |
| 46 | 46 |
| 47 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 47 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
| 48 m_paintInvalidator.invalidatePaintIfNeeded( | 48 m_paintInvalidator.invalidatePaintIfNeeded( |
| 49 frameView, localContext.paintInvalidatorContext); | 49 frameView, localContext.paintInvalidatorContext); |
| 50 } |
| 50 | 51 |
| 51 if (LayoutView* layoutView = frameView.layoutView()) | 52 if (LayoutView* layoutView = frameView.layoutView()) |
| 52 walk(*layoutView, localContext); | 53 walk(*layoutView, localContext); |
| 54 |
| 55 #if DCHECK_IS_ON() |
| 56 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 57 frameView.layoutView()->assertSubtreeClearedPaintInvalidationFlags(); |
| 58 #endif |
| 53 } | 59 } |
| 54 | 60 |
| 55 void PrePaintTreeWalk::walk(const LayoutObject& object, | 61 void PrePaintTreeWalk::walk(const LayoutObject& object, |
| 56 const PrePaintTreeWalkContext& context) { | 62 const PrePaintTreeWalkContext& context) { |
| 57 PrePaintTreeWalkContext localContext(context); | 63 PrePaintTreeWalkContext localContext(context); |
| 58 | 64 |
| 59 if (object.isLayoutMultiColumnSpannerPlaceholder()) { | 65 if (object.isLayoutMultiColumnSpannerPlaceholder()) { |
| 60 // Walk multi-column spanner as if it replaces the placeholder. | 66 // Walk multi-column spanner as if it replaces the placeholder. |
| 61 // Set the flag so that the tree builder can specially handle out-of-flow | 67 // Set the flag so that the tree builder can specially handle out-of-flow |
| 62 // positioned descendants if their containers are between the multi-column | 68 // positioned descendants if their containers are between the multi-column |
| 63 // container and the spanner. See PaintPropertyTreeBuilder for details. | 69 // container and the spanner. See PaintPropertyTreeBuilder for details. |
| 64 localContext.treeBuilderContext.isUnderMultiColumnSpanner = true; | 70 localContext.treeBuilderContext.isUnderMultiColumnSpanner = true; |
| 71 object.getMutableForPainting().clearPaintInvalidationFlags(); |
| 65 walk(*toLayoutMultiColumnSpannerPlaceholder(object) | 72 walk(*toLayoutMultiColumnSpannerPlaceholder(object) |
| 66 .layoutObjectInFlowThread(), | 73 .layoutObjectInFlowThread(), |
| 67 localContext); | 74 localContext); |
| 68 return; | 75 return; |
| 69 } | 76 } |
| 70 | 77 |
| 71 m_propertyTreeBuilder.buildTreeNodesForSelf(object, | 78 m_propertyTreeBuilder.buildTreeNodesForSelf(object, |
| 72 localContext.treeBuilderContext); | 79 localContext.treeBuilderContext); |
| 73 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 80 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 74 m_paintInvalidator.invalidatePaintIfNeeded( | 81 m_paintInvalidator.invalidatePaintIfNeeded( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 93 widget->frameRect().location(); | 100 widget->frameRect().location(); |
| 94 localContext.treeBuilderContext.current.paintOffset = | 101 localContext.treeBuilderContext.current.paintOffset = |
| 95 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset); | 102 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset); |
| 96 walk(*toFrameView(widget), localContext); | 103 walk(*toFrameView(widget), localContext); |
| 97 } | 104 } |
| 98 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). | 105 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). |
| 99 } | 106 } |
| 100 } | 107 } |
| 101 | 108 |
| 102 } // namespace blink | 109 } // namespace blink |
| OLD | NEW |