| 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" |
| 11 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
| 12 #include "wtf/Assertions.h" | 12 #include "wtf/Assertions.h" |
| 13 #include "wtf/Noncopyable.h" | 13 #include "wtf/Noncopyable.h" |
| 14 | 14 |
| 15 #ifndef NDEBUG | 15 #ifndef NDEBUG |
| 16 #include "wtf/text/StringBuilder.h" | 16 #include "wtf/text/StringBuilder.h" |
| 17 #include "wtf/text/WTFString.h" | 17 #include "wtf/text/WTFString.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 class SkPictureGpuAnalyzer; | |
| 21 | |
| 22 namespace blink { | 20 namespace blink { |
| 23 | 21 |
| 24 class GraphicsContext; | 22 class GraphicsContext; |
| 25 class IntRect; | 23 class IntRect; |
| 26 class WebDisplayItemList; | 24 class WebDisplayItemList; |
| 27 | 25 |
| 28 class PLATFORM_EXPORT DisplayItem { | 26 class PLATFORM_EXPORT DisplayItem { |
| 29 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 27 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 30 | 28 |
| 31 public: | 29 public: |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 344 |
| 347 // True if the client is non-null. Because m_client is const, this should | 345 // True if the client is non-null. Because m_client is const, this should |
| 348 // never be false except when we explicitly create a tombstone/"dead display | 346 // never be false except when we explicitly create a tombstone/"dead display |
| 349 // item" as part of moving an item from one list to another (see: | 347 // item" as part of moving an item from one list to another (see: |
| 350 // DisplayItemList::appendByMoving). | 348 // DisplayItemList::appendByMoving). |
| 351 bool hasValidClient() const { return m_client; } | 349 bool hasValidClient() const { return m_client; } |
| 352 | 350 |
| 353 virtual bool drawsContent() const { return false; } | 351 virtual bool drawsContent() const { return false; } |
| 354 | 352 |
| 355 // Override to implement specific analysis strategies. | 353 // Override to implement specific analysis strategies. |
| 356 virtual void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const {} | 354 virtual int numberOfSlowPaths() const { return 0; } |
| 357 | 355 |
| 358 #ifndef NDEBUG | 356 #ifndef NDEBUG |
| 359 static WTF::String typeAsDebugString(DisplayItem::Type); | 357 static WTF::String typeAsDebugString(DisplayItem::Type); |
| 360 const WTF::String clientDebugString() const { return m_clientDebugString; } | 358 const WTF::String clientDebugString() const { return m_clientDebugString; } |
| 361 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } | 359 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } |
| 362 WTF::String asDebugString() const; | 360 WTF::String asDebugString() const; |
| 363 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; | 361 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; |
| 364 #endif | 362 #endif |
| 365 | 363 |
| 366 private: | 364 private: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 416 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 419 #endif | 417 #endif |
| 420 | 418 |
| 421 private: | 419 private: |
| 422 bool isEnd() const final { return true; } | 420 bool isEnd() const final { return true; } |
| 423 }; | 421 }; |
| 424 | 422 |
| 425 } // namespace blink | 423 } // namespace blink |
| 426 | 424 |
| 427 #endif // DisplayItem_h | 425 #endif // DisplayItem_h |
| OLD | NEW |