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

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: Add DisplayItemCachingSkipper.h; Restore m_scopeId 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 aa163a6a35c90371cbcd601487ce66bd32711ff2..244882e29a52a864aad501ecb2d4ead0c641c278 100644
--- a/Source/platform/graphics/paint/DisplayItem.h
+++ b/Source/platform/graphics/paint/DisplayItem.h
@@ -181,22 +181,25 @@ 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;
}
+ 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.
@@ -277,24 +280,22 @@ 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;
+ const Type m_type : 16;
jbroman 2015/06/02 18:02:23 Why use a bitfield here when you could simply redu
Xianzhu 2015/06/02 18:41:59 Great! Didn't know this grammar before. Done.
Xianzhu 2015/06/02 22:37:47 MSVC failed to compile '+', '-' operators of the e
+ bool 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