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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) | 296 DEFINE_PAIRED_CATEGORY_METHODS(Transform3D, transform3D) |
297 | 297 |
298 static bool isCacheableType(Type type) { return isDrawingType(type) || type
== kSubsequence; } | 298 static bool isCacheableType(Type type) { return isDrawingType(type) || type
== kSubsequence; } |
299 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } | 299 bool isCacheable() const { return !skippedCache() && isCacheableType(m_type)
; } |
300 | 300 |
301 virtual bool isBegin() const { return false; } | 301 virtual bool isBegin() const { return false; } |
302 virtual bool isEnd() const { return false; } | 302 virtual bool isEnd() const { return false; } |
303 | 303 |
304 #if DCHECK_IS_ON() | 304 #if DCHECK_IS_ON() |
305 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } | 305 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const { return
false; } |
| 306 #endif |
| 307 |
306 virtual bool equals(const DisplayItem& other) const | 308 virtual bool equals(const DisplayItem& other) const |
307 { | 309 { |
308 return m_client == other.m_client | 310 return m_client == other.m_client |
309 && m_type == other.m_type | 311 && m_type == other.m_type |
310 && m_derivedSize == other.m_derivedSize | 312 && m_derivedSize == other.m_derivedSize |
311 && m_skippedCache == other.m_skippedCache; | 313 && m_skippedCache == other.m_skippedCache; |
312 } | 314 } |
313 #endif | |
314 | 315 |
315 // True if the client is non-null. Because m_client is const, this should | 316 // True if the client is non-null. Because m_client is const, this should |
316 // never be false except when we explicitly create a tombstone/"dead display | 317 // never be false except when we explicitly create a tombstone/"dead display |
317 // item" as part of moving an item from one list to another (see: | 318 // item" as part of moving an item from one list to another (see: |
318 // DisplayItemList::appendByMoving). | 319 // DisplayItemList::appendByMoving). |
319 bool hasValidClient() const { return m_client; } | 320 bool hasValidClient() const { return m_client; } |
320 | 321 |
321 virtual bool drawsContent() const { return false; } | 322 virtual bool drawsContent() const { return false; } |
322 | 323 |
323 // Override to implement specific analysis strategies. | 324 // Override to implement specific analysis strategies. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 382 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
382 #endif | 383 #endif |
383 | 384 |
384 private: | 385 private: |
385 bool isEnd() const final { return true; } | 386 bool isEnd() const final { return true; } |
386 }; | 387 }; |
387 | 388 |
388 } // namespace blink | 389 } // namespace blink |
389 | 390 |
390 #endif // DisplayItem_h | 391 #endif // DisplayItem_h |
OLD | NEW |