| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 #endif | 321 #endif |
| 322 | 322 |
| 323 virtual bool drawsContent() const { return false; } | 323 virtual bool drawsContent() const { return false; } |
| 324 | 324 |
| 325 bool isValid() const { return m_client; } | 325 bool isValid() const { return m_client; } |
| 326 void clearClientForUnderInvalidationChecking() { m_client = nullptr; } | 326 void clearClientForUnderInvalidationChecking() { m_client = nullptr; } |
| 327 | 327 |
| 328 #ifndef NDEBUG | 328 #ifndef NDEBUG |
| 329 static WTF::String typeAsDebugString(DisplayItem::Type); | 329 static WTF::String typeAsDebugString(DisplayItem::Type); |
| 330 const WTF::String& clientDebugString() const { return m_clientDebugString; } | 330 const WTF::String& clientDebugString() const { return m_clientDebugString; } |
| 331 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } |
| 331 WTF::String asDebugString() const; | 332 WTF::String asDebugString() const; |
| 332 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; | 333 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; |
| 333 #endif | 334 #endif |
| 334 | 335 |
| 335 private: | 336 private: |
| 336 // The default DisplayItem constructor is only used by | 337 // The default DisplayItem constructor is only used by |
| 337 // ContiguousContainer::appendByMoving where an invalid DisplaItem is | 338 // ContiguousContainer::appendByMoving where an invalid DisplaItem is |
| 338 // constructed at the source location. | 339 // constructed at the source location. |
| 339 template <typename T, unsigned alignment> friend class ContiguousContainer; | 340 template <typename T, unsigned alignment> friend class ContiguousContainer; |
| 340 | 341 |
| 341 DisplayItem() | 342 DisplayItem() |
| 342 : m_client(nullptr) | 343 : m_client(nullptr) |
| 343 , m_scope(0) | 344 , m_scope(0) |
| 344 , m_type(UninitializedType) | 345 , m_type(UninitializedType) |
| 345 , m_derivedSize(sizeof(*this)) | 346 , m_derivedSize(sizeof(*this)) |
| 346 , m_skippedCache(false) | 347 , m_skippedCache(false) |
| 347 #ifndef NDEBUG | |
| 348 , m_clientDebugString("invalid") | |
| 349 #endif | |
| 350 { } | 348 { } |
| 351 | 349 |
| 352 DisplayItemClient m_client; | 350 DisplayItemClient m_client; |
| 353 unsigned m_scope; | 351 unsigned m_scope; |
| 354 static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits
"); | 352 static_assert(TypeLast < (1 << 16), "DisplayItem::Type should fit in 16 bits
"); |
| 355 const Type m_type : 16; | 353 const Type m_type : 16; |
| 356 unsigned m_derivedSize : 8; // size of the actual derived class | 354 unsigned m_derivedSize : 8; // size of the actual derived class |
| 357 unsigned m_skippedCache : 1; | 355 unsigned m_skippedCache : 1; |
| 358 | 356 |
| 359 #ifndef NDEBUG | 357 #ifndef NDEBUG |
| (...skipping 17 matching lines...) Expand all Loading... |
| 377 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 375 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 378 #endif | 376 #endif |
| 379 | 377 |
| 380 private: | 378 private: |
| 381 bool isEnd() const final { return true; } | 379 bool isEnd() const final { return true; } |
| 382 }; | 380 }; |
| 383 | 381 |
| 384 } // namespace blink | 382 } // namespace blink |
| 385 | 383 |
| 386 #endif // DisplayItem_h | 384 #endif // DisplayItem_h |
| OLD | NEW |