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/TraceEvent.h" | 9 #include "platform/TraceEvent.h" |
10 #include "platform/graphics/paint/DrawingDisplayItem.h" | 10 #include "platform/graphics/paint/DrawingDisplayItem.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 bool DisplayItemList::clientCacheIsValid(DisplayItemClient client) const | 137 bool DisplayItemList::clientCacheIsValid(DisplayItemClient client) const |
138 { | 138 { |
139 if (skippingCache()) | 139 if (skippingCache()) |
140 return false; | 140 return false; |
141 updateValidlyCachedClientsIfNeeded(); | 141 updateValidlyCachedClientsIfNeeded(); |
142 return m_validlyCachedClients.contains(client); | 142 return m_validlyCachedClients.contains(client); |
143 } | 143 } |
144 | 144 |
145 void DisplayItemList::invalidatePaintOffset(DisplayItemClient client) | 145 void DisplayItemList::invalidatePaintOffset(const DisplayItemClientWrapper& clie
nt) |
146 { | 146 { |
147 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 147 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
148 | 148 |
149 updateValidlyCachedClientsIfNeeded(); | 149 updateValidlyCachedClientsIfNeeded(); |
150 m_validlyCachedClients.remove(client); | 150 m_validlyCachedClients.remove(client.displayItemClient()); |
| 151 |
| 152 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali
dationObjects) |
| 153 m_trackedPaintInvalidationObjects->append(client.debugName()); |
151 | 154 |
152 #if ENABLE(ASSERT) | 155 #if ENABLE(ASSERT) |
153 m_clientsWithPaintOffsetInvalidations.add(client); | 156 m_clientsWithPaintOffsetInvalidations.add(client.displayItemClient()); |
154 | 157 |
155 // Ensure no phases slipped in using the old paint offset which would indica
te | 158 // Ensure no phases slipped in using the old paint offset which would indica
te |
156 // different phases used different paint offsets, which should not happen. | 159 // different phases used different paint offsets, which should not happen. |
157 for (const auto& item : m_newDisplayItems) | 160 for (const auto& item : m_newDisplayItems) |
158 ASSERT(!item.isCached() || item.client() != client); | 161 ASSERT(!item.isCached() || item.client() != client.displayItemClient()); |
159 #endif | 162 #endif |
160 } | 163 } |
161 | 164 |
162 #if ENABLE(ASSERT) | 165 #if ENABLE(ASSERT) |
163 bool DisplayItemList::paintOffsetWasInvalidated(DisplayItemClient client) const | 166 bool DisplayItemList::paintOffsetWasInvalidated(DisplayItemClient client) const |
164 { | 167 { |
165 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 168 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
166 return m_clientsWithPaintOffsetInvalidations.contains(client); | 169 return m_clientsWithPaintOffsetInvalidations.contains(client); |
167 } | 170 } |
168 #endif | 171 #endif |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 | 616 |
614 void DisplayItemList::replay(GraphicsContext& context) | 617 void DisplayItemList::replay(GraphicsContext& context) |
615 { | 618 { |
616 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 619 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
617 ASSERT(m_newDisplayItems.isEmpty()); | 620 ASSERT(m_newDisplayItems.isEmpty()); |
618 for (DisplayItem& displayItem : m_currentDisplayItems) | 621 for (DisplayItem& displayItem : m_currentDisplayItems) |
619 displayItem.replay(context); | 622 displayItem.replay(context); |
620 } | 623 } |
621 | 624 |
622 } // namespace blink | 625 } // namespace blink |
OLD | NEW |