Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Side by Side Diff: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp

Issue 2614093002: Combine LayoutObject::previousPaintOffset and paintOffset in paint properties (Closed)
Patch Set: Resolve conflict Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698