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

Unified Diff: Source/core/paint/SubtreeInfoRecorder.h

Issue 892293002: First version of new merge algorithm (not enabled yet) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Traverse indices vector Created 5 years, 10 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/core/paint/SubtreeInfoRecorder.h
diff --git a/Source/core/paint/SubtreeInfoRecorder.h b/Source/core/paint/SubtreeInfoRecorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..debed2e5c5047432317e8733e3bf3e2d7983e17c
--- /dev/null
+++ b/Source/core/paint/SubtreeInfoRecorder.h
@@ -0,0 +1,46 @@
+// 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 SubtreeInfoRecorder_h
+#define SubtreeInfoRecorder_h
+
+#include "core/rendering/PaintPhase.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace blink {
+
+class DisplayItem;
+class DisplayItemList;
+class GraphicsContext;
+class RenderObject;
+
+// Records subtree information during painting. The recorder's life span covers
+// all painting operations executed during the root of the subtree's paint method
+// for the paint phase.
+class SubtreeInfoRecorder {
pdr. 2015/02/05 03:35:57 (Optional) bikeshed: SubtreeRecorder?
Xianzhu 2015/02/05 17:57:02 SubtreeRecorder looks better. Done.
+public:
+ SubtreeInfoRecorder(GraphicsContext*, const RenderObject& root, PaintPhase);
+
+ ~SubtreeInfoRecorder();
+
+ // This method should be called before we actually paint the subtree, then we'll
+ // issue a pair of BeginSubtree/EndSubtree display items to enclose all display
+ // items when we paint the subtree.
+ // Omit this call if we skip painting of the whole subtree (when e.g. the subtree
+ // is out of the viewport, or the whole subtree is not invalidated), then we'll
+ // issue a SubtreeCached display item.
+ void begin();
+
+private:
+ void addDisplayItem(PassOwnPtr<DisplayItem>);
+
+ DisplayItemList* m_displayItemList;
+ const RenderObject& m_subtreeRoot;
+ const PaintPhase m_paintPhase;
+ bool m_begun;
+};
+
+} // namespace blink
+
+#endif // SubtreeInfoRecorder_h

Powered by Google App Engine
This is Rietveld 408576698