| 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 348 |
| 351 // True if the client is non-null. Because m_client is const, this should | 349 // True if the client is non-null. Because m_client is const, this should |
| 352 // never be false except when we explicitly create a tombstone/"dead display | 350 // never be false except when we explicitly create a tombstone/"dead display |
| 353 // item" as part of moving an item from one list to another (see: | 351 // item" as part of moving an item from one list to another (see: |
| 354 // DisplayItemList::appendByMoving). | 352 // DisplayItemList::appendByMoving). |
| 355 bool hasValidClient() const { return m_client; } | 353 bool hasValidClient() const { return m_client; } |
| 356 | 354 |
| 357 virtual bool drawsContent() const { return false; } | 355 virtual bool drawsContent() const { return false; } |
| 358 | 356 |
| 359 // Override to implement specific analysis strategies. | 357 // Override to implement specific analysis strategies. |
| 360 virtual void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const {} | 358 virtual int numberOfSlowPaths() const { return 0; } |
| 361 | 359 |
| 362 #ifndef NDEBUG | 360 #ifndef NDEBUG |
| 363 static WTF::String typeAsDebugString(DisplayItem::Type); | 361 static WTF::String typeAsDebugString(DisplayItem::Type); |
| 364 const WTF::String clientDebugString() const { return m_clientDebugString; } | 362 const WTF::String clientDebugString() const { return m_clientDebugString; } |
| 365 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } | 363 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } |
| 366 WTF::String asDebugString() const; | 364 WTF::String asDebugString() const; |
| 367 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; | 365 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; |
| 368 #endif | 366 #endif |
| 369 | 367 |
| 370 private: | 368 private: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 420 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 423 #endif | 421 #endif |
| 424 | 422 |
| 425 private: | 423 private: |
| 426 bool isEnd() const final { return true; } | 424 bool isEnd() const final { return true; } |
| 427 }; | 425 }; |
| 428 | 426 |
| 429 } // namespace blink | 427 } // namespace blink |
| 430 | 428 |
| 431 #endif // DisplayItem_h | 429 #endif // DisplayItem_h |
| OLD | NEW |