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

Unified Diff: Source/platform/graphics/paint/DisplayItem.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/DisplayItem.h
diff --git a/Source/platform/graphics/paint/DisplayItem.h b/Source/platform/graphics/paint/DisplayItem.h
index ed8985384fd6aee80bffa12ab56447a5271950e0..ecdbd12c3c65fa1a4a81c66d64f443f50529e16e 100644
--- a/Source/platform/graphics/paint/DisplayItem.h
+++ b/Source/platform/graphics/paint/DisplayItem.h
@@ -18,6 +18,7 @@
namespace blink {
+class DisplayItems;
class GraphicsContext;
class WebDisplayItemList;
@@ -233,6 +234,7 @@ public:
bool skippedCache() const { return m_skippedCache; }
virtual void appendToWebDisplayItemList(WebDisplayItemList*) const { }
+ virtual void appendByMoving(DisplayItems&) = 0;
// See comments of enum Type for usage of the following macros.
#define DEFINE_CATEGORY_METHODS(Category) \
@@ -355,6 +357,27 @@ private:
virtual bool isEnd() const override final { return true; }
};
+// Allows a DisplayItemClientWrapper to be constructed from a DisplayItem, in
+// order to facilitate copying it.
+// TODO(jbroman): This is a bad class name.
+class DisplayItemClientWrapperHelper {
Xianzhu 2015/06/19 16:19:11 I think we can just use DisplayItemClientWrapper i
+ DISALLOW_ALLOCATION();
+public:
+ DisplayItemClientWrapperHelper(const DisplayItem& wrapped) : m_wrapped(wrapped) { }
+ DisplayItemClient displayItemClient() const { return m_wrapped.client(); }
+ String debugName() const
+ {
+#ifndef NDEBUG
+ return m_wrapped.clientDebugString();
+#else
+ return String();
+#endif
+ }
+private:
+ const DisplayItem& m_wrapped;
+};
+
+
} // namespace blink
#endif // DisplayItem_h

Powered by Google App Engine
This is Rietveld 408576698