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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 } | 451 } |
452 | 452 |
453 void DisplayItemList::updateValidlyCachedClientsIfNeeded() const | 453 void DisplayItemList::updateValidlyCachedClientsIfNeeded() const |
454 { | 454 { |
455 if (!m_validlyCachedClientsDirty) | 455 if (!m_validlyCachedClientsDirty) |
456 return; | 456 return; |
457 | 457 |
458 m_validlyCachedClients.clear(); | 458 m_validlyCachedClients.clear(); |
459 m_validlyCachedClientsDirty = false; | 459 m_validlyCachedClientsDirty = false; |
460 | 460 |
461 DisplayItemClient lastClient = nullptr; | 461 DisplayItemClient lastAddedClient = nullptr; |
462 for (const DisplayItem& displayItem : m_currentDisplayItems) { | 462 for (const DisplayItem& displayItem : m_currentDisplayItems) { |
463 if (displayItem.client() == lastClient) | 463 if (displayItem.client() == lastAddedClient) |
464 continue; | 464 continue; |
465 lastClient = displayItem.client(); | 465 if (displayItem.isCacheable()) { |
466 if (!displayItem.skippedCache()) | 466 lastAddedClient = displayItem.client(); |
467 m_validlyCachedClients.add(lastClient); | 467 m_validlyCachedClients.add(lastAddedClient); |
| 468 } |
468 } | 469 } |
469 } | 470 } |
470 | 471 |
471 void DisplayItemList::appendToWebDisplayItemList(WebDisplayItemList* list) | 472 void DisplayItemList::appendToWebDisplayItemList(WebDisplayItemList* list) |
472 { | 473 { |
473 for (const DisplayItem& item : m_currentDisplayItems) | 474 for (const DisplayItem& item : m_currentDisplayItems) |
474 item.appendToWebDisplayItemList(list); | 475 item.appendToWebDisplayItemList(list); |
475 } | 476 } |
476 | 477 |
477 void DisplayItemList::commitNewDisplayItemsAndAppendToWebDisplayItemList(WebDisp
layItemList* list) | 478 void DisplayItemList::commitNewDisplayItemsAndAppendToWebDisplayItemList(WebDisp
layItemList* list) |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 624 |
624 void DisplayItemList::replay(GraphicsContext& context) | 625 void DisplayItemList::replay(GraphicsContext& context) |
625 { | 626 { |
626 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 627 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
627 ASSERT(m_newDisplayItems.isEmpty()); | 628 ASSERT(m_newDisplayItems.isEmpty()); |
628 for (DisplayItem& displayItem : m_currentDisplayItems) | 629 for (DisplayItem& displayItem : m_currentDisplayItems) |
629 displayItem.replay(context); | 630 displayItem.replay(context); |
630 } | 631 } |
631 | 632 |
632 } // namespace blink | 633 } // namespace blink |
OLD | NEW |