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

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

Issue 2114653003: New PaintController under-invalidation checking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CommitOnTheWay
Patch Set: Doc m_underInvalidationCheckingBegin and End Created 4 years, 5 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 void copyCachedSubsequence(DisplayItemList::iterator&); 205 void copyCachedSubsequence(DisplayItemList::iterator&);
206 206
207 // Resets the iterators (e.g. m_nextItemToMatch) of m_currentPaintArtifact.g etDisplayItemList() 207 // Resets the iterators (e.g. m_nextItemToMatch) of m_currentPaintArtifact.g etDisplayItemList()
208 // to their initial values. This should be called when the DisplayItemList i n m_currentPaintArtifact 208 // to their initial values. This should be called when the DisplayItemList i n m_currentPaintArtifact
209 // is newly created, or is changed causing the previous iterators to be inva lid. 209 // is newly created, or is changed causing the previous iterators to be inva lid.
210 void resetCurrentListIterators(); 210 void resetCurrentListIterators();
211 211
212 #if DCHECK_IS_ON() 212 #if DCHECK_IS_ON()
213 // The following two methods are for checking under-invalidations 213 // The following two methods are for checking under-invalidations
214 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed). 214 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed).
215 void checkUnderInvalidation(DisplayItemList::iterator& newIt, DisplayItemLis t::iterator& currentIt); 215 void showUnderInvalidationError(const char* reason, const DisplayItem& newIt em, const DisplayItem& oldItem) const;
216 void checkCachedDisplayItemIsUnchanged(const char* messagePrefix, const Disp layItem& newItem, const DisplayItem& oldItem); 216 void checkUnderInvalidation();
217 bool isCheckingUnderInvalidation() const { return m_underInvalidationCheckin gEnd - m_underInvalidationCheckingBegin > 0; }
217 #endif 218 #endif
218 219
219 // The last complete paint artifact. 220 // The last complete paint artifact.
220 // In SPv2, this includes paint chunks as well as display items. 221 // In SPv2, this includes paint chunks as well as display items.
221 PaintArtifact m_currentPaintArtifact; 222 PaintArtifact m_currentPaintArtifact;
222 223
223 // Data being used to build the next paint artifact. 224 // Data being used to build the next paint artifact.
224 DisplayItemList m_newDisplayItemList; 225 DisplayItemList m_newDisplayItemList;
225 PaintChunker m_newPaintChunks; 226 PaintChunker m_newPaintChunks;
226 227
(...skipping 28 matching lines...) Expand all
255 256
256 DisplayItemClient::CacheGenerationOrInvalidationReason m_currentCacheGenerat ion; 257 DisplayItemClient::CacheGenerationOrInvalidationReason m_currentCacheGenerat ion;
257 258
258 #if DCHECK_IS_ON() 259 #if DCHECK_IS_ON()
259 int m_numSequentialMatches; 260 int m_numSequentialMatches;
260 int m_numOutOfOrderMatches; 261 int m_numOutOfOrderMatches;
261 int m_numIndexedItems; 262 int m_numIndexedItems;
262 263
263 // This is used to check duplicated ids during createAndAppend(). 264 // This is used to check duplicated ids during createAndAppend().
264 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; 265 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
266
267 // These are set in useCachedDrawingIfPossible() and useCachedSubsequenceIfP ossible()
268 // when we could use cached drawing or subsequence and under-invalidation ch ecking is on,
269 // indicating the begin and end of the cached drawing or subsequence in the current list.
270 // The functions return false to let the client do actual painting, and Pain tController
271 // will check if the actual painting results are the same as the cached.
272 DisplayItemList::iterator m_underInvalidationCheckingBegin;
273 DisplayItemList::iterator m_underInvalidationCheckingEnd;
274 String m_underInvalidationMessagePrefix;
265 #endif 275 #endif
266 276
267 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 277 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
268 // A stack recording subsequence clients that are currently painting. 278 // A stack recording subsequence clients that are currently painting.
269 Vector<const DisplayItemClient*> m_currentSubsequenceClients; 279 Vector<const DisplayItemClient*> m_currentSubsequenceClients;
270 #endif 280 #endif
271 }; 281 };
272 282
273 } // namespace blink 283 } // namespace blink
274 284
275 #endif // PaintController_h 285 #endif // PaintController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698