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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 void DisplayItemList::endScope() | 111 void DisplayItemList::endScope() |
112 { | 112 { |
113 m_scopeStack.removeLast(); | 113 m_scopeStack.removeLast(); |
114 endSkippingCache(); | 114 endSkippingCache(); |
115 } | 115 } |
116 | 116 |
117 void DisplayItemList::invalidate(DisplayItemClient client) | 117 void DisplayItemList::invalidate(DisplayItemClient client) |
118 { | 118 { |
119 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 119 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
120 // Can only be called during layout/paintInvalidation, not during painting. | 120 // Paint invalidation may occur before or during painting. If the latter, |
121 ASSERT(m_newDisplayItems.isEmpty()); | 121 // we should not invalidate any client which has already has display items. |
| 122 ASSERT(!m_newDisplayItemIndicesByClient.contains(client)); |
122 updateValidlyCachedClientsIfNeeded(); | 123 updateValidlyCachedClientsIfNeeded(); |
123 m_validlyCachedClients.remove(client); | 124 m_validlyCachedClients.remove(client); |
124 updateSubtreeIndicesByClientIfNeeded(); | 125 updateSubtreeIndicesByClientIfNeeded(); |
125 m_subtreeIndicesByClient.remove(client); | 126 m_subtreeIndicesByClient.remove(client); |
126 } | 127 } |
127 | 128 |
128 void DisplayItemList::invalidateAll() | 129 void DisplayItemList::invalidateAll() |
129 { | 130 { |
130 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 131 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
131 // Can only be called during layout/paintInvalidation, not during painting. | 132 // Can only be called during layout/paintInvalidation, not during painting. |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 574 |
574 void DisplayItemList::replay(GraphicsContext& context) | 575 void DisplayItemList::replay(GraphicsContext& context) |
575 { | 576 { |
576 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 577 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
577 ASSERT(m_newDisplayItems.isEmpty()); | 578 ASSERT(m_newDisplayItems.isEmpty()); |
578 for (DisplayItem& displayItem : m_currentDisplayItems) | 579 for (DisplayItem& displayItem : m_currentDisplayItems) |
579 displayItem.replay(context); | 580 displayItem.replay(context); |
580 } | 581 } |
581 | 582 |
582 } // namespace blink | 583 } // namespace blink |
OLD | NEW |