Chromium Code Reviews| 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; |