Chromium Code Reviews| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 329 static bool isCacheableType(Type type) { | 329 static bool isCacheableType(Type type) { |
| 330 return isDrawingType(type) || type == kSubsequence; | 330 return isDrawingType(type) || type == kSubsequence; |
| 331 } | 331 } |
| 332 bool isCacheable() const { | 332 bool isCacheable() const { |
| 333 return !skippedCache() && isCacheableType(m_type); | 333 return !skippedCache() && isCacheableType(m_type); |
| 334 } | 334 } |
| 335 | 335 |
| 336 virtual bool isBegin() const { return false; } | 336 virtual bool isBegin() const { return false; } |
| 337 virtual bool isEnd() const { return false; } | 337 virtual bool isEnd() const { return false; } |
| 338 | 338 |
| 339 #if DCHECK_IS_ON() | 339 #ifdef NDEBUG |
| 340 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { | 340 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { |
| 341 return false; | 341 return false; |
| 342 } | 342 } |
| 343 #endif | 343 #endif |
| 344 | 344 |
| 345 virtual bool equals(const DisplayItem& other) const { | 345 virtual bool equals(const DisplayItem& other) const { |
| 346 return m_client == other.m_client && m_type == other.m_type && | 346 return m_client == other.m_client && m_type == other.m_type && |
| 347 m_derivedSize == other.m_derivedSize && | 347 m_derivedSize == other.m_derivedSize && |
| 348 m_skippedCache == other.m_skippedCache; | 348 m_skippedCache == other.m_skippedCache; |
| 349 } | 349 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 bool isBegin() const final { return true; } | 411 bool isBegin() const final { return true; } |
| 412 }; | 412 }; |
| 413 | 413 |
| 414 class PLATFORM_EXPORT PairedEndDisplayItem : public DisplayItem { | 414 class PLATFORM_EXPORT PairedEndDisplayItem : public DisplayItem { |
| 415 protected: | 415 protected: |
| 416 PairedEndDisplayItem(const DisplayItemClient& client, | 416 PairedEndDisplayItem(const DisplayItemClient& client, |
| 417 Type type, | 417 Type type, |
| 418 size_t derivedSize) | 418 size_t derivedSize) |
| 419 : DisplayItem(client, type, derivedSize) {} | 419 : DisplayItem(client, type, derivedSize) {} |
| 420 | 420 |
| 421 #if ENABLE(ASSERT) | 421 #ifdef NDEBUG |
| 422 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 422 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
|
Alexander Alekseev
2016/11/18 22:32:15
This is declared in the base class only if NDEBUG
| |
| 423 #endif | 423 #endif |
| 424 | 424 |
| 425 private: | 425 private: |
| 426 bool isEnd() const final { return true; } | 426 bool isEnd() const final { return true; } |
| 427 }; | 427 }; |
| 428 | 428 |
| 429 } // namespace blink | 429 } // namespace blink |
| 430 | 430 |
| 431 #endif // DisplayItem_h | 431 #endif // DisplayItem_h |
| OLD | NEW |