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

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

Issue 1287863003: Avoid re-iterate out-of-order display items (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
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 #ifndef DisplayItemList_h 5 #ifndef DisplayItemList_h
6 #define DisplayItemList_h 6 #define DisplayItemList_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "platform/graphics/ContiguousContainer.h" 9 #include "platform/graphics/ContiguousContainer.h"
10 #include "platform/graphics/paint/DisplayItem.h" 10 #include "platform/graphics/paint/DisplayItem.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 #ifndef NDEBUG 134 #ifndef NDEBUG
135 WTF::String displayItemsAsDebugString(const DisplayItems&) const; 135 WTF::String displayItemsAsDebugString(const DisplayItems&) const;
136 #endif 136 #endif
137 137
138 // Indices into PaintList of all DrawingDisplayItems and BeginSubtreeDisplay Items of each client. 138 // Indices into PaintList of all DrawingDisplayItems and BeginSubtreeDisplay Items of each client.
139 // Temporarily used during merge to find out-of-order display items. 139 // Temporarily used during merge to find out-of-order display items.
140 using DisplayItemIndicesByClientMap = HashMap<DisplayItemClient, Vector<size _t>>; 140 using DisplayItemIndicesByClientMap = HashMap<DisplayItemClient, Vector<size _t>>;
141 141
142 static size_t findMatchingItemFromIndex(const DisplayItem::Id&, const Displa yItemIndicesByClientMap&, const DisplayItems&); 142 static size_t findMatchingItemFromIndex(const DisplayItem::Id&, const Displa yItemIndicesByClientMap&, const DisplayItems&);
143 static void addItemToIndexIfNeeded(const DisplayItem&, size_t index, Display ItemIndicesByClientMap&); 143 static void addItemToIndexIfNeeded(const DisplayItem&, size_t index, Display ItemIndicesByClientMap&);
144 DisplayItems::iterator findOutOfOrderCachedItem(DisplayItems::iterator curre ntIt, const DisplayItem::Id&, DisplayItemIndicesByClientMap&); 144 DisplayItems::iterator findOutOfOrderCachedItem(DisplayItems::iterator& next ItemToIndexIt, const DisplayItem::Id&, DisplayItemIndicesByClientMap&);
145 DisplayItems::iterator findOutOfOrderCachedItemForward(DisplayItems::iterato r currentIt, const DisplayItem::Id&, DisplayItemIndicesByClientMap&); 145 DisplayItems::iterator findOutOfOrderCachedItemForward(DisplayItems::iterato r& nextItemToIndexIt, const DisplayItem::Id&, DisplayItemIndicesByClientMap&);
146 void copyCachedSubtree(DisplayItems::iterator& currentIt, DisplayItems& upda tedList); 146 void copyCachedSubtree(DisplayItems::iterator& currentIt, DisplayItems& upda tedList);
147 147
148 #if ENABLE(ASSERT) 148 #if ENABLE(ASSERT)
149 // The following two methods are for checking under-invalidations 149 // The following two methods are for checking under-invalidations
150 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed). 150 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed).
151 void checkCachedDisplayItemIsUnchanged(const DisplayItem&, DisplayItemIndice sByClientMap&); 151 void checkCachedDisplayItemIsUnchanged(const DisplayItem&, DisplayItemIndice sByClientMap&);
152 void checkNoRemainingCachedDisplayItems(); 152 void checkNoRemainingCachedDisplayItems();
153 #endif 153 #endif
154 154
155 void replay(GraphicsContext&); 155 void replay(GraphicsContext&);
(...skipping 23 matching lines...) Expand all
179 // This is used to check duplicated ids during add(). We could also check du ring 179 // This is used to check duplicated ids during add(). We could also check du ring
180 // updatePaintList(), but checking during add() helps developer easily find where 180 // updatePaintList(), but checking during add() helps developer easily find where
181 // the duplicated ids are from. 181 // the duplicated ids are from.
182 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; 182 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
183 #endif 183 #endif
184 }; 184 };
185 185
186 } // namespace blink 186 } // namespace blink
187 187
188 #endif // DisplayItemList_h 188 #endif // DisplayItemList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698