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

Unified Diff: Source/platform/graphics/paint/DisplayItemList.h

Issue 892293002: First version of new merge algorithm (not enabled yet) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Traverse indices vector Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
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;
};

Powered by Google App Engine
This is Rietveld 408576698