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

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
145 DisplayItems::iterator findOutOfOrderCachedItemForward(DisplayItems::iterato r currentIt, const DisplayItem::Id&, DisplayItemIndicesByClientMap&); 145 struct OutOfOrderIndexContext;
146 DisplayItems::iterator findOutOfOrderCachedItem(DisplayItems::iterator curre ntIt, const DisplayItem::Id&, OutOfOrderIndexContext&);
147 DisplayItems::iterator findOutOfOrderCachedItemForward(const DisplayItem::Id &, OutOfOrderIndexContext&);
146 void copyCachedSubtree(DisplayItems::iterator& currentIt, DisplayItems& upda tedList); 148 void copyCachedSubtree(DisplayItems::iterator& currentIt, DisplayItems& upda tedList);
147 149
148 #if ENABLE(ASSERT) 150 #if ENABLE(ASSERT)
149 // The following two methods are for checking under-invalidations 151 // The following two methods are for checking under-invalidations
150 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed). 152 // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabl ed).
151 void checkCachedDisplayItemIsUnchanged(const DisplayItem&, DisplayItemIndice sByClientMap&); 153 void checkCachedDisplayItemIsUnchanged(const DisplayItem&, DisplayItemIndice sByClientMap&);
152 void checkNoRemainingCachedDisplayItems(); 154 void checkNoRemainingCachedDisplayItems();
153 #endif 155 #endif
154 156
155 void replay(GraphicsContext&); 157 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 181 // 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 182 // updatePaintList(), but checking during add() helps developer easily find where
181 // the duplicated ids are from. 183 // the duplicated ids are from.
182 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient; 184 DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
183 #endif 185 #endif
184 }; 186 };
185 187
186 } // namespace blink 188 } // namespace blink
187 189
188 #endif // DisplayItemList_h 190 #endif // DisplayItemList_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/DisplayItem.cpp ('k') | Source/platform/graphics/paint/DisplayItemList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698