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

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

Issue 2208463003: First step of PaintInvalidator implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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 be81d3c40574de62cd4b99316fc391a69fc6cac5..12bdc0af5343f0caf48836ca9ebcc16ad791b378 100644
--- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
+++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
@@ -14,14 +14,14 @@
namespace blink {
struct PrePaintTreeWalkContext {
- PrePaintTreeWalkContext() { }
- PrePaintTreeWalkContext(const PaintPropertyTreeBuilderContext& parentTreeBuilderContext)
- : treeBuilderContext(parentTreeBuilderContext) { }
+ PrePaintTreeWalkContext() : paintInvalidatorContext(treeBuilderContext) { }
+ PrePaintTreeWalkContext(const PrePaintTreeWalkContext& parentContext)
+ : treeBuilderContext(parentContext.treeBuilderContext)
+ , paintInvalidatorContext(treeBuilderContext, parentContext.paintInvalidatorContext)
+ { }
PaintPropertyTreeBuilderContext treeBuilderContext;
- // This will be initialized by PaintInvalidator::invalidatePaintIfNeeded().
- // TODO(wangxianzhu): Change to copy-and-update pattern like PaintPropertyTreeBuilderContext.
- Optional<PaintInvalidatorContext> paintInvalidatorContext;
+ PaintInvalidatorContext paintInvalidatorContext;
};
void PrePaintTreeWalk::walk(FrameView& rootFrame)
@@ -36,11 +36,11 @@ void PrePaintTreeWalk::walk(FrameView& rootFrame)
void PrePaintTreeWalk::walk(FrameView& frameView, const PrePaintTreeWalkContext& context)
{
- PrePaintTreeWalkContext localContext(context.treeBuilderContext);
+ PrePaintTreeWalkContext localContext(context);
m_propertyTreeBuilder.buildTreeNodes(frameView, localContext.treeBuilderContext);
if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
- m_paintInvalidator.invalidatePaintIfNeeded(frameView, localContext.treeBuilderContext, localContext.paintInvalidatorContext);
+ m_paintInvalidator.invalidatePaintIfNeeded(frameView, localContext.paintInvalidatorContext);
if (LayoutView* layoutView = frameView.layoutView())
walk(*layoutView, localContext);
@@ -48,11 +48,11 @@ void PrePaintTreeWalk::walk(FrameView& frameView, const PrePaintTreeWalkContext&
void PrePaintTreeWalk::walk(const LayoutObject& object, const PrePaintTreeWalkContext& context)
{
- PrePaintTreeWalkContext localContext(context.treeBuilderContext);
+ PrePaintTreeWalkContext localContext(context);
m_propertyTreeBuilder.buildTreeNodes(object, localContext.treeBuilderContext);
- if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && context.paintInvalidatorContext)
- m_paintInvalidator.invalidatePaintIfNeeded(object, localContext.treeBuilderContext, *context.paintInvalidatorContext, localContext.paintInvalidatorContext);
+ if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
+ m_paintInvalidator.invalidatePaintIfNeeded(object, localContext.paintInvalidatorContext);
for (const LayoutObject* child = object.slowFirstChild(); child; child = child->nextSibling()) {
// Column spanners are walked through their placeholders. See below.

Powered by Google App Engine
This is Rietveld 408576698