Index: Source/platform/graphics/paint/SubtreeDisplayItem.h |
diff --git a/Source/platform/graphics/paint/SubtreeDisplayItem.h b/Source/platform/graphics/paint/SubtreeDisplayItem.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..163199284427a43df355e9288caec48cd2bdd039 |
--- /dev/null |
+++ b/Source/platform/graphics/paint/SubtreeDisplayItem.h |
@@ -0,0 +1,72 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SubtreeDisplayItem_h |
+#define SubtreeDisplayItem_h |
+ |
+#include "platform/geometry/FloatRect.h" |
+#include "platform/graphics/paint/DisplayItem.h" |
+#include "wtf/Assertions.h" |
+ |
+namespace blink { |
+ |
+class PLATFORM_EXPORT SubtreeCachedDisplayItem : public DisplayItem { |
+ WTF_MAKE_FAST_ALLOCATED; |
+public: |
+ static PassOwnPtr<SubtreeCachedDisplayItem> create(DisplayItemClient client, Type type) |
+ { |
+ return adoptPtr(new SubtreeCachedDisplayItem(client, type)); |
+ } |
+ |
+private: |
+ SubtreeCachedDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { } |
+ |
+ virtual bool isSubtreeCached() const final { return true; } |
+ virtual void replay(GraphicsContext*) final { ASSERT_NOT_REACHED(); } |
+ virtual void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NOT_REACHED(); } |
+ |
+#ifndef NDEBUG |
+ virtual const char* name() const override { return "SubtreeCached"; } |
+#endif |
+}; |
+ |
+class PLATFORM_EXPORT BeginSubtreeDisplayItem : public DisplayItem { |
+ WTF_MAKE_FAST_ALLOCATED; |
+public: |
+ static PassOwnPtr<BeginSubtreeDisplayItem> create(DisplayItemClient client, Type type) |
+ { |
+ return adoptPtr(new BeginSubtreeDisplayItem(client, type)); |
+ } |
+ |
+private: |
+ BeginSubtreeDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { } |
+ |
+ virtual bool isBeginSubtree() const final { return true; } |
+ |
+#ifndef NDEBUG |
+ virtual const char* name() const override { return "BeginSubtree"; } |
+#endif |
+}; |
+ |
+class PLATFORM_EXPORT EndSubtreeDisplayItem : public DisplayItem { |
+ WTF_MAKE_FAST_ALLOCATED; |
+public: |
+ static PassOwnPtr<EndSubtreeDisplayItem> create(DisplayItemClient client, Type type) |
+ { |
+ return adoptPtr(new EndSubtreeDisplayItem(client, type)); |
+ } |
+ |
+private: |
+ EndSubtreeDisplayItem(DisplayItemClient client, Type type) : DisplayItem(client, type) { } |
+ |
+ virtual bool isEndSubtree() const final { return true; } |
+ |
+#ifndef NDEBUG |
+ virtual const char* name() const override { return "EndSubtree"; } |
+#endif |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // SubtreeDisplayItem_h |