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