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 <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include "platform/PlatformExport.h" | 10 #include "platform/PlatformExport.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 enum Usage { kForNormalUsage, kForPaintRecordBuilder }; | 188 enum Usage { kForNormalUsage, kForPaintRecordBuilder }; |
189 void SetUsage(Usage usage) { usage_ = usage; } | 189 void SetUsage(Usage usage) { usage_ = usage; } |
190 bool IsForPaintRecordBuilder() const { | 190 bool IsForPaintRecordBuilder() const { |
191 return usage_ == kForPaintRecordBuilder; | 191 return usage_ == kForPaintRecordBuilder; |
192 } | 192 } |
193 #endif | 193 #endif |
194 | 194 |
195 void SetTracksRasterInvalidations(bool value); | 195 void SetTracksRasterInvalidations(bool value); |
196 RasterInvalidationTrackingMap<const PaintChunk>* | 196 RasterInvalidationTrackingMap<const PaintChunk>* |
197 PaintChunksRasterInvalidationTrackingMap() { | 197 PaintChunksRasterInvalidationTrackingMap() { |
198 return paint_chunks_raster_invalidation_tracking_map_.get(); | 198 return raster_invalidation_tracking_map_.get(); |
199 } | 199 } |
200 | 200 |
201 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 201 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
202 void BeginShouldKeepAlive(const DisplayItemClient&); | 202 void BeginShouldKeepAlive(const DisplayItemClient&); |
203 | 203 |
204 void BeginSubsequence(const DisplayItemClient& client) { | 204 void BeginSubsequence(const DisplayItemClient& client) { |
205 current_subsequence_clients_.push_back(&client); | 205 current_subsequence_clients_.push_back(&client); |
206 BeginShouldKeepAlive(client); | 206 BeginShouldKeepAlive(client); |
207 } | 207 } |
208 | 208 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 size_t FindCachedItem(const DisplayItem::Id&); | 273 size_t FindCachedItem(const DisplayItem::Id&); |
274 size_t FindOutOfOrderCachedItemForward(const DisplayItem::Id&); | 274 size_t FindOutOfOrderCachedItemForward(const DisplayItem::Id&); |
275 void CopyCachedSubsequence(size_t begin_index, size_t end_index); | 275 void CopyCachedSubsequence(size_t begin_index, size_t end_index); |
276 | 276 |
277 // Resets the indices (e.g. m_nextItemToMatch) of | 277 // Resets the indices (e.g. m_nextItemToMatch) of |
278 // m_currentPaintArtifact.getDisplayItemList() to their initial values. This | 278 // m_currentPaintArtifact.getDisplayItemList() to their initial values. This |
279 // should be called when the DisplayItemList in m_currentPaintArtifact is | 279 // should be called when the DisplayItemList in m_currentPaintArtifact is |
280 // newly created, or is changed causing the previous indices to be invalid. | 280 // newly created, or is changed causing the previous indices to be invalid. |
281 void ResetCurrentListIndices(); | 281 void ResetCurrentListIndices(); |
282 | 282 |
283 void GenerateChunkRasterInvalidationRects(PaintChunk& new_chunk); | 283 void GenerateRasterInvalidations(PaintChunk& new_chunk); |
284 void GenerateChunkRasterInvalidationRectsComparingOldChunk( | 284 void GenerateRasterInvalidationsComparingChunks(PaintChunk& new_chunk, |
285 PaintChunk& new_chunk, | 285 const PaintChunk& old_chunk); |
286 const PaintChunk& old_chunk); | 286 inline void AddRasterInvalidation(const DisplayItemClient*, |
287 void AddRasterInvalidationInfo(const DisplayItemClient*, | 287 PaintChunk&, |
288 PaintChunk&, | 288 const FloatRect&); |
289 const FloatRect&); | 289 void TrackRasterInvalidation(const DisplayItemClient*, |
| 290 PaintChunk&, |
| 291 const FloatRect&); |
290 | 292 |
291 // The following two methods are for checking under-invalidations | 293 // The following two methods are for checking under-invalidations |
292 // (when RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled). | 294 // (when RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled). |
293 void ShowUnderInvalidationError(const char* reason, | 295 void ShowUnderInvalidationError(const char* reason, |
294 const DisplayItem& new_item, | 296 const DisplayItem& new_item, |
295 const DisplayItem* old_item) const; | 297 const DisplayItem* old_item) const; |
296 | 298 |
297 void ShowSequenceUnderInvalidationError(const char* reason, | 299 void ShowSequenceUnderInvalidationError(const char* reason, |
298 const DisplayItemClient&, | 300 const DisplayItemClient&, |
299 int start, | 301 int start, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 size_t under_invalidation_checking_begin_; | 406 size_t under_invalidation_checking_begin_; |
405 size_t under_invalidation_checking_end_; | 407 size_t under_invalidation_checking_end_; |
406 | 408 |
407 // Number of probable under-invalidations that have been skipped temporarily | 409 // Number of probable under-invalidations that have been skipped temporarily |
408 // because the mismatching display items may be removed in the future because | 410 // because the mismatching display items may be removed in the future because |
409 // of no-op pairs or compositing folding. | 411 // of no-op pairs or compositing folding. |
410 int skipped_probable_under_invalidation_count_; | 412 int skipped_probable_under_invalidation_count_; |
411 String under_invalidation_message_prefix_; | 413 String under_invalidation_message_prefix_; |
412 | 414 |
413 std::unique_ptr<RasterInvalidationTrackingMap<const PaintChunk>> | 415 std::unique_ptr<RasterInvalidationTrackingMap<const PaintChunk>> |
414 paint_chunks_raster_invalidation_tracking_map_; | 416 raster_invalidation_tracking_map_; |
415 | 417 |
416 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 418 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
417 // A stack recording subsequence clients that are currently painting. | 419 // A stack recording subsequence clients that are currently painting. |
418 Vector<const DisplayItemClient*> current_subsequence_clients_; | 420 Vector<const DisplayItemClient*> current_subsequence_clients_; |
419 #endif | 421 #endif |
420 | 422 |
421 typedef HashMap<const DisplayItemClient*, SubsequenceMarkers> | 423 typedef HashMap<const DisplayItemClient*, SubsequenceMarkers> |
422 CachedSubsequenceMap; | 424 CachedSubsequenceMap; |
423 CachedSubsequenceMap current_cached_subsequences_; | 425 CachedSubsequenceMap current_cached_subsequences_; |
424 CachedSubsequenceMap new_cached_subsequences_; | 426 CachedSubsequenceMap new_cached_subsequences_; |
425 size_t last_cached_subsequence_end_; | 427 size_t last_cached_subsequence_end_; |
426 | 428 |
427 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedSubsequenceSwapOrder); | 429 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedSubsequenceSwapOrder); |
428 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedNestedSubsequenceUpdate); | 430 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedNestedSubsequenceUpdate); |
429 }; | 431 }; |
430 | 432 |
431 } // namespace blink | 433 } // namespace blink |
432 | 434 |
433 #endif // PaintController_h | 435 #endif // PaintController_h |
OLD | NEW |