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

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

Issue 1192443003: [Slimming Paint] Blink-side contiguous allocation of display items. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: need a constructor with WTF_MAKE_NONCOPYABLE 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..4feab87ac61056353652524eeb5025cb9720d622 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) \
@@ -333,6 +335,10 @@ private:
#ifndef NDEBUG
WTF::String m_clientDebugString;
#endif
+
+ // TODO(jbroman): Copying this data in appendByMoving would be better than
+ // friendship, but this is just hacked up.
+ friend class DisplayItems;
};
class PLATFORM_EXPORT PairedBeginDisplayItem : public DisplayItem {
@@ -355,6 +361,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 {
+ 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
« no previous file with comments | « Source/platform/graphics/paint/CompositingDisplayItem.cpp ('k') | Source/platform/graphics/paint/DisplayItemList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698