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