| 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 BeginSubtreeDisplayItem final : public PairedBeginDisplayItem { | 14 class BeginSubtreeDisplayItem final : public PairedBeginDisplayItem { |
| 15 public: | 15 public: |
| 16 BeginSubtreeDisplayItem(const DisplayItemClientWrapper& client, Type type) | 16 BeginSubtreeDisplayItem(const DisplayItemClientWrapper& client) |
| 17 : PairedBeginDisplayItem(client, type, sizeof(*this)) | 17 : PairedBeginDisplayItem(client, BeginSubtree, sizeof(*this)) |
| 18 { | 18 { } |
| 19 ASSERT(isBeginSubtreeType(type)); | |
| 20 } | |
| 21 }; | 19 }; |
| 22 | 20 |
| 23 class EndSubtreeDisplayItem final : public PairedEndDisplayItem { | 21 class EndSubtreeDisplayItem final : public PairedEndDisplayItem { |
| 24 public: | 22 public: |
| 25 EndSubtreeDisplayItem(const DisplayItemClientWrapper& client, Type type) | 23 EndSubtreeDisplayItem(const DisplayItemClientWrapper& client) |
| 26 : PairedEndDisplayItem(client, type, sizeof(*this)) | 24 : PairedEndDisplayItem(client, EndSubtree, sizeof(*this)) |
| 27 { | 25 { } |
| 28 ASSERT(isEndSubtreeType(type)); | |
| 29 } | |
| 30 | 26 |
| 31 #if ENABLE(ASSERT) | 27 #if ENABLE(ASSERT) |
| 32 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return Di
splayItem::isBeginSubtreeType(otherType); } | 28 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot
herType == BeginSubtree; } |
| 33 #endif | 29 #endif |
| 34 }; | 30 }; |
| 35 | 31 |
| 36 } // namespace blink | 32 } // namespace blink |
| 37 | 33 |
| 38 #endif // SubtreeDisplayItem_h | 34 #endif // SubtreeDisplayItem_h |
| OLD | NEW |