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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintController.h

Issue 2307623002: [SPv2] Defer decision of raster invalidation after paint for changes z-index, transform, etc. (Closed)
Patch Set: All paint property Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef PaintController_h 5 #ifndef PaintController_h
6 #define PaintController_h 6 #define PaintController_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/RuntimeEnabledFeatures.h" 9 #include "platform/RuntimeEnabledFeatures.h"
10 #include "platform/geometry/IntRect.h" 10 #include "platform/geometry/IntRect.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 protected: 158 protected:
159 PaintController() 159 PaintController()
160 : m_newDisplayItemList(0) 160 : m_newDisplayItemList(0)
161 , m_constructionDisabled(false) 161 , m_constructionDisabled(false)
162 , m_subsequenceCachingDisabled(false) 162 , m_subsequenceCachingDisabled(false)
163 , m_textPainted(false) 163 , m_textPainted(false)
164 , m_imagePainted(false) 164 , m_imagePainted(false)
165 , m_skippingCacheCount(0) 165 , m_skippingCacheCount(0)
166 , m_numCachedNewItems(0) 166 , m_numCachedNewItems(0)
167 , m_currentChunkIsFromCachedSubsequence(true) 167 , m_currentCachedSubsequenceBeginIndexInNewList(kNotFound)
168 #if DCHECK_IS_ON() 168 #if DCHECK_IS_ON()
169 , m_numSequentialMatches(0) 169 , m_numSequentialMatches(0)
170 , m_numOutOfOrderMatches(0) 170 , m_numOutOfOrderMatches(0)
171 , m_numIndexedItems(0) 171 , m_numIndexedItems(0)
172 #endif 172 #endif
173 { 173 {
174 resetCurrentListIndices(); 174 resetCurrentListIndices();
175 } 175 }
176 176
177 private: 177 private:
(...skipping 24 matching lines...) Expand all
202 size_t findOutOfOrderCachedItemForward(const DisplayItem::Id&); 202 size_t findOutOfOrderCachedItemForward(const DisplayItem::Id&);
203 void copyCachedSubsequence(size_t&); 203 void copyCachedSubsequence(size_t&);
204 204
205 // Resets the indices (e.g. m_nextItemToMatch) of m_currentPaintArtifact.get DisplayItemList() 205 // Resets the indices (e.g. m_nextItemToMatch) of m_currentPaintArtifact.get DisplayItemList()
206 // to their initial values. This should be called when the DisplayItemList i n m_currentPaintArtifact 206 // to their initial values. This should be called when the DisplayItemList i n m_currentPaintArtifact
207 // is newly created, or is changed causing the previous indices to be invali d. 207 // is newly created, or is changed causing the previous indices to be invali d.
208 void resetCurrentListIndices(); 208 void resetCurrentListIndices();
209 209
210 void generateChunkRasterInvalidationRects(PaintChunk& newChunk); 210 void generateChunkRasterInvalidationRects(PaintChunk& newChunk);
211 void generateChunkRasterInvalidationRectsComparingOldChunk(PaintChunk& newCh unk, const PaintChunk& oldChunk); 211 void generateChunkRasterInvalidationRectsComparingOldChunk(PaintChunk& newCh unk, const PaintChunk& oldChunk);
212 void generateChunkRasterInvalidationRectsForReorderedItems(PaintChunk& newCh unk, const PaintChunk& oldChunk,
213 Vector<size_t>::const_iterator, Vector<size_t>::const_iterator, Vector<s ize_t>::const_iterator, Vector<size_t>::const_iterator);
212 214
213 #if DCHECK_IS_ON() 215 #if DCHECK_IS_ON()
214 // The following two methods are for checking under-invalidations 216 // The following two methods are for checking under-invalidations
215 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed). 217 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed).
216 void showUnderInvalidationError(const char* reason, const DisplayItem& newIt em, const DisplayItem* oldItem) const; 218 void showUnderInvalidationError(const char* reason, const DisplayItem& newIt em, const DisplayItem* oldItem) const;
217 void checkUnderInvalidation(); 219 void checkUnderInvalidation();
218 bool isCheckingUnderInvalidation() const { return m_underInvalidationCheckin gEnd - m_underInvalidationCheckingBegin > 0; } 220 bool isCheckingUnderInvalidation() const { return m_underInvalidationCheckin gEnd - m_underInvalidationCheckingBegin > 0; }
219 #endif 221 #endif
220 222
221 // The last complete paint artifact. 223 // The last complete paint artifact.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 size_t m_nextItemToMatch; 256 size_t m_nextItemToMatch;
255 257
256 // The next item in the current list to be indexed for out-of-order cache re quests. 258 // The next item in the current list to be indexed for out-of-order cache re quests.
257 size_t m_nextItemToIndex; 259 size_t m_nextItemToIndex;
258 260
259 // Similar to m_outOfOrderItemIndices but 261 // Similar to m_outOfOrderItemIndices but
260 // - the indices are chunk indices in m_currentPaintArtifacts.paintChunks(); 262 // - the indices are chunk indices in m_currentPaintArtifacts.paintChunks();
261 // - chunks are matched not only for requests of cached display items, but a lso non-cached display items. 263 // - chunks are matched not only for requests of cached display items, but a lso non-cached display items.
262 IndicesByClientMap m_outOfOrderChunkIndices; 264 IndicesByClientMap m_outOfOrderChunkIndices;
263 265
264 bool m_currentChunkIsFromCachedSubsequence; 266 size_t m_currentCachedSubsequenceBeginIndexInNewList;
265 size_t m_nextChunkToMatch; 267 size_t m_nextChunkToMatch;
266 268
267 DisplayItemClient::CacheGenerationOrInvalidationReason m_currentCacheGenerat ion; 269 DisplayItemClient::CacheGenerationOrInvalidationReason m_currentCacheGenerat ion;
268 270
269 #if DCHECK_IS_ON() 271 #if DCHECK_IS_ON()
270 int m_numSequentialMatches; 272 int m_numSequentialMatches;
271 int m_numOutOfOrderMatches; 273 int m_numOutOfOrderMatches;
272 int m_numIndexedItems; 274 int m_numIndexedItems;
273 275
274 // This is used to check duplicated ids during createAndAppend(). 276 // This is used to check duplicated ids during createAndAppend().
(...skipping 15 matching lines...) Expand all
290 292
291 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 293 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
292 // A stack recording subsequence clients that are currently painting. 294 // A stack recording subsequence clients that are currently painting.
293 Vector<const DisplayItemClient*> m_currentSubsequenceClients; 295 Vector<const DisplayItemClient*> m_currentSubsequenceClients;
294 #endif 296 #endif
295 }; 297 };
296 298
297 } // namespace blink 299 } // namespace blink
298 300
299 #endif // PaintController_h 301 #endif // PaintController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698