| 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 DisplayItemList_h | 5 #ifndef DisplayItemList_h |
| 6 #define DisplayItemList_h | 6 #define DisplayItemList_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/LayoutPoint.h" | 10 #include "platform/geometry/LayoutPoint.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 commitNewDisplayItems(); | 127 commitNewDisplayItems(); |
| 128 replay(context); | 128 replay(context); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void appendToWebDisplayItemList(WebDisplayItemList*); | 131 void appendToWebDisplayItemList(WebDisplayItemList*); |
| 132 void commitNewDisplayItemsAndAppendToWebDisplayItemList(WebDisplayItemList*)
; | 132 void commitNewDisplayItemsAndAppendToWebDisplayItemList(WebDisplayItemList*)
; |
| 133 | 133 |
| 134 bool displayItemConstructionIsDisabled() const { return m_constructionDisabl
ed; } | 134 bool displayItemConstructionIsDisabled() const { return m_constructionDisabl
ed; } |
| 135 void setDisplayItemConstructionIsDisabled(const bool disable) { m_constructi
onDisabled = disable; } | 135 void setDisplayItemConstructionIsDisabled(const bool disable) { m_constructi
onDisabled = disable; } |
| 136 | 136 |
| 137 #if ENABLE(ASSERT) | 137 // Returns displayItems added using createAndAppend() since beginning or the
last |
| 138 size_t newDisplayItemsSize() const { return m_newDisplayItems.size(); } | 138 // commitNewDisplayItems(). Use with care. |
| 139 #endif | 139 DisplayItems& newDisplayItems() { return m_newDisplayItems; } |
| 140 | 140 |
| 141 #ifndef NDEBUG | 141 #ifndef NDEBUG |
| 142 void showDebugData() const; | 142 void showDebugData() const; |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 void startTrackingPaintInvalidationObjects() | 145 void startTrackingPaintInvalidationObjects() |
| 146 { | 146 { |
| 147 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 147 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 148 m_trackedPaintInvalidationObjects = adoptPtr(new Vector<String>()); | 148 m_trackedPaintInvalidationObjects = adoptPtr(new Vector<String>()); |
| 149 } | 149 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 162 DisplayItemList() | 162 DisplayItemList() |
| 163 : m_currentDisplayItems(0) | 163 : m_currentDisplayItems(0) |
| 164 , m_newDisplayItems(kInitialDisplayItemsCapacity * kMaximumDisplayItemSi
ze) | 164 , m_newDisplayItems(kInitialDisplayItemsCapacity * kMaximumDisplayItemSi
ze) |
| 165 , m_validlyCachedClientsDirty(false) | 165 , m_validlyCachedClientsDirty(false) |
| 166 , m_constructionDisabled(false) | 166 , m_constructionDisabled(false) |
| 167 , m_skippingCacheCount(0) | 167 , m_skippingCacheCount(0) |
| 168 , m_numCachedItems(0) | 168 , m_numCachedItems(0) |
| 169 , m_nextScope(1) { } | 169 , m_nextScope(1) { } |
| 170 | 170 |
| 171 private: | 171 private: |
| 172 friend class DisplayItemListTest; | |
| 173 friend class DisplayItemListPaintTest; | |
| 174 friend class DisplayItemListPaintTestForSlimmingPaintV2; | |
| 175 friend class LayoutObjectDrawingRecorderTest; | |
| 176 friend class LayoutObjectDrawingRecorderTestForSlimmingPaintV2; | |
| 177 | |
| 178 // Set new item state (scopes, cache skipping, etc) for a new item. | 172 // Set new item state (scopes, cache skipping, etc) for a new item. |
| 179 void processNewItem(DisplayItem&); | 173 void processNewItem(DisplayItem&); |
| 180 | 174 |
| 181 void updateValidlyCachedClientsIfNeeded() const; | 175 void updateValidlyCachedClientsIfNeeded() const; |
| 182 | 176 |
| 183 // Update the recorded paint offsets to remove any items that no longer have | 177 // Update the recorded paint offsets to remove any items that no longer have |
| 184 // corresponding cached display items. | 178 // corresponding cached display items. |
| 185 // TODO(pdr): Remove this once the paint offset cache is on LayoutObject. | 179 // TODO(pdr): Remove this once the paint offset cache is on LayoutObject. |
| 186 void removeUnneededPaintOffsetEntries(); | 180 void removeUnneededPaintOffsetEntries(); |
| 187 | 181 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // the duplicated ids are from. | 244 // the duplicated ids are from. |
| 251 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; | 245 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; |
| 252 #endif | 246 #endif |
| 253 | 247 |
| 254 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; | 248 OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects; |
| 255 }; | 249 }; |
| 256 | 250 |
| 257 } // namespace blink | 251 } // namespace blink |
| 258 | 252 |
| 259 #endif // DisplayItemList_h | 253 #endif // DisplayItemList_h |
| OLD | NEW |