| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 sk_sp<SkPicture>, | 180 sk_sp<SkPicture>, |
| 181 const LayoutSize& offsetFromLayoutObject); | 181 const LayoutSize& offsetFromLayoutObject); |
| 182 | 182 |
| 183 void showDebugData() const { showDebugDataInternal(false); } | 183 void showDebugData() const { showDebugDataInternal(false); } |
| 184 #ifndef NDEBUG | 184 #ifndef NDEBUG |
| 185 void showDebugDataWithPictures() const { showDebugDataInternal(true); } | 185 void showDebugDataWithPictures() const { showDebugDataInternal(true); } |
| 186 #endif | 186 #endif |
| 187 | 187 |
| 188 #if DCHECK_IS_ON() | 188 #if DCHECK_IS_ON() |
| 189 void assertDisplayItemClientsAreLive(); | 189 void assertDisplayItemClientsAreLive(); |
| 190 | |
| 191 enum Usage { ForNormalUsage, ForSkPictureBuilder }; | |
| 192 void setUsage(Usage usage) { m_usage = usage; } | |
| 193 bool isForSkPictureBuilder() const { return m_usage == ForSkPictureBuilder; } | |
| 194 #endif | 190 #endif |
| 195 | 191 |
| 196 void setTracksRasterInvalidations(bool value); | 192 void setTracksRasterInvalidations(bool value); |
| 197 RasterInvalidationTrackingMap<const PaintChunk>* | 193 RasterInvalidationTrackingMap<const PaintChunk>* |
| 198 paintChunksRasterInvalidationTrackingMap() { | 194 paintChunksRasterInvalidationTrackingMap() { |
| 199 return m_paintChunksRasterInvalidationTrackingMap.get(); | 195 return m_paintChunksRasterInvalidationTrackingMap.get(); |
| 200 } | 196 } |
| 201 | 197 |
| 202 protected: | 198 protected: |
| 203 PaintController() | 199 PaintController() |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 344 |
| 349 #ifndef NDEBUG | 345 #ifndef NDEBUG |
| 350 int m_numSequentialMatches; | 346 int m_numSequentialMatches; |
| 351 int m_numOutOfOrderMatches; | 347 int m_numOutOfOrderMatches; |
| 352 int m_numIndexedItems; | 348 int m_numIndexedItems; |
| 353 #endif | 349 #endif |
| 354 | 350 |
| 355 #if DCHECK_IS_ON() | 351 #if DCHECK_IS_ON() |
| 356 // This is used to check duplicated ids during createAndAppend(). | 352 // This is used to check duplicated ids during createAndAppend(). |
| 357 IndicesByClientMap m_newDisplayItemIndicesByClient; | 353 IndicesByClientMap m_newDisplayItemIndicesByClient; |
| 358 | |
| 359 Usage m_usage; | |
| 360 #endif | 354 #endif |
| 361 | 355 |
| 362 // These are set in useCachedDrawingIfPossible() and | 356 // These are set in useCachedDrawingIfPossible() and |
| 363 // useCachedSubsequenceIfPossible() when we could use cached drawing or | 357 // useCachedSubsequenceIfPossible() when we could use cached drawing or |
| 364 // subsequence and under-invalidation checking is on, indicating the begin and | 358 // subsequence and under-invalidation checking is on, indicating the begin and |
| 365 // end of the cached drawing or subsequence in the current list. The functions | 359 // end of the cached drawing or subsequence in the current list. The functions |
| 366 // return false to let the client do actual painting, and PaintController will | 360 // return false to let the client do actual painting, and PaintController will |
| 367 // check if the actual painting results are the same as the cached. | 361 // check if the actual painting results are the same as the cached. |
| 368 size_t m_underInvalidationCheckingBegin; | 362 size_t m_underInvalidationCheckingBegin; |
| 369 size_t m_underInvalidationCheckingEnd; | 363 size_t m_underInvalidationCheckingEnd; |
| 370 | 364 |
| 371 // Number of probable under-invalidations that have been skipped temporarily | 365 // Number of probable under-invalidations that have been skipped temporarily |
| 372 // because the mismatching display items may be removed in the future because | 366 // because the mismatching display items may be removed in the future because |
| 373 // of no-op pairs or compositing folding. | 367 // of no-op pairs or compositing folding. |
| 374 int m_skippedProbableUnderInvalidationCount; | 368 int m_skippedProbableUnderInvalidationCount; |
| 375 String m_underInvalidationMessagePrefix; | 369 String m_underInvalidationMessagePrefix; |
| 376 | 370 |
| 377 std::unique_ptr<RasterInvalidationTrackingMap<const PaintChunk>> | 371 std::unique_ptr<RasterInvalidationTrackingMap<const PaintChunk>> |
| 378 m_paintChunksRasterInvalidationTrackingMap; | 372 m_paintChunksRasterInvalidationTrackingMap; |
| 379 | 373 |
| 380 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 374 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
| 381 // A stack recording subsequence clients that are currently painting. | 375 // A stack recording subsequence clients that are currently painting. |
| 382 Vector<const DisplayItemClient*> m_currentSubsequenceClients; | 376 Vector<const DisplayItemClient*> m_currentSubsequenceClients; |
| 383 #endif | 377 #endif |
| 384 }; | 378 }; |
| 385 | 379 |
| 386 } // namespace blink | 380 } // namespace blink |
| 387 | 381 |
| 388 #endif // PaintController_h | 382 #endif // PaintController_h |
| OLD | NEW |