| 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 void setSubsequenceCachingIsDisabled(bool disable) { | 159 void setSubsequenceCachingIsDisabled(bool disable) { |
| 160 m_subsequenceCachingDisabled = disable; | 160 m_subsequenceCachingDisabled = disable; |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool textPainted() const { return m_textPainted; } | 163 bool textPainted() const { return m_textPainted; } |
| 164 void setTextPainted() { m_textPainted = true; } | 164 void setTextPainted() { m_textPainted = true; } |
| 165 bool imagePainted() const { return m_imagePainted; } | 165 bool imagePainted() const { return m_imagePainted; } |
| 166 void setImagePainted() { m_imagePainted = true; } | 166 void setImagePainted() { m_imagePainted = true; } |
| 167 | 167 |
| 168 bool nonDefaultBackgroundColorPainted() const { |
| 169 return m_nonDefaultBackgroundColorPainted; |
| 170 } |
| 171 void setNonDefaultBackgroundColorPainted() { |
| 172 m_nonDefaultBackgroundColorPainted = true; |
| 173 } |
| 174 |
| 168 // Returns displayItemList added using createAndAppend() since beginning or | 175 // Returns displayItemList added using createAndAppend() since beginning or |
| 169 // the last commitNewDisplayItems(). Use with care. | 176 // the last commitNewDisplayItems(). Use with care. |
| 170 DisplayItemList& newDisplayItemList() { return m_newDisplayItemList; } | 177 DisplayItemList& newDisplayItemList() { return m_newDisplayItemList; } |
| 171 | 178 |
| 172 void appendDebugDrawingAfterCommit(const DisplayItemClient&, | 179 void appendDebugDrawingAfterCommit(const DisplayItemClient&, |
| 173 sk_sp<SkPicture>, | 180 sk_sp<SkPicture>, |
| 174 const LayoutSize& offsetFromLayoutObject); | 181 const LayoutSize& offsetFromLayoutObject); |
| 175 | 182 |
| 176 void showDebugData() const { showDebugDataInternal(false); } | 183 void showDebugData() const { showDebugDataInternal(false); } |
| 177 #ifndef NDEBUG | 184 #ifndef NDEBUG |
| (...skipping 10 matching lines...) Expand all Loading... |
| 188 return m_paintChunksRasterInvalidationTrackingMap.get(); | 195 return m_paintChunksRasterInvalidationTrackingMap.get(); |
| 189 } | 196 } |
| 190 | 197 |
| 191 protected: | 198 protected: |
| 192 PaintController() | 199 PaintController() |
| 193 : m_newDisplayItemList(0), | 200 : m_newDisplayItemList(0), |
| 194 m_constructionDisabled(false), | 201 m_constructionDisabled(false), |
| 195 m_subsequenceCachingDisabled(false), | 202 m_subsequenceCachingDisabled(false), |
| 196 m_textPainted(false), | 203 m_textPainted(false), |
| 197 m_imagePainted(false), | 204 m_imagePainted(false), |
| 205 m_nonDefaultBackgroundColorPainted(false), |
| 198 m_skippingCacheCount(0), | 206 m_skippingCacheCount(0), |
| 199 m_numCachedNewItems(0), | 207 m_numCachedNewItems(0), |
| 200 m_currentCachedSubsequenceBeginIndexInNewList(kNotFound) | 208 m_currentCachedSubsequenceBeginIndexInNewList(kNotFound) |
| 201 #ifndef NDEBUG | 209 #ifndef NDEBUG |
| 202 , | 210 , |
| 203 m_numSequentialMatches(0), | 211 m_numSequentialMatches(0), |
| 204 m_numOutOfOrderMatches(0), | 212 m_numOutOfOrderMatches(0), |
| 205 m_numIndexedItems(0) | 213 m_numIndexedItems(0) |
| 206 #endif | 214 #endif |
| 207 { | 215 { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 bool m_constructionDisabled; | 299 bool m_constructionDisabled; |
| 292 | 300 |
| 293 // Allows subsequence caching to be disabled to test the cost of display item | 301 // Allows subsequence caching to be disabled to test the cost of display item |
| 294 // caching. | 302 // caching. |
| 295 bool m_subsequenceCachingDisabled; | 303 bool m_subsequenceCachingDisabled; |
| 296 | 304 |
| 297 // Indicates this PaintController has ever had text. It is never reset to | 305 // Indicates this PaintController has ever had text. It is never reset to |
| 298 // false. | 306 // false. |
| 299 bool m_textPainted; | 307 bool m_textPainted; |
| 300 bool m_imagePainted; | 308 bool m_imagePainted; |
| 309 bool m_nonDefaultBackgroundColorPainted; |
| 301 | 310 |
| 302 int m_skippingCacheCount; | 311 int m_skippingCacheCount; |
| 303 | 312 |
| 304 int m_numCachedNewItems; | 313 int m_numCachedNewItems; |
| 305 | 314 |
| 306 // Stores indices to valid cacheable display items in | 315 // Stores indices to valid cacheable display items in |
| 307 // m_currentPaintArtifact.displayItemList() that have not been matched by | 316 // m_currentPaintArtifact.displayItemList() that have not been matched by |
| 308 // requests of cached display items (using useCachedDrawingIfPossible() and | 317 // requests of cached display items (using useCachedDrawingIfPossible() and |
| 309 // useCachedSubsequenceIfPossible()) during sequential matching. The indexed | 318 // useCachedSubsequenceIfPossible()) during sequential matching. The indexed |
| 310 // items will be matched by later out-of-order requests of cached display | 319 // items will be matched by later out-of-order requests of cached display |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 373 |
| 365 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 374 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
| 366 // A stack recording subsequence clients that are currently painting. | 375 // A stack recording subsequence clients that are currently painting. |
| 367 Vector<const DisplayItemClient*> m_currentSubsequenceClients; | 376 Vector<const DisplayItemClient*> m_currentSubsequenceClients; |
| 368 #endif | 377 #endif |
| 369 }; | 378 }; |
| 370 | 379 |
| 371 } // namespace blink | 380 } // namespace blink |
| 372 | 381 |
| 373 #endif // PaintController_h | 382 #endif // PaintController_h |
| OLD | NEW |