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

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

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ready for review Created 5 years, 6 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 51dc0f8289d6a6b88eccc3d471a86f9de37706bb..ab039d9c888e94f7552f9f2312ba9b70280dea86 100644
--- a/Source/platform/graphics/paint/DisplayItemList.h
+++ b/Source/platform/graphics/paint/DisplayItemList.h
@@ -10,6 +10,9 @@
#include "platform/graphics/paint/DisplayItems.h"
#include "wtf/HashMap.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/TypeTraits.h"
+#include "wtf/Utility.h"
#include "wtf/Vector.h"
namespace blink {
@@ -30,7 +33,14 @@ public:
void invalidateAll();
// These methods are called during painting.
- void add(WTF::PassOwnPtr<DisplayItem>);
+
+ template <typename DisplayItemClass, typename... Args>
+ void createAndAppendIfNeeded(Args&&... args)
+ {
Xianzhu 2015/06/19 16:19:11 Can we put displayItemConstructionIsDisabled() che
+ DisplayItemClass& displayItem = m_newDisplayItems.emplaceBack<DisplayItemClass>(WTF::forward<Args>(args)...);
+ processNewItem(displayItem);
+ }
+
void beginScope(DisplayItemClient);
void endScope(DisplayItemClient);
@@ -77,6 +87,10 @@ private:
friend class DisplayItemListPaintTest;
friend class LayoutObjectDrawingRecorderTest;
+
+ // Adjust the list as necessary for newly appended items.
+ void processNewItem(DisplayItem&);
+
void updateValidlyCachedClientsIfNeeded() const;
#ifndef NDEBUG

Powered by Google App Engine
This is Rietveld 408576698