Chromium Code Reviews| Index: Source/platform/graphics/paint/DisplayItemList.h |
| diff --git a/Source/platform/graphics/paint/DisplayItemList.h b/Source/platform/graphics/paint/DisplayItemList.h |
| index c1949ad0a9d3f2bfdb2140a9089bf7e687794d61..348012d8fcbbc85082d279749c42724dad7717b2 100644 |
| --- a/Source/platform/graphics/paint/DisplayItemList.h |
| +++ b/Source/platform/graphics/paint/DisplayItemList.h |
| @@ -7,7 +7,7 @@ |
| #include "platform/PlatformExport.h" |
| #include "platform/graphics/paint/DisplayItem.h" |
| -#include "wtf/HashSet.h" |
| +#include "wtf/HashMap.h" |
| #include "wtf/PassOwnPtr.h" |
| #include "wtf/Vector.h" |
| @@ -43,16 +43,29 @@ protected: |
| DisplayItemList() { }; |
| private: |
| - PaintList::iterator findNextMatchingCachedItem(PaintList::iterator, const DisplayItem&); |
| - bool wasInvalidated(const DisplayItem&) const; |
| + friend class ViewDisplayListTest; |
| + friend class DrawingRecorderTest; |
| + |
| void updatePaintList(); |
| #ifndef NDEBUG |
| WTF::String paintListAsDebugString(const PaintList&) const; |
| #endif |
| + struct DisplayItemIndices { |
| + // Indices into PaintList of all DrawingDisplayItems of a client. |
|
pdr.
2015/02/05 03:35:57
Do we need to track these separately or can we jus
Xianzhu
2015/02/05 17:57:03
Thought to reduce the number of items of each vect
|
| + Vector<size_t> drawingDisplayItemIndices; |
| + // Indices into PaintList of all BeginSubtreeDisplayItems of a client. |
| + Vector<size_t> beginSubtreeDisplayItemIndices; |
| + }; |
| + typedef HashMap<DisplayItemClient, DisplayItemIndices> DisplayItemIndicesByClientMap; |
| + |
| + size_t findMatchingCachedItem(const DisplayItem&); |
| + static void appendDisplayItem(PaintList&, DisplayItemIndicesByClientMap&, WTF::PassOwnPtr<DisplayItem>); |
| + void copyCachedSubtree(const DisplayItem&, PaintList&, DisplayItemIndicesByClientMap&); |
| + |
| PaintList m_paintList; |
| - HashSet<DisplayItemClient> m_cachedClients; |
| + DisplayItemIndicesByClientMap m_cachedDisplayItemIndicesByClient; |
| PaintList m_newPaints; |
| }; |