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

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

Issue 2874553002: [SPv2] Fix layout test crashes about raster invalidation (Closed)
Patch Set: - Created 3 years, 7 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 <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
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 GenerateChunkRasterInvalidationRects(PaintChunk& new_chunk);
284 void GenerateChunkRasterInvalidationRectsComparingOldChunk( 284 void GenerateChunkRasterInvalidationRectsComparingOldChunk(
285 PaintChunk& new_chunk, 285 PaintChunk& new_chunk,
286 const PaintChunk& old_chunk); 286 const PaintChunk& old_chunk);
287 void AddRasterInvalidationInfo(const DisplayItemClient*, 287 void AddRasterInvalidation(const DisplayItemClient*,
288 PaintChunk&, 288 PaintChunk&,
289 const FloatRect&); 289 const FloatRect&);
290 290
291 // The following two methods are for checking under-invalidations 291 // The following two methods are for checking under-invalidations
292 // (when RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled). 292 // (when RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled).
293 void ShowUnderInvalidationError(const char* reason, 293 void ShowUnderInvalidationError(const char* reason,
294 const DisplayItem& new_item, 294 const DisplayItem& new_item,
295 const DisplayItem* old_item) const; 295 const DisplayItem* old_item) const;
296 296
297 void ShowSequenceUnderInvalidationError(const char* reason, 297 void ShowSequenceUnderInvalidationError(const char* reason,
298 const DisplayItemClient&, 298 const DisplayItemClient&,
299 int start, 299 int start,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 size_t under_invalidation_checking_begin_; 404 size_t under_invalidation_checking_begin_;
405 size_t under_invalidation_checking_end_; 405 size_t under_invalidation_checking_end_;
406 406
407 // Number of probable under-invalidations that have been skipped temporarily 407 // Number of probable under-invalidations that have been skipped temporarily
408 // because the mismatching display items may be removed in the future because 408 // because the mismatching display items may be removed in the future because
409 // of no-op pairs or compositing folding. 409 // of no-op pairs or compositing folding.
410 int skipped_probable_under_invalidation_count_; 410 int skipped_probable_under_invalidation_count_;
411 String under_invalidation_message_prefix_; 411 String under_invalidation_message_prefix_;
412 412
413 std::unique_ptr<RasterInvalidationTrackingMap<const PaintChunk>> 413 std::unique_ptr<RasterInvalidationTrackingMap<const PaintChunk>>
414 paint_chunks_raster_invalidation_tracking_map_; 414 raster_invalidation_tracking_map_;
415 415
416 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 416 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
417 // A stack recording subsequence clients that are currently painting. 417 // A stack recording subsequence clients that are currently painting.
418 Vector<const DisplayItemClient*> current_subsequence_clients_; 418 Vector<const DisplayItemClient*> current_subsequence_clients_;
419 #endif 419 #endif
420 420
421 typedef HashMap<const DisplayItemClient*, SubsequenceMarkers> 421 typedef HashMap<const DisplayItemClient*, SubsequenceMarkers>
422 CachedSubsequenceMap; 422 CachedSubsequenceMap;
423 CachedSubsequenceMap current_cached_subsequences_; 423 CachedSubsequenceMap current_cached_subsequences_;
424 CachedSubsequenceMap new_cached_subsequences_; 424 CachedSubsequenceMap new_cached_subsequences_;
425 size_t last_cached_subsequence_end_; 425 size_t last_cached_subsequence_end_;
426 426
427 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedSubsequenceSwapOrder); 427 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedSubsequenceSwapOrder);
428 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedNestedSubsequenceUpdate); 428 FRIEND_TEST_ALL_PREFIXES(PaintControllerTest, CachedNestedSubsequenceUpdate);
429 }; 429 };
430 430
431 } // namespace blink 431 } // namespace blink
432 432
433 #endif // PaintController_h 433 #endif // PaintController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698