| 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 "platform/wtf/Allocator.h" | 11 #include "platform/wtf/Allocator.h" |
| 12 #include "platform/wtf/Assertions.h" | 12 #include "platform/wtf/Assertions.h" |
| 13 #include "platform/wtf/Noncopyable.h" | 13 #include "platform/wtf/Noncopyable.h" |
| 14 | 14 |
| 15 #ifndef NDEBUG | 15 #ifndef NDEBUG |
| 16 #include "platform/wtf/text/StringBuilder.h" | 16 #include "platform/wtf/text/StringBuilder.h" |
| 17 #include "platform/wtf/text/WTFString.h" | 17 #include "platform/wtf/text/WTFString.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 class SkPictureGpuAnalyzer; |
| 21 |
| 20 namespace blink { | 22 namespace blink { |
| 21 | 23 |
| 22 class GraphicsContext; | 24 class GraphicsContext; |
| 23 class IntRect; | 25 class IntRect; |
| 24 class WebDisplayItemList; | 26 class WebDisplayItemList; |
| 25 | 27 |
| 26 class PLATFORM_EXPORT DisplayItem { | 28 class PLATFORM_EXPORT DisplayItem { |
| 27 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 29 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 28 | 30 |
| 29 public: | 31 public: |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 330 |
| 329 // True if the client is non-null. Because m_client is const, this should | 331 // True if the client is non-null. Because m_client is const, this should |
| 330 // never be false except when we explicitly create a tombstone/"dead display | 332 // never be false except when we explicitly create a tombstone/"dead display |
| 331 // item" as part of moving an item from one list to another (see: | 333 // item" as part of moving an item from one list to another (see: |
| 332 // DisplayItemList::appendByMoving). | 334 // DisplayItemList::appendByMoving). |
| 333 bool HasValidClient() const { return client_; } | 335 bool HasValidClient() const { return client_; } |
| 334 | 336 |
| 335 virtual bool DrawsContent() const { return false; } | 337 virtual bool DrawsContent() const { return false; } |
| 336 | 338 |
| 337 // Override to implement specific analysis strategies. | 339 // Override to implement specific analysis strategies. |
| 338 virtual int NumberOfSlowPaths() const { return 0; } | 340 virtual void AnalyzeForGpuRasterization(SkPictureGpuAnalyzer&) const {} |
| 339 | 341 |
| 340 #ifndef NDEBUG | 342 #ifndef NDEBUG |
| 341 static WTF::String TypeAsDebugString(DisplayItem::Type); | 343 static WTF::String TypeAsDebugString(DisplayItem::Type); |
| 342 const WTF::String ClientDebugString() const { return client_debug_string_; } | 344 const WTF::String ClientDebugString() const { return client_debug_string_; } |
| 343 void SetClientDebugString(const WTF::String& s) { client_debug_string_ = s; } | 345 void SetClientDebugString(const WTF::String& s) { client_debug_string_ = s; } |
| 344 WTF::String AsDebugString() const; | 346 WTF::String AsDebugString() const; |
| 345 virtual void DumpPropertiesAsDebugString(WTF::StringBuilder&) const; | 347 virtual void DumpPropertiesAsDebugString(WTF::StringBuilder&) const; |
| 346 #endif | 348 #endif |
| 347 | 349 |
| 348 private: | 350 private: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 bool IsEndAndPairedWith(DisplayItem::Type other_type) const override = 0; | 402 bool IsEndAndPairedWith(DisplayItem::Type other_type) const override = 0; |
| 401 #endif | 403 #endif |
| 402 | 404 |
| 403 private: | 405 private: |
| 404 bool IsEnd() const final { return true; } | 406 bool IsEnd() const final { return true; } |
| 405 }; | 407 }; |
| 406 | 408 |
| 407 } // namespace blink | 409 } // namespace blink |
| 408 | 410 |
| 409 #endif // DisplayItem_h | 411 #endif // DisplayItem_h |
| OLD | NEW |