| 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 #ifndef NDEBUG | 10 #ifndef NDEBUG |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 ASSERT(m_newPaints.isEmpty()); | 21 ASSERT(m_newPaints.isEmpty()); |
| 22 return m_paintList; | 22 return m_paintList; |
| 23 } | 23 } |
| 24 | 24 |
| 25 void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem) | 25 void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem) |
| 26 { | 26 { |
| 27 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 27 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
| 28 | 28 |
| 29 if (displayItem->isEnd()) { | 29 if (displayItem->isEnd()) { |
| 30 ASSERT(!m_newPaints.isEmpty()); | 30 ASSERT(!m_newPaints.isEmpty()); |
| 31 if (m_newPaints.last()->isBegin()) { | 31 if (m_newPaints.last()->isBegin() && !m_newPaints.last()->drawsContent()
) { |
| 32 ASSERT(displayItem->isEndAndPairedWith(*m_newPaints.last())); | 32 ASSERT(displayItem->isEndAndPairedWith(*m_newPaints.last())); |
| 33 // Remove the beginning display item of this empty pair. | 33 // Remove the beginning display item of this empty pair. |
| 34 m_newPaints.removeLast(); | 34 m_newPaints.removeLast(); |
| 35 #if ENABLE(ASSERT) | 35 #if ENABLE(ASSERT) |
| 36 if (RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled())
{ | 36 if (RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled())
{ |
| 37 // Also remove the index pointing to the removed display item. | 37 // Also remove the index pointing to the removed display item. |
| 38 Vector<size_t>& indices = m_newDisplayItemIndicesByClient.find(d
isplayItem->client())->value; | 38 Vector<size_t>& indices = m_newDisplayItemIndicesByClient.find(d
isplayItem->client())->value; |
| 39 if (!indices.isEmpty() && indices.last() == m_newPaints.size()) | 39 if (!indices.isEmpty() && indices.last() == m_newPaints.size()) |
| 40 indices.removeLast(); | 40 indices.removeLast(); |
| 41 } | 41 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 #endif // ifndef NDEBUG | 239 #endif // ifndef NDEBUG |
| 240 | 240 |
| 241 void DisplayItemList::replay(GraphicsContext* context) | 241 void DisplayItemList::replay(GraphicsContext* context) |
| 242 { | 242 { |
| 243 updatePaintList(); | 243 updatePaintList(); |
| 244 for (auto& displayItem : m_paintList) | 244 for (auto& displayItem : m_paintList) |
| 245 displayItem->replay(context); | 245 displayItem->replay(context); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace blink | 248 } // namespace blink |
| OLD | NEW |