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

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: Minor tweaks to make reviewing easier 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..dabad7fbe01dd8383d5bde7434db4737e0b83471 100644
--- a/Source/platform/graphics/paint/DisplayItem.h
+++ b/Source/platform/graphics/paint/DisplayItem.h
@@ -24,7 +24,7 @@ class WebDisplayItemList;
class PLATFORM_EXPORT DisplayItem {
public:
enum {
- // Must be kept in sync with core/layout/PaintPhase.h.
+ // Must be kept in sync with core/paint/PaintPhase.h.
PaintPhaseMax = 12,
};
@@ -173,9 +173,34 @@ public:
EndSubtreePaintPhaseLast = EndSubtreePaintPhaseFirst + PaintPhaseMax,
EndSubtreeLast = EndSubtreePaintPhaseLast,
- TypeLast = EndSubtreeLast
+ UninitializedType,
jbroman 2015/06/29 18:11:56 Superduper nit: to me it seems nicer for the in-me
pdr. 2015/06/29 22:20:03 Oops, I landed this in the BoxClipper patch (https
+ TypeLast = UninitializedType
};
+ DisplayItem()
chrishtr 2015/06/29 17:19:16 Add a comment about the use case. Also maybe priva
pdr. 2015/06/29 22:20:03 Moved to private and just friended ListContainer::
+ : m_client(nullptr)
+ , m_scopeContainer(nullptr)
+ , m_scopeId(0)
+ , m_type(UninitializedType)
+ , m_skippedCache(false)
+ , m_ignoredFromList(true)
+#ifndef NDEBUG
+ , m_clientDebugString("invalid")
+#endif
+ { }
+
+ DisplayItem(const DisplayItemClientWrapper& client, Type type)
+ : m_client(client.displayItemClient())
+ , m_scopeContainer(nullptr)
+ , m_scopeId(0)
+ , m_type(type)
+ , m_skippedCache(false)
+ , m_ignoredFromList(false)
+#ifndef NDEBUG
+ , m_clientDebugString(client.debugName())
+#endif
+ { }
+
struct Id {
Id(DisplayItemClient c, Type t) : client(c), type(t), scopeId(0), scopeContainer(nullptr)
{
@@ -303,6 +328,9 @@ public:
virtual bool drawsContent() const { return false; }
+ bool ignoreFromDisplayList() const { return m_ignoredFromList; }
+ void setIgnoredFromDisplayList() { m_ignoredFromList = true; }
+
#ifndef NDEBUG
static WTF::String typeAsDebugString(DisplayItem::Type);
const WTF::String& clientDebugString() const { return m_clientDebugString; }
@@ -310,18 +338,6 @@ public:
virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const;
#endif
-protected:
- DisplayItem(const DisplayItemClientWrapper& client, Type type)
- : m_client(client.displayItemClient())
- , m_scopeContainer(nullptr)
- , m_scopeId(0)
- , m_type(type)
- , m_skippedCache(false)
-#ifndef NDEBUG
- , m_clientDebugString(client.debugName())
-#endif
- { }
-
private:
const DisplayItemClient m_client;
DisplayItemClient m_scopeContainer;
@@ -329,6 +345,7 @@ private:
static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits");
const Type m_type : 16;
unsigned m_skippedCache : 1;
+ unsigned m_ignoredFromList : 1;
#ifndef NDEBUG
WTF::String m_clientDebugString;

Powered by Google App Engine
This is Rietveld 408576698