| 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 #include "wtf/PassOwnPtr.h" | 14 #include "wtf/PassOwnPtr.h" |
| 15 | 15 |
| 16 #ifndef NDEBUG | 16 #ifndef NDEBUG |
| 17 #include "wtf/text/StringBuilder.h" | 17 #include "wtf/text/StringBuilder.h" |
| 18 #include "wtf/text/WTFString.h" | 18 #include "wtf/text/WTFString.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 class SkPictureGpuAnalyzer; |
| 21 | 22 |
| 22 namespace blink { | 23 namespace blink { |
| 23 | 24 |
| 24 class GraphicsContext; | 25 class GraphicsContext; |
| 25 class IntRect; | 26 class IntRect; |
| 26 class WebDisplayItemList; | 27 class WebDisplayItemList; |
| 27 | 28 |
| 28 class PLATFORM_EXPORT DisplayItem { | 29 class PLATFORM_EXPORT DisplayItem { |
| 29 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 30 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 30 public: | 31 public: |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 #endif | 344 #endif |
| 344 | 345 |
| 345 // True if the client is non-null. Because m_client is const, this should | 346 // True if the client is non-null. Because m_client is const, this should |
| 346 // never be false except when we explicitly create a tombstone/"dead display | 347 // never be false except when we explicitly create a tombstone/"dead display |
| 347 // item" as part of moving an item from one list to another (see: | 348 // item" as part of moving an item from one list to another (see: |
| 348 // DisplayItemList::appendByMoving). | 349 // DisplayItemList::appendByMoving). |
| 349 bool hasValidClient() const { return m_client; } | 350 bool hasValidClient() const { return m_client; } |
| 350 | 351 |
| 351 virtual bool drawsContent() const { return false; } | 352 virtual bool drawsContent() const { return false; } |
| 352 | 353 |
| 354 // Override to implement specific analysis strategies. |
| 355 virtual void analyzeForGpuRasterization(SkPictureGpuAnalyzer&) const { } |
| 356 |
| 353 #ifndef NDEBUG | 357 #ifndef NDEBUG |
| 354 static WTF::String typeAsDebugString(DisplayItem::Type); | 358 static WTF::String typeAsDebugString(DisplayItem::Type); |
| 355 const WTF::String clientDebugString() const { return m_clientDebugString; } | 359 const WTF::String clientDebugString() const { return m_clientDebugString; } |
| 356 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } | 360 void setClientDebugString(const WTF::String& s) { m_clientDebugString = s; } |
| 357 WTF::String asDebugString() const; | 361 WTF::String asDebugString() const; |
| 358 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; | 362 virtual void dumpPropertiesAsDebugString(WTF::StringBuilder&) const; |
| 359 #endif | 363 #endif |
| 360 | 364 |
| 361 private: | 365 private: |
| 362 // The default DisplayItem constructor is only used by | 366 // The default DisplayItem constructor is only used by |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 404 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
| 401 #endif | 405 #endif |
| 402 | 406 |
| 403 private: | 407 private: |
| 404 bool isEnd() const final { return true; } | 408 bool isEnd() const final { return true; } |
| 405 }; | 409 }; |
| 406 | 410 |
| 407 } // namespace blink | 411 } // namespace blink |
| 408 | 412 |
| 409 #endif // DisplayItem_h | 413 #endif // DisplayItem_h |
| OLD | NEW |