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

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

Issue 1315213002: (WIP) Paint invalidation for slimming paint v2 (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 | « Source/core/paint/ViewPainter.cpp ('k') | 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/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
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
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
OLDNEW
« no previous file with comments | « Source/core/paint/ViewPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698