| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 { | 84 { |
| 85 ClientScopeIdMap::iterator it = m_clientScopeIdMap.find(client); | 85 ClientScopeIdMap::iterator it = m_clientScopeIdMap.find(client); |
| 86 int scopeId; | 86 int scopeId; |
| 87 if (it == m_clientScopeIdMap.end()) { | 87 if (it == m_clientScopeIdMap.end()) { |
| 88 m_clientScopeIdMap.add(client, 0); | 88 m_clientScopeIdMap.add(client, 0); |
| 89 scopeId = 0; | 89 scopeId = 0; |
| 90 } else { | 90 } else { |
| 91 scopeId = ++it->value; | 91 scopeId = ++it->value; |
| 92 } | 92 } |
| 93 m_scopeStack.append(Scope(client, scopeId)); | 93 m_scopeStack.append(Scope(client, scopeId)); |
| 94 beginSkippingCache(); |
| 94 } | 95 } |
| 95 | 96 |
| 96 void DisplayItemList::endScope(DisplayItemClient client) | 97 void DisplayItemList::endScope(DisplayItemClient client) |
| 97 { | 98 { |
| 98 m_scopeStack.removeLast(); | 99 m_scopeStack.removeLast(); |
| 100 endSkippingCache(); |
| 99 } | 101 } |
| 100 | 102 |
| 101 void DisplayItemList::invalidate(DisplayItemClient client) | 103 void DisplayItemList::invalidate(DisplayItemClient client) |
| 102 { | 104 { |
| 103 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 105 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
| 104 // Can only be called during layout/paintInvalidation, not during painting. | 106 // Can only be called during layout/paintInvalidation, not during painting. |
| 105 ASSERT(m_newDisplayItems.isEmpty()); | 107 ASSERT(m_newDisplayItems.isEmpty()); |
| 106 updateValidlyCachedClientsIfNeeded(); | 108 updateValidlyCachedClientsIfNeeded(); |
| 107 m_validlyCachedClients.remove(client); | 109 m_validlyCachedClients.remove(client); |
| 108 } | 110 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 463 |
| 462 void DisplayItemList::replay(GraphicsContext& context) const | 464 void DisplayItemList::replay(GraphicsContext& context) const |
| 463 { | 465 { |
| 464 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 466 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
| 465 ASSERT(m_newDisplayItems.isEmpty()); | 467 ASSERT(m_newDisplayItems.isEmpty()); |
| 466 for (auto& displayItem : m_currentDisplayItems) | 468 for (auto& displayItem : m_currentDisplayItems) |
| 467 displayItem.replay(context); | 469 displayItem.replay(context); |
| 468 } | 470 } |
| 469 | 471 |
| 470 } // namespace blink | 472 } // namespace blink |
| OLD | NEW |