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

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

Issue 1238123004: Slimming Paint phase 2 compositing algorithm plumbing & skeleton display list API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 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

Powered by Google App Engine
This is Rietveld 408576698