| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DisplayItem_h | 5 #ifndef DisplayItem_h |
| 6 #define DisplayItem_h | 6 #define DisplayItem_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "wtf/Assertions.h" | 9 #include "wtf/Assertions.h" |
| 10 #include "wtf/PassOwnPtr.h" |
| 10 | 11 |
| 11 #ifndef NDEBUG | 12 #ifndef NDEBUG |
| 12 #include "wtf/text/StringBuilder.h" | 13 #include "wtf/text/StringBuilder.h" |
| 13 #include "wtf/text/WTFString.h" | 14 #include "wtf/text/WTFString.h" |
| 14 #endif | 15 #endif |
| 15 | 16 |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| 19 class GraphicsContext; | 20 class GraphicsContext; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 ClipBoxCollapsedTableBorders, | 68 ClipBoxCollapsedTableBorders, |
| 68 ClipBoxTextClip, | 69 ClipBoxTextClip, |
| 69 ClipBoxClippingMask, | 70 ClipBoxClippingMask, |
| 70 BeginTransform, | 71 BeginTransform, |
| 71 EndTransform, | 72 EndTransform, |
| 72 ScrollbarCorner, | 73 ScrollbarCorner, |
| 73 Scrollbar, | 74 Scrollbar, |
| 74 Resizer | 75 Resizer |
| 75 }; | 76 }; |
| 76 | 77 |
| 78 static PassOwnPtr<DisplayItem> createDummy(DisplayItemClient, Type); |
| 79 |
| 77 virtual ~DisplayItem() { } | 80 virtual ~DisplayItem() { } |
| 78 | 81 |
| 79 virtual void replay(GraphicsContext*) = 0; | 82 virtual void replay(GraphicsContext*) = 0; |
| 80 | 83 |
| 81 DisplayItemClient client() const { return m_id.client; } | 84 DisplayItemClient client() const { return m_id.client; } |
| 82 Type type() const { return m_id.type; } | 85 Type type() const { return m_id.type; } |
| 83 bool idsEqual(const DisplayItem& other) const { return m_id.client == other.
m_id.client && m_id.type == other.m_id.type; } | 86 bool idsEqual(const DisplayItem& other) const { return m_id.client == other.
m_id.client && m_id.type == other.m_id.type; } |
| 84 | 87 |
| 85 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const = 0; | 88 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const = 0; |
| 86 | 89 |
| 87 #ifndef NDEBUG | 90 #ifndef NDEBUG |
| 88 static WTF::String typeAsDebugString(DisplayItem::Type); | 91 static WTF::String typeAsDebugString(DisplayItem::Type); |
| 89 | 92 |
| 90 void setClientDebugString(const WTF::String& clientDebugString) { m_clientDe
bugString = clientDebugString; } | 93 void setClientDebugString(const WTF::String& clientDebugString) { m_clientDe
bugString = clientDebugString; } |
| 91 const WTF::String& clientDebugString() const { return m_clientDebugString; } | 94 const WTF::String& clientDebugString() const { return m_clientDebugString; } |
| 92 | 95 |
| 93 WTF::String asDebugString() const; | 96 WTF::String asDebugString() const; |
| 97 virtual const char* name() const = 0; |
| 94 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; | 98 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; |
| 95 #endif | 99 #endif |
| 96 | 100 |
| 97 virtual bool isCached() const { return false; } | 101 virtual bool isCached() const { return false; } |
| 98 | 102 |
| 99 protected: | 103 protected: |
| 100 DisplayItem(DisplayItemClient client, Type type) | 104 DisplayItem(DisplayItemClient client, Type type) |
| 101 : m_id(client, type) | 105 : m_id(client, type) |
| 102 { | 106 { |
| 103 ASSERT(client); | 107 ASSERT(client); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 116 const Type type; | 120 const Type type; |
| 117 } m_id; | 121 } m_id; |
| 118 #ifndef NDEBUG | 122 #ifndef NDEBUG |
| 119 WTF::String m_clientDebugString; | 123 WTF::String m_clientDebugString; |
| 120 #endif | 124 #endif |
| 121 }; | 125 }; |
| 122 | 126 |
| 123 } | 127 } |
| 124 | 128 |
| 125 #endif // DisplayItem_h | 129 #endif // DisplayItem_h |
| OLD | NEW |