| Index: Source/platform/graphics/paint/DisplayItemList.h
|
| diff --git a/Source/platform/graphics/paint/DisplayItemList.h b/Source/platform/graphics/paint/DisplayItemList.h
|
| index 133e2f8e0b18840e0b0b2a9cdfefe8b825098e20..5790fff933ba2409a71aafc27424d555d55a3f24 100644
|
| --- a/Source/platform/graphics/paint/DisplayItemList.h
|
| +++ b/Source/platform/graphics/paint/DisplayItemList.h
|
| @@ -9,6 +9,7 @@
|
| #include "platform/graphics/ListContainer.h"
|
| #include "platform/graphics/paint/DisplayItem.h"
|
| #include "platform/graphics/paint/Transform3DDisplayItem.h"
|
| +#include "public/platform/WebDisplayList.h"
|
| #include "wtf/HashMap.h"
|
| #include "wtf/PassOwnPtr.h"
|
| #include "wtf/Utility.h"
|
| @@ -23,7 +24,7 @@ using DisplayItems = ListContainer<DisplayItem>;
|
| static const size_t kInitialDisplayItemsCapacity = 64;
|
| static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem);
|
|
|
| -class PLATFORM_EXPORT DisplayItemList {
|
| +class PLATFORM_EXPORT DisplayItemList : public WebDisplayList {
|
| WTF_MAKE_NONCOPYABLE(DisplayItemList);
|
| WTF_MAKE_FAST_ALLOCATED(DisplayItemList);
|
| public:
|
| @@ -52,6 +53,8 @@ public:
|
| void beginScope(DisplayItemClient);
|
| void endScope(DisplayItemClient);
|
|
|
| + void addPixelRef(const skia::PixelRefUtils::PositionPixelRef&);
|
| +
|
| // True if the last display item is a begin that doesn't draw content.
|
| bool lastDisplayItemIsNoopBegin() const;
|
| void removeLastDisplayItem();
|
| @@ -60,8 +63,9 @@ public:
|
| void endSkippingCache() { ASSERT(m_skippingCacheCount > 0); --m_skippingCacheCount; }
|
| bool skippingCache() const { return m_skippingCacheCount; }
|
|
|
| - // Must be called when a painting is finished.
|
| - void commitNewDisplayItems();
|
| + // Must be called when a painting is finished. If passed, the diff is initialized
|
| + // to the difference of the new display list from the last time commitNewDisplayItems() was called.
|
| + void commitNewDisplayItems(WebDisplayListDiff* = 0);
|
|
|
| // Returns the approximate memory usage, excluding memory likely to be
|
| // shared with the embedder after copying to WebDisplayItemList.
|
| @@ -70,6 +74,9 @@ public:
|
|
|
| // Get the paint list generated after the last painting.
|
| const DisplayItems& displayItems() const;
|
| + const WebVector<WebDisplayItem>& webDisplayItems() const override;
|
| + // Get the pixel refs generated after the last painting.
|
| + const skia::DiscardablePixelRefList& pixelRefs() const override;
|
|
|
| bool clientCacheIsValid(DisplayItemClient) const;
|
|
|
| @@ -165,12 +172,18 @@ private:
|
| ClientScopeIdMap m_clientScopeIdMap;
|
| Vector<Scope> m_scopeStack;
|
|
|
| + skia::DiscardablePixelRefList m_currentPixelRefs;
|
| + skia::DiscardablePixelRefList m_newPixelRefs;
|
| +
|
| #if ENABLE(ASSERT)
|
| // This is used to check duplicated ids during add(). We could also check during
|
| // updatePaintList(), but checking during add() helps developer easily find where
|
| // the duplicated ids are from.
|
| DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
|
| #endif
|
| +
|
| + // This is a placeholder, not a real data structure.
|
| + WebVector<WebDisplayItem> m_webDisplayItems;
|
| };
|
|
|
| } // namespace blink
|
|
|