| 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 "platform/graphics/ContiguousContainer.h" | 9 #include "platform/graphics/ContiguousContainer.h" |
| 10 #include "platform/graphics/paint/DisplayItemClient.h" | 10 #include "platform/graphics/paint/DisplayItemClient.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // Size of this object in memory, used to move it with memcpy. | 233 // Size of this object in memory, used to move it with memcpy. |
| 234 // This is not sizeof(*this), because it needs to account for the size of | 234 // This is not sizeof(*this), because it needs to account for the size of |
| 235 // the derived class (i.e. runtime type). Derived classes are expected to | 235 // the derived class (i.e. runtime type). Derived classes are expected to |
| 236 // supply this to the DisplayItem constructor. | 236 // supply this to the DisplayItem constructor. |
| 237 size_t derivedSize() const { return m_derivedSize; } | 237 size_t derivedSize() const { return m_derivedSize; } |
| 238 | 238 |
| 239 // For PaintController only. Painters should use DisplayItemCacheSkipper ins
tead. | 239 // For PaintController only. Painters should use DisplayItemCacheSkipper ins
tead. |
| 240 void setSkippedCache() { m_skippedCache = true; } | 240 void setSkippedCache() { m_skippedCache = true; } |
| 241 bool skippedCache() const { return m_skippedCache; } | 241 bool skippedCache() const { return m_skippedCache; } |
| 242 | 242 |
| 243 // TODO(wkorman): Only DrawingDisplayItem needs the visual rect argument. |
| 244 // Consider refactoring class hierarchy to make this more explicit. |
| 243 virtual void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*)
const { } | 245 virtual void appendToWebDisplayItemList(const IntRect&, WebDisplayItemList*)
const { } |
| 244 | 246 |
| 245 // See comments of enum Type for usage of the following macros. | 247 // See comments of enum Type for usage of the following macros. |
| 246 #define DEFINE_CATEGORY_METHODS(Category) \ | 248 #define DEFINE_CATEGORY_METHODS(Category) \ |
| 247 static bool is##Category##Type(Type type) { return type >= Category##First &
& type <= Category##Last; } \ | 249 static bool is##Category##Type(Type type) { return type >= Category##First &
& type <= Category##Last; } \ |
| 248 bool is##Category() const { return is##Category##Type(getType()); } | 250 bool is##Category() const { return is##Category##Type(getType()); } |
| 249 | 251 |
| 250 #define DEFINE_CONVERSION_METHODS(Category1, category1, Category2, category2) \ | 252 #define DEFINE_CONVERSION_METHODS(Category1, category1, Category2, category2) \ |
| 251 static Type category1##TypeTo##Category2##Type(Type type) \ | 253 static Type category1##TypeTo##Category2##Type(Type type) \ |
| 252 { \ | 254 { \ |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 380 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 379 #endif | 381 #endif |
| 380 | 382 |
| 381 private: | 383 private: |
| 382 bool isEnd() const final { return true; } | 384 bool isEnd() const final { return true; } |
| 383 }; | 385 }; |
| 384 | 386 |
| 385 } // namespace blink | 387 } // namespace blink |
| 386 | 388 |
| 387 #endif // DisplayItem_h | 389 #endif // DisplayItem_h |
| OLD | NEW |