| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 #endif | 141 #endif |
| 142 | 142 |
| 143 // This is called only if we are tracking paint invalidation for testing, or
DCHECK_IS_ON() | 143 // This is called only if we are tracking paint invalidation for testing, or
DCHECK_IS_ON() |
| 144 // for error checking and debugging. | 144 // for error checking and debugging. |
| 145 void displayItemClientWasInvalidated(const DisplayItemClient&); | 145 void displayItemClientWasInvalidated(const DisplayItemClient&); |
| 146 | 146 |
| 147 #if DCHECK_IS_ON() | 147 #if DCHECK_IS_ON() |
| 148 bool hasInvalidations() { return !m_invalidations.isEmpty(); } | 148 bool hasInvalidations() { return !m_invalidations.isEmpty(); } |
| 149 #endif | 149 #endif |
| 150 | 150 |
| 151 void startTrackingPaintInvalidationObjects() | |
| 152 { | |
| 153 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | |
| 154 m_trackedPaintInvalidationObjects = adoptPtr(new Vector<String>()); | |
| 155 } | |
| 156 void stopTrackingPaintInvalidationObjects() | |
| 157 { | |
| 158 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | |
| 159 m_trackedPaintInvalidationObjects = nullptr; | |
| 160 } | |
| 161 Vector<String> trackedPaintInvalidationObjects() | |
| 162 { | |
| 163 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | |
| 164 return m_trackedPaintInvalidationObjects ? *m_trackedPaintInvalidationOb
jects : Vector<String>(); | |
| 165 } | |
| 166 | |
| 167 #if DCHECK_IS_ON() | 151 #if DCHECK_IS_ON() |
| 168 void assertDisplayItemClientsAreLive(); | 152 void assertDisplayItemClientsAreLive(); |
| 169 #endif | 153 #endif |
| 170 | 154 |
| 171 protected: | 155 protected: |
| 172 PaintController() | 156 PaintController() |
| 173 : m_newDisplayItemList(kInitialDisplayItemListCapacityBytes) | 157 : m_newDisplayItemList(kInitialDisplayItemListCapacityBytes) |
| 174 , m_constructionDisabled(false) | 158 , m_constructionDisabled(false) |
| 175 , m_subsequenceCachingDisabled(false) | 159 , m_subsequenceCachingDisabled(false) |
| 176 , m_textPainted(false) | 160 , m_textPainted(false) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 #if DCHECK_IS_ON() | 229 #if DCHECK_IS_ON() |
| 246 // Record the debug names of invalidated clients for assertion and debugging
. | 230 // Record the debug names of invalidated clients for assertion and debugging
. |
| 247 Vector<String> m_invalidations; | 231 Vector<String> m_invalidations; |
| 248 | 232 |
| 249 // This is used to check duplicated ids during add(). We could also check | 233 // This is used to check duplicated ids during add(). We could also check |
| 250 // during commitNewDisplayItems(), but checking during add() helps developer | 234 // during commitNewDisplayItems(), but checking during add() helps developer |
| 251 // easily find where the duplicated ids are from. | 235 // easily find where the duplicated ids are from. |
| 252 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; | 236 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; |
| 253 #endif | 237 #endif |
| 254 | 238 |
| 255 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; | |
| 256 | |
| 257 DisplayItemCacheGeneration m_currentCacheGeneration; | 239 DisplayItemCacheGeneration m_currentCacheGeneration; |
| 258 }; | 240 }; |
| 259 | 241 |
| 260 } // namespace blink | 242 } // namespace blink |
| 261 | 243 |
| 262 #endif // PaintController_h | 244 #endif // PaintController_h |
| OLD | NEW |