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