| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 // repainted ones, and appending new items. | 209 // repainted ones, and appending new items. |
| 210 // - For CachedDisplayItem, copy the corresponding cached DrawingDisplayItem; | 210 // - For CachedDisplayItem, copy the corresponding cached DrawingDisplayItem; |
| 211 // - FIXME: Re-enable SubtreeCachedDisplayItem: | 211 // - FIXME: Re-enable SubtreeCachedDisplayItem: |
| 212 // For SubtreeCachedDisplayItem, copy the cached display items between the | 212 // For SubtreeCachedDisplayItem, copy the cached display items between the |
| 213 // corresponding BeginSubtreeDisplayItem and EndSubtreeDisplayItem (incl.); | 213 // corresponding BeginSubtreeDisplayItem and EndSubtreeDisplayItem (incl.); |
| 214 // - Otherwise, copy the new display item. | 214 // - Otherwise, copy the new display item. |
| 215 // | 215 // |
| 216 // The algorithm is O(|m_currentDisplayItems| + |m_newDisplayItems|). | 216 // The algorithm is O(|m_currentDisplayItems| + |m_newDisplayItems|). |
| 217 // Coefficients are related to the ratio of out-of-order [Subtree]CachedDisplayI
tems | 217 // Coefficients are related to the ratio of out-of-order [Subtree]CachedDisplayI
tems |
| 218 // and the average number of (Drawing|BeginSubtree)DisplayItems per client. | 218 // and the average number of (Drawing|BeginSubtree)DisplayItems per client. |
| 219 void DisplayItemList::commitNewDisplayItems() | 219 // TODO(chrishtr); implement filling of displayListDiff. |
| 220 void DisplayItemList::commitNewDisplayItems(DisplayListDiff* displayListDiff) |
| 220 { | 221 { |
| 221 TRACE_EVENT2("blink,benchmark", "DisplayItemList::commitNewDisplayItems", "c
urrent_display_list_size", (int)m_currentDisplayItems.size(), | 222 TRACE_EVENT2("blink,benchmark", "DisplayItemList::commitNewDisplayItems", "c
urrent_display_list_size", (int)m_currentDisplayItems.size(), |
| 222 "num_non_cached_new_items", (int)m_newDisplayItems.size() - m_numCachedI
tems); | 223 "num_non_cached_new_items", (int)m_newDisplayItems.size() - m_numCachedI
tems); |
| 223 | 224 |
| 224 // These data structures are used during painting only. | 225 // These data structures are used during painting only. |
| 225 m_clientScopeIdMap.clear(); | 226 m_clientScopeIdMap.clear(); |
| 226 ASSERT(m_scopeStack.isEmpty()); | 227 ASSERT(m_scopeStack.isEmpty()); |
| 227 m_scopeStack.clear(); | 228 m_scopeStack.clear(); |
| 228 ASSERT(!skippingCache()); | 229 ASSERT(!skippingCache()); |
| 229 #if ENABLE(ASSERT) | 230 #if ENABLE(ASSERT) |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 522 |
| 522 void DisplayItemList::replay(GraphicsContext& context) | 523 void DisplayItemList::replay(GraphicsContext& context) |
| 523 { | 524 { |
| 524 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 525 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
| 525 ASSERT(m_newDisplayItems.empty()); | 526 ASSERT(m_newDisplayItems.empty()); |
| 526 for (auto displayItem : m_currentDisplayItems) | 527 for (auto displayItem : m_currentDisplayItems) |
| 527 displayItem->replay(context); | 528 displayItem->replay(context); |
| 528 } | 529 } |
| 529 | 530 |
| 530 } // namespace blink | 531 } // namespace blink |
| OLD | NEW |