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 f3acfd4705321f3281d57944172c12f0ac1d87af..523d53b452298b4cbef34fdf5a097f3b4ea21de4 100644 |
| --- a/Source/platform/graphics/paint/DisplayItem.h |
| +++ b/Source/platform/graphics/paint/DisplayItem.h |
| @@ -180,22 +180,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. |
| @@ -276,24 +279,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 { |
|
chrishtr
2015/06/02 17:06:56
What's the point of flattening the struct? Is it n
Xianzhu
2015/06/02 17:36:34
Otherwise it would be:
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; |
| + unsigned m_scopeId : 16; |
|
pdr.
2015/06/02 17:16:08
This seems dangerous in the future and doesn't do
Xianzhu
2015/06/02 17:36:35
Restored back to 'int'.
|
| + const Type m_type : 15; |
| + bool m_skippedCache : 1; |
| #ifndef NDEBUG |
| WTF::String m_clientDebugString; |