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

Unified Diff: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp

Issue 1791543005: InPrePaint document state and PrePaintTreeWalk class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..be65b9de074d97badb7cb11d7b2e10f7e72bcfe5
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
@@ -0,0 +1,55 @@
+// 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.
+
+#include "core/paint/PrePaintTreeWalk.h"
+
+#include "core/dom/DocumentLifecycle.h"
+#include "core/frame/FrameView.h"
+#include "core/frame/LocalFrame.h"
+#include "core/layout/LayoutPart.h"
+#include "core/layout/LayoutView.h"
+
+namespace blink {
+
+struct PrePaintTreeWalkContext {
+ PaintPropertyTreeBuilderContext treeBuilderContext;
+};
+
+void PrePaintTreeWalk::walk(FrameView& rootFrame)
+{
+ DCHECK(rootFrame.frame().document()->lifecycle().state() == DocumentLifecycle::InPrePaint);
+
+ PaintPropertyTreeBuilderRootContext treeBuilderRootContext;
+ m_propertyTreeBuilder.buildTreeRootNodes(rootFrame, treeBuilderRootContext);
+ PrePaintTreeWalkContext rootContext = { treeBuilderRootContext };
+ walk(rootFrame, rootContext);
+}
+
+void PrePaintTreeWalk::walk(FrameView& frameView, const PrePaintTreeWalkContext& context)
+{
+ PrePaintTreeWalkContext localContext(context);
+ m_propertyTreeBuilder.buildTreeNodes(frameView, localContext.treeBuilderContext);
+ if (LayoutView* layoutView = frameView.layoutView())
+ walk(*layoutView, localContext);
+}
+
+void PrePaintTreeWalk::walk(const LayoutObject& object, const PrePaintTreeWalkContext& context)
+{
+ PrePaintTreeWalkContext localContext(context);
+ m_propertyTreeBuilder.buildTreeNodes(object, localContext.treeBuilderContext);
+
+ for (const LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) {
+ if (child->isBoxModelObject() || child->isSVG())
+ walk(*child, localContext);
+ }
+
+ if (object.isLayoutPart()) {
+ Widget* widget = toLayoutPart(object).widget();
+ if (widget && widget->isFrameView())
+ walk(*toFrameView(widget), localContext);
+ // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281).
+ }
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/paint/PrePaintTreeWalk.h ('k') | third_party/WebKit/Source/core/paint/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698