| Index: Source/platform/graphics/paint/DisplayItemList.h
|
| diff --git a/Source/platform/graphics/paint/DisplayItemList.h b/Source/platform/graphics/paint/DisplayItemList.h
|
| index 6140393706b7623c5d446e44b6535b85afe53190..5409b43b3aa8efe09c104033ce9b9ae83d9f6c63 100644
|
| --- a/Source/platform/graphics/paint/DisplayItemList.h
|
| +++ b/Source/platform/graphics/paint/DisplayItemList.h
|
| @@ -16,6 +16,8 @@ namespace blink {
|
|
|
| class GraphicsContext;
|
|
|
| +static const size_t kInitialDisplayItemsCapacity = 32;
|
| +
|
| class PLATFORM_EXPORT DisplayItemList {
|
| WTF_MAKE_NONCOPYABLE(DisplayItemList);
|
| WTF_MAKE_FAST_ALLOCATED(DisplayItemList);
|
| @@ -30,7 +32,15 @@ public:
|
| void invalidateAll();
|
|
|
| // These methods are called during painting.
|
| - void add(WTF::PassOwnPtr<DisplayItem>);
|
| + template<typename DisplayItemClass>
|
| + DisplayItemClass& createAndAppend(const DisplayItemClientWrapper& client, DisplayItem::Type type)
|
| + {
|
| + DisplayItemClass& item = m_newDisplayItems.createAndAppend<DisplayItemClass>();
|
| + item.setClientAndType(client, type);
|
| + processNewItem(&item);
|
| + return item;
|
| + }
|
| + void add(WTF::PassOwnPtr<DisplayItem>) { } // REMOVE ME
|
| void beginScope(DisplayItemClient);
|
| void endScope(DisplayItemClient);
|
|
|
| @@ -72,7 +82,9 @@ public:
|
|
|
| protected:
|
| DisplayItemList()
|
| - : m_validlyCachedClientsDirty(false)
|
| + : m_currentDisplayItems(kInitialDisplayItemsCapacity)
|
| + , m_newDisplayItems(kInitialDisplayItemsCapacity)
|
| + , m_validlyCachedClientsDirty(false)
|
| , m_constructionDisabled(false)
|
| , m_skippingCacheCount(0)
|
| , m_numCachedItems(0) { }
|
| @@ -82,6 +94,10 @@ private:
|
| friend class DisplayItemListPaintTest;
|
| friend class LayoutObjectDrawingRecorderTest;
|
|
|
| + // Set new item state (scopes, cache skipping, etc) for a new item.
|
| + // TODO(pdr): This only passes a pointer to make the patch easier to review. Change to a reference.
|
| + void processNewItem(DisplayItem*);
|
| +
|
| void updateValidlyCachedClientsIfNeeded() const;
|
|
|
| #ifndef NDEBUG
|
|
|