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

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

Issue 2033183002: [SPv2] Paint invalidation in PreWalkTreeWalk, plumbed on PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RootFrame
Patch Set: Created 4 years, 6 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
index 70304d288bcd67cc455a04d683cf1767f325304a..b8020989ff51bae0af484dc03fcd518212f50e0d 100644
--- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
+++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
@@ -14,7 +14,14 @@
namespace blink {
struct PrePaintTreeWalkContext {
+ PrePaintTreeWalkContext() { }
+ PrePaintTreeWalkContext(const PaintPropertyTreeBuilderContext& parentTreeBuilderContext)
+ : treeBuilderContext(parentTreeBuilderContext) { }
+
PaintPropertyTreeBuilderContext treeBuilderContext;
+ // This will be initialized by PaintInvalidator::invalidatePaintIfNeeded().
+ // TODO(wangxianzhu): Change to copy-and-update pattern like PaintPropertyTreeBuilderContext.
+ Optional<PaintInvalidatorContext> paintInvalidatorContext;
};
void PrePaintTreeWalk::walk(FrameView& rootFrame)
@@ -24,24 +31,30 @@ void PrePaintTreeWalk::walk(FrameView& rootFrame)
PrePaintTreeWalkContext rootContext;
m_propertyTreeBuilder.buildTreeRootNodes(rootFrame, rootContext.treeBuilderContext);
walk(rootFrame, rootContext);
+ m_paintInvalidator.processPendingDelayedPaintInvalidations();
}
void PrePaintTreeWalk::walk(FrameView& frameView, const PrePaintTreeWalkContext& context)
{
- PrePaintTreeWalkContext localContext(context);
+ PrePaintTreeWalkContext localContext(context.treeBuilderContext);
m_propertyTreeBuilder.buildTreeNodes(frameView, localContext.treeBuilderContext);
+
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
+ m_paintInvalidator.invalidatePaintIfNeeded(frameView, localContext.treeBuilderContext, localContext.paintInvalidatorContext);
+
if (LayoutView* layoutView = frameView.layoutView())
walk(*layoutView, localContext);
}
void PrePaintTreeWalk::walk(const LayoutObject& object, const PrePaintTreeWalkContext& context)
{
- PrePaintTreeWalkContext localContext(context);
+ PrePaintTreeWalkContext localContext(context.treeBuilderContext);
m_propertyTreeBuilder.buildTreeNodes(object, localContext.treeBuilderContext);
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && context.paintInvalidatorContext)
+ m_paintInvalidator.invalidatePaintIfNeeded(object, localContext.treeBuilderContext, *context.paintInvalidatorContext, localContext.paintInvalidatorContext);
+
for (const LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) {
- if (!child->isBoxModelObject() && !child->isSVG())
- continue;
// Column spanners are walked through their placeholders. See below.
if (child->isColumnSpanAll())
continue;

Powered by Google App Engine
This is Rietveld 408576698