| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 SubtreeDisplayItem_h | 5 #ifndef SubtreeDisplayItem_h |
| 6 #define SubtreeDisplayItem_h | 6 #define SubtreeDisplayItem_h |
| 7 | 7 |
| 8 #include "platform/geometry/FloatRect.h" | 8 #include "platform/geometry/FloatRect.h" |
| 9 #include "platform/graphics/paint/DisplayItem.h" | 9 #include "platform/graphics/paint/DisplayItem.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class PLATFORM_EXPORT SubtreeCachedDisplayItem : public DisplayItem { | 14 class PLATFORM_EXPORT SubtreeCachedDisplayItem : public DisplayItem { |
| 15 WTF_MAKE_FAST_ALLOCATED(SubtreeCachedDisplayItem); | |
| 16 public: | 15 public: |
| 17 static PassOwnPtr<SubtreeCachedDisplayItem> create(const DisplayItemClientWr
apper& client, Type type) | |
| 18 { | |
| 19 return adoptPtr(new SubtreeCachedDisplayItem(client, type)); | |
| 20 } | |
| 21 | |
| 22 private: | |
| 23 SubtreeCachedDisplayItem(const DisplayItemClientWrapper& client, Type type) | 16 SubtreeCachedDisplayItem(const DisplayItemClientWrapper& client, Type type) |
| 24 : DisplayItem(client, type) | 17 : DisplayItem(client, type) |
| 25 { | 18 { |
| 26 ASSERT(isSubtreeCachedType(type)); | 19 ASSERT(isSubtreeCachedType(type)); |
| 27 } | 20 } |
| 28 | 21 |
| 22 private: |
| 29 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED();
} | 23 virtual void replay(GraphicsContext&) override final { ASSERT_NOT_REACHED();
} |
| 30 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override
final { ASSERT_NOT_REACHED(); } | 24 virtual void appendToWebDisplayItemList(WebDisplayItemList*) const override
final { ASSERT_NOT_REACHED(); } |
| 25 void appendByMoving(DisplayItems&) override; |
| 31 }; | 26 }; |
| 32 | 27 |
| 33 class PLATFORM_EXPORT BeginSubtreeDisplayItem : public PairedBeginDisplayItem { | 28 class PLATFORM_EXPORT BeginSubtreeDisplayItem : public PairedBeginDisplayItem { |
| 34 WTF_MAKE_FAST_ALLOCATED(BeginSubtreeDisplayItem); | |
| 35 public: | 29 public: |
| 36 static PassOwnPtr<BeginSubtreeDisplayItem> create(const DisplayItemClientWra
pper& client, Type type) | 30 void appendByMoving(DisplayItems&) override; |
| 37 { | |
| 38 return adoptPtr(new BeginSubtreeDisplayItem(client, type)); | |
| 39 } | |
| 40 | 31 |
| 41 private: | |
| 42 BeginSubtreeDisplayItem(const DisplayItemClientWrapper& client, Type type) | 32 BeginSubtreeDisplayItem(const DisplayItemClientWrapper& client, Type type) |
| 43 : PairedBeginDisplayItem(client, type) | 33 : PairedBeginDisplayItem(client, type) |
| 44 { | 34 { |
| 45 ASSERT(isBeginSubtreeType(type)); | 35 ASSERT(isBeginSubtreeType(type)); |
| 46 } | 36 } |
| 47 }; | 37 }; |
| 48 | 38 |
| 49 class PLATFORM_EXPORT EndSubtreeDisplayItem : public PairedEndDisplayItem { | 39 class PLATFORM_EXPORT EndSubtreeDisplayItem : public PairedEndDisplayItem { |
| 50 WTF_MAKE_FAST_ALLOCATED(EndSubtreeDisplayItem); | |
| 51 public: | 40 public: |
| 52 static PassOwnPtr<EndSubtreeDisplayItem> create(const DisplayItemClientWrapp
er& client, Type type) | 41 void appendByMoving(DisplayItems&) override; |
| 53 { | |
| 54 return adoptPtr(new EndSubtreeDisplayItem(client, type)); | |
| 55 } | |
| 56 | 42 |
| 57 private: | |
| 58 EndSubtreeDisplayItem(const DisplayItemClientWrapper& client, Type type) | 43 EndSubtreeDisplayItem(const DisplayItemClientWrapper& client, Type type) |
| 59 : PairedEndDisplayItem(client, type) | 44 : PairedEndDisplayItem(client, type) |
| 60 { | 45 { |
| 61 ASSERT(isEndSubtreeType(type)); | 46 ASSERT(isEndSubtreeType(type)); |
| 62 } | 47 } |
| 63 | 48 |
| 64 #if ENABLE(ASSERT) | 49 #if ENABLE(ASSERT) |
| 65 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return DisplayItem::isBeginSubtreeType(otherType); } | 50 virtual bool isEndAndPairedWith(DisplayItem::Type otherType) const override
final { return DisplayItem::isBeginSubtreeType(otherType); } |
| 66 #endif | 51 #endif |
| 67 }; | 52 }; |
| 68 | 53 |
| 69 } // namespace blink | 54 } // namespace blink |
| 70 | 55 |
| 71 #endif // SubtreeDisplayItem_h | 56 #endif // SubtreeDisplayItem_h |
| OLD | NEW |