Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: Source/platform/graphics/paint/DisplayItemList.cpp

Issue 1323253002: Let clientCacheIsValid count cacheable display item only (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698