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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 bool PrePaintTreeWalk::walk(FrameView& frameView, | 47 bool PrePaintTreeWalk::walk(FrameView& frameView, |
48 const PrePaintTreeWalkContext& parentContext) { | 48 const PrePaintTreeWalkContext& parentContext) { |
49 if (frameView.shouldThrottleRendering()) { | 49 if (frameView.shouldThrottleRendering()) { |
50 // The walk was interrupted by throttled rendering so this subtree was not | 50 // The walk was interrupted by throttled rendering so this subtree was not |
51 // fully updated. | 51 // fully updated. |
52 return false; | 52 return false; |
53 } | 53 } |
54 | 54 |
55 PrePaintTreeWalkContext context(parentContext); | 55 PrePaintTreeWalkContext context(parentContext); |
56 | |
57 if (frameView.shouldInvalidateAllPaintAndPaintProperties()) { | |
58 context.treeBuilderContext.forceSubtreeUpdate = true; | |
59 context.paintInvalidatorContext.forcedSubtreeInvalidationFlags |= | |
60 PaintInvalidatorContext::ForcedWholeTreeFullInvalidation; | |
61 frameView.clearShouldInvalidateAllPaintAndPaintProperties(); | |
62 } | |
63 | |
64 m_propertyTreeBuilder.updateProperties(frameView, context.treeBuilderContext); | 56 m_propertyTreeBuilder.updateProperties(frameView, context.treeBuilderContext); |
65 m_paintInvalidator.invalidatePaintIfNeeded(frameView, | 57 m_paintInvalidator.invalidatePaintIfNeeded(frameView, |
66 context.paintInvalidatorContext); | 58 context.paintInvalidatorContext); |
67 | 59 |
68 LayoutView* view = frameView.layoutView(); | 60 LayoutView* view = frameView.layoutView(); |
69 bool descendantsFullyUpdated = view ? walk(*view, context) : true; | 61 bool descendantsFullyUpdated = view ? walk(*view, context) : true; |
70 if (descendantsFullyUpdated) { | 62 if (descendantsFullyUpdated) { |
71 #if DCHECK_IS_ON() | 63 #if DCHECK_IS_ON() |
72 frameView.layoutView()->assertSubtreeClearedPaintInvalidationFlags(); | 64 frameView.layoutView()->assertSubtreeClearedPaintInvalidationFlags(); |
73 #endif | 65 #endif |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 179 |
188 if (descendantsFullyUpdated) { | 180 if (descendantsFullyUpdated) { |
189 // If descendants were not updated, do not clear flags. During the next | 181 // If descendants were not updated, do not clear flags. During the next |
190 // PrePaintTreeWalk, these flags will be used again. | 182 // PrePaintTreeWalk, these flags will be used again. |
191 object.getMutableForPainting().clearPaintFlags(); | 183 object.getMutableForPainting().clearPaintFlags(); |
192 } | 184 } |
193 return descendantsFullyUpdated; | 185 return descendantsFullyUpdated; |
194 } | 186 } |
195 | 187 |
196 } // namespace blink | 188 } // namespace blink |
OLD | NEW |