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

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

Issue 1160763005: Don't cache reflection drawings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix win (which doesn't pack bool bitfields) Created 5 years, 7 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
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/graphics/paint/DisplayItem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/DisplayItem.h
diff --git a/Source/platform/graphics/paint/DisplayItem.h b/Source/platform/graphics/paint/DisplayItem.h
index f3acfd4705321f3281d57944172c12f0ac1d87af..d72b72c18024f045fecf0dbb912a27f001b4a9e2 100644
--- a/Source/platform/graphics/paint/DisplayItem.h
+++ b/Source/platform/graphics/paint/DisplayItem.h
@@ -180,22 +180,26 @@ public:
virtual void replay(GraphicsContext&) { }
- DisplayItemClient client() const { return m_id.client; }
- Type type() const { return m_id.type; }
+ DisplayItemClient client() const { return m_client; }
+ Type type() const { return m_type; }
bool idsEqual(const DisplayItem& other, Type overrideType) const
{
- return m_id.client == other.m_id.client
- && m_id.type == overrideType
- && m_id.scopeId == other.m_id.scopeId
- && m_id.scopeContainer == other.m_id.scopeContainer;
+ return m_client == other.m_client
+ && m_type == overrideType
+ && m_scopeId == other.m_scopeId
+ && m_scopeContainer == other.m_scopeContainer;
}
void setScope(int scopeId, DisplayItemClient scopeContainer)
{
- m_id.scopeId = scopeId;
- m_id.scopeContainer = scopeContainer;
+ m_scopeId = scopeId;
+ m_scopeContainer = scopeContainer;
}
+ // For DisplayItemList only. Painters should use DisplayItemCacheSkipper instead.
+ void setSkippedCache() { m_skippedCache = true; }
+ bool skippedCache() const { return m_skippedCache; }
+
virtual void appendToWebDisplayItemList(WebDisplayItemList*) const { }
// See comments of enum Type for usage of the following macros.
@@ -276,24 +280,23 @@ public:
protected:
DisplayItem(const DisplayItemClientWrapper& client, Type type)
- : m_id(client.displayItemClient(), 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:
- struct Id {
- Id(DisplayItemClient c, Type t) : client(c), type(t), scopeId(0), scopeContainer(nullptr)
- {
- ASSERT(c);
- }
-
- const DisplayItemClient client;
- const Type type;
- int scopeId;
- DisplayItemClient scopeContainer;
- } m_id;
+ const DisplayItemClient m_client;
+ DisplayItemClient m_scopeContainer;
+ int m_scopeId;
+ static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits");
+ const Type m_type : 16;
+ unsigned m_skippedCache : 1;
#ifndef NDEBUG
WTF::String m_clientDebugString;
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/graphics/paint/DisplayItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698