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

Side by Side Diff: third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp

Issue 2456113002: Separate property and context updates in PaintPropertyTreeBuilder (Closed)
Patch Set: Cleanup names/comments, fix preserves3d bug Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PrePaintTreeWalk.h" 5 #include "core/paint/PrePaintTreeWalk.h"
6 6
7 #include "core/dom/DocumentLifecycle.h" 7 #include "core/dom/DocumentLifecycle.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h"
(...skipping 23 matching lines...) Expand all
34 walk(rootFrame, initialContext); 34 walk(rootFrame, initialContext);
35 m_paintInvalidator.processPendingDelayedPaintInvalidations(); 35 m_paintInvalidator.processPendingDelayedPaintInvalidations();
36 } 36 }
37 37
38 void PrePaintTreeWalk::walk(FrameView& frameView, 38 void PrePaintTreeWalk::walk(FrameView& frameView,
39 const PrePaintTreeWalkContext& context) { 39 const PrePaintTreeWalkContext& context) {
40 if (frameView.shouldThrottleRendering()) 40 if (frameView.shouldThrottleRendering())
41 return; 41 return;
42 42
43 PrePaintTreeWalkContext localContext(context); 43 PrePaintTreeWalkContext localContext(context);
44 m_propertyTreeBuilder.buildTreeNodes(frameView, 44 m_propertyTreeBuilder.updatePropertiesAndContext(
45 localContext.treeBuilderContext); 45 frameView, localContext.treeBuilderContext);
46 46
47 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { 47 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
48 m_paintInvalidator.invalidatePaintIfNeeded( 48 m_paintInvalidator.invalidatePaintIfNeeded(
49 frameView, localContext.paintInvalidatorContext); 49 frameView, localContext.paintInvalidatorContext);
50 } 50 }
51 51
52 if (LayoutView* layoutView = frameView.layoutView()) 52 if (LayoutView* layoutView = frameView.layoutView())
53 walk(*layoutView, localContext); 53 walk(*layoutView, localContext);
54 54
55 #if DCHECK_IS_ON() 55 #if DCHECK_IS_ON()
(...skipping 12 matching lines...) Expand all
68 // positioned descendants if their containers are between the multi-column 68 // positioned descendants if their containers are between the multi-column
69 // container and the spanner. See PaintPropertyTreeBuilder for details. 69 // container and the spanner. See PaintPropertyTreeBuilder for details.
70 localContext.treeBuilderContext.isUnderMultiColumnSpanner = true; 70 localContext.treeBuilderContext.isUnderMultiColumnSpanner = true;
71 object.getMutableForPainting().clearPaintInvalidationFlags(); 71 object.getMutableForPainting().clearPaintInvalidationFlags();
72 walk(*toLayoutMultiColumnSpannerPlaceholder(object) 72 walk(*toLayoutMultiColumnSpannerPlaceholder(object)
73 .layoutObjectInFlowThread(), 73 .layoutObjectInFlowThread(),
74 localContext); 74 localContext);
75 return; 75 return;
76 } 76 }
77 77
78 m_propertyTreeBuilder.buildTreeNodesForSelf(object, 78 m_propertyTreeBuilder.updatePropertiesAndContextForSelf(
79 localContext.treeBuilderContext); 79 object, localContext.treeBuilderContext);
80 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) 80 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled())
81 m_paintInvalidator.invalidatePaintIfNeeded( 81 m_paintInvalidator.invalidatePaintIfNeeded(
82 object, localContext.paintInvalidatorContext); 82 object, localContext.paintInvalidatorContext);
83 m_propertyTreeBuilder.buildTreeNodesForChildren( 83 m_propertyTreeBuilder.updatePropertiesAndContextForChildren(
84 object, localContext.treeBuilderContext); 84 object, localContext.treeBuilderContext);
85 85
86 for (const LayoutObject* child = object.slowFirstChild(); child; 86 for (const LayoutObject* child = object.slowFirstChild(); child;
87 child = child->nextSibling()) { 87 child = child->nextSibling()) {
88 // Column spanners are walked through their placeholders. See above. 88 // Column spanners are walked through their placeholders. See above.
89 if (child->isColumnSpanAll()) 89 if (child->isColumnSpanAll())
90 continue; 90 continue;
91 walk(*child, localContext); 91 walk(*child, localContext);
92 } 92 }
93 93
94 if (object.isLayoutPart()) { 94 if (object.isLayoutPart()) {
95 const LayoutPart& layoutPart = toLayoutPart(object); 95 const LayoutPart& layoutPart = toLayoutPart(object);
96 Widget* widget = layoutPart.widget(); 96 Widget* widget = layoutPart.widget();
97 if (widget && widget->isFrameView()) { 97 if (widget && widget->isFrameView()) {
98 localContext.treeBuilderContext.current.paintOffset += 98 localContext.treeBuilderContext.current.paintOffset +=
99 layoutPart.replacedContentRect().location() - 99 layoutPart.replacedContentRect().location() -
100 widget->frameRect().location(); 100 widget->frameRect().location();
101 localContext.treeBuilderContext.current.paintOffset = 101 localContext.treeBuilderContext.current.paintOffset =
102 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset); 102 roundedIntPoint(localContext.treeBuilderContext.current.paintOffset);
103 walk(*toFrameView(widget), localContext); 103 walk(*toFrameView(widget), localContext);
104 } 104 }
105 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). 105 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281).
106 } 106 }
107 } 107 }
108 108
109 } // namespace blink 109 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698