Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1827)

Unified Diff: Source/platform/graphics/paint/SubtreeDisplayItem.h

Issue 847783003: New display item caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: New method, supporting partial paint Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698