| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/paint/DisplayItemList.h" | 6 #include "platform/graphics/paint/DisplayItemList.h" |
| 7 | 7 |
| 8 #include "platform/NotImplemented.h" | 8 #include "platform/NotImplemented.h" |
| 9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
| 10 #include "platform/TraceEvent.h" | 10 #include "platform/TraceEvent.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // repainted ones, and appending new items. | 202 // repainted ones, and appending new items. |
| 203 // - For CachedDisplayItem, copy the corresponding cached DrawingDisplayItem; | 203 // - For CachedDisplayItem, copy the corresponding cached DrawingDisplayItem; |
| 204 // - FIXME: Re-enable SubtreeCachedDisplayItem: | 204 // - FIXME: Re-enable SubtreeCachedDisplayItem: |
| 205 // For SubtreeCachedDisplayItem, copy the cached display items between the | 205 // For SubtreeCachedDisplayItem, copy the cached display items between the |
| 206 // corresponding BeginSubtreeDisplayItem and EndSubtreeDisplayItem (incl.); | 206 // corresponding BeginSubtreeDisplayItem and EndSubtreeDisplayItem (incl.); |
| 207 // - Otherwise, copy the new display item. | 207 // - Otherwise, copy the new display item. |
| 208 // | 208 // |
| 209 // The algorithm is O(|m_currentDisplayItems| + |m_newDisplayItems|). | 209 // The algorithm is O(|m_currentDisplayItems| + |m_newDisplayItems|). |
| 210 // Coefficients are related to the ratio of out-of-order [Subtree]CachedDisplayI
tems | 210 // Coefficients are related to the ratio of out-of-order [Subtree]CachedDisplayI
tems |
| 211 // and the average number of (Drawing|BeginSubtree)DisplayItems per client. | 211 // and the average number of (Drawing|BeginSubtree)DisplayItems per client. |
| 212 void DisplayItemList::commitNewDisplayItems() | 212 // |
| 213 // TODO: Implement the DisplayListDiff algorithm for SlimmingPaintV2. |
| 214 void DisplayItemList::commitNewDisplayItems(DisplayListDiff*) |
| 213 { | 215 { |
| 214 TRACE_EVENT2("blink,benchmark", "DisplayItemList::commitNewDisplayItems", "c
urrent_display_list_size", (int)m_currentDisplayItems.size(), | 216 TRACE_EVENT2("blink,benchmark", "DisplayItemList::commitNewDisplayItems", "c
urrent_display_list_size", (int)m_currentDisplayItems.size(), |
| 215 "num_non_cached_new_items", (int)m_newDisplayItems.size() - m_numCachedI
tems); | 217 "num_non_cached_new_items", (int)m_newDisplayItems.size() - m_numCachedI
tems); |
| 216 | 218 |
| 217 // These data structures are used during painting only. | 219 // These data structures are used during painting only. |
| 218 ASSERT(m_scopeStack.isEmpty()); | 220 ASSERT(m_scopeStack.isEmpty()); |
| 219 m_scopeStack.clear(); | 221 m_scopeStack.clear(); |
| 220 m_nextScope = 1; | 222 m_nextScope = 1; |
| 221 ASSERT(!skippingCache()); | 223 ASSERT(!skippingCache()); |
| 222 #if ENABLE(ASSERT) | 224 #if ENABLE(ASSERT) |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 519 |
| 518 void DisplayItemList::replay(GraphicsContext& context) | 520 void DisplayItemList::replay(GraphicsContext& context) |
| 519 { | 521 { |
| 520 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 522 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
| 521 ASSERT(m_newDisplayItems.isEmpty()); | 523 ASSERT(m_newDisplayItems.isEmpty()); |
| 522 for (DisplayItem& displayItem : m_currentDisplayItems) | 524 for (DisplayItem& displayItem : m_currentDisplayItems) |
| 523 displayItem.replay(context); | 525 displayItem.replay(context); |
| 524 } | 526 } |
| 525 | 527 |
| 526 } // namespace blink | 528 } // namespace blink |
| OLD | NEW |