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

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: Remove scope-related code (accidentally mixed in this CL) 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..de674c59fd576242c25d0e95152aa455722574a0 100644
--- a/Source/platform/graphics/paint/DisplayItemList.h
+++ b/Source/platform/graphics/paint/DisplayItemList.h
@@ -7,6 +7,7 @@
#include "platform/PlatformExport.h"
#include "platform/graphics/paint/DisplayItem.h"
+#include "wtf/HashMap.h"
#include "wtf/HashSet.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/Vector.h"
@@ -25,7 +26,7 @@ public:
void endNewPaints() { updatePaintList(); }
- const PaintList& paintList();
+ const PaintList& paintList() const;
void add(WTF::PassOwnPtr<DisplayItem>);
void invalidate(DisplayItemClient);
@@ -43,17 +44,31 @@ protected:
DisplayItemList() { };
private:
- PaintList::iterator findNextMatchingCachedItem(PaintList::iterator, const DisplayItem&);
- bool wasInvalidated(const DisplayItem&) const;
- void updatePaintList();
+ friend class DrawingRecorderTest;
+ friend class ViewDisplayListTest;
#ifndef NDEBUG
WTF::String paintListAsDebugString(const PaintList&) const;
#endif
+ void updatePaintList();
+
+ typedef HashSet<DisplayItemClient> DisplayItemClientSet;
+ typedef HashMap<DisplayItem::Id, size_t> DisplayItemIndexMap;
+
+ size_t findDisplayItemById(const DisplayItem::Id&) const;
+ size_t findMatchingCachedItem(const DisplayItem&) const;
+
+ static void appendDisplayItem(WTF::PassOwnPtr<DisplayItem>, PaintList&, DisplayItemClientSet&, DisplayItemIndexMap&);
+ void copyCachedSubtree(const DisplayItem&, PaintList&, DisplayItemClientSet&, DisplayItemIndexMap&);
+
PaintList m_paintList;
- HashSet<DisplayItemClient> m_cachedClients;
+ DisplayItemClientSet m_cachedClients;
pdr. 2015/02/04 05:19:58 We're adding a lot of complexity (exposing Id, has
Xianzhu 2015/02/04 20:46:32 Actually the method was used in an older version o
+ DisplayItemIndexMap m_displayItemIndexMap;
pdr. 2015/02/04 05:19:58 Can you add a comment here saying that this maps f
PaintList m_newPaints;
+#if ENABLE(ASSERT)
+ HashSet<DisplayItem::Id> m_newPaintIds;
+#endif
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698