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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h

Issue 2515113002: WIP: Prune the prepaint tree walk (Closed)
Patch Set: 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
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 #ifndef PaintPropertyTreeBuilder_h 5 #ifndef PaintPropertyTreeBuilder_h
6 #define PaintPropertyTreeBuilder_h 6 #define PaintPropertyTreeBuilder_h
7 7
8 #include "platform/geometry/LayoutPoint.h" 8 #include "platform/geometry/LayoutPoint.h"
9 #include "platform/graphics/paint/ClipPaintPropertyNode.h" 9 #include "platform/graphics/paint/ClipPaintPropertyNode.h"
10 #include "platform/graphics/paint/EffectPaintPropertyNode.h" 10 #include "platform/graphics/paint/EffectPaintPropertyNode.h"
11 #include "platform/graphics/paint/ScrollPaintPropertyNode.h" 11 #include "platform/graphics/paint/ScrollPaintPropertyNode.h"
12 #include "platform/graphics/paint/TransformPaintPropertyNode.h" 12 #include "platform/graphics/paint/TransformPaintPropertyNode.h"
13 #include "wtf/RefPtr.h" 13 #include "wtf/RefPtr.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 enum TreeStructureChange {
18 // Nodes were not added or removed.
19 StructureNotChanged = false,
20 // Nodes were added or removed.
21 StructureChanged = true
22 };
23
17 class FrameView; 24 class FrameView;
18 class LayoutObject; 25 class LayoutObject;
19 26
20 // The context for PaintPropertyTreeBuilder. 27 // The context for PaintPropertyTreeBuilder.
21 // It's responsible for bookkeeping tree state in other order, for example, the 28 // It's responsible for bookkeeping tree state in other order, for example, the
22 // most recent position container seen. 29 // most recent position container seen.
23 struct PaintPropertyTreeBuilderContext { 30 struct PaintPropertyTreeBuilderContext {
24 // State that propagates on the containing block chain (and so is adjusted 31 // State that propagates on the containing block chain (and so is adjusted
25 // when an absolute or fixed position object is encountered). 32 // when an absolute or fixed position object is encountered).
26 struct ContainingBlockContext { 33 struct ContainingBlockContext {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Creates paint property tree nodes for special things in the layout tree. 84 // Creates paint property tree nodes for special things in the layout tree.
78 // Special things include but not limit to: overflow clip, transform, fixed-pos, 85 // Special things include but not limit to: overflow clip, transform, fixed-pos,
79 // animation, mask, filter, ... etc. 86 // animation, mask, filter, ... etc.
80 // It expects to be invoked for each layout tree node in DOM order during 87 // It expects to be invoked for each layout tree node in DOM order during
81 // InPrePaint phase. 88 // InPrePaint phase.
82 class PaintPropertyTreeBuilder { 89 class PaintPropertyTreeBuilder {
83 public: 90 public:
84 PaintPropertyTreeBuilderContext setupInitialContext(); 91 PaintPropertyTreeBuilderContext setupInitialContext();
85 // Update the paint properties for a frame and ensure the context is up to 92 // Update the paint properties for a frame and ensure the context is up to
86 // date. 93 // date.
87 void updateProperties(FrameView&, PaintPropertyTreeBuilderContext&); 94 TreeStructureChange updateProperties(FrameView&,
95 PaintPropertyTreeBuilderContext&);
88 96
89 // Update the paint properties that affect this object (e.g., properties like 97 // Update the paint properties that affect this object (e.g., properties like
90 // paint offset translation) and ensure the context is up to date. 98 // paint offset translation) and ensure the context is up to date.
91 void updatePropertiesForSelf(const LayoutObject&, 99 TreeStructureChange updatePropertiesForSelf(const LayoutObject&,
92 PaintPropertyTreeBuilderContext&); 100 PaintPropertyTreeBuilderContext&);
93 // Update the paint properties that affect children of this object (e.g., 101 // Update the paint properties that affect children of this object (e.g.,
94 // scroll offset transform) and ensure the context is up to date. 102 // scroll offset transform) and ensure the context is up to date.
95 void updatePropertiesForChildren(const LayoutObject&, 103 TreeStructureChange updatePropertiesForChildren(
96 PaintPropertyTreeBuilderContext&); 104 const LayoutObject&,
105 PaintPropertyTreeBuilderContext&);
97 106
98 private: 107 private:
99 static void updatePaintOffsetTranslation(const LayoutObject&, 108 static void updatePaintOffsetTranslation(
109 const LayoutObject&,
110 PaintPropertyTreeBuilderContext&,
111 bool& treeStructureChanged);
112 static TreeStructureChange updateTransform(const LayoutObject&,
113 PaintPropertyTreeBuilderContext&);
114 static TreeStructureChange updateTransformForNonRootSVG(
115 const LayoutObject&,
116 PaintPropertyTreeBuilderContext&);
117 static TreeStructureChange updateEffect(const LayoutObject&,
118 PaintPropertyTreeBuilderContext&);
119 static TreeStructureChange updateCssClip(const LayoutObject&,
100 PaintPropertyTreeBuilderContext&); 120 PaintPropertyTreeBuilderContext&);
101 static void updateTransform(const LayoutObject&, 121 static TreeStructureChange updateLocalBorderBoxContext(
102 PaintPropertyTreeBuilderContext&); 122 const LayoutObject&,
103 static void updateTransformForNonRootSVG(const LayoutObject&, 123 PaintPropertyTreeBuilderContext&);
104 PaintPropertyTreeBuilderContext&); 124 static TreeStructureChange updateScrollbarPaintOffset(
105 static void updateEffect(const LayoutObject&,
106 PaintPropertyTreeBuilderContext&);
107 static void updateCssClip(const LayoutObject&,
108 PaintPropertyTreeBuilderContext&);
109 static void updateLocalBorderBoxContext(const LayoutObject&,
110 PaintPropertyTreeBuilderContext&);
111 static void updateScrollbarPaintOffset(
112 const LayoutObject&, 125 const LayoutObject&,
113 const PaintPropertyTreeBuilderContext&); 126 const PaintPropertyTreeBuilderContext&);
114 static void updateOverflowClip(const LayoutObject&, 127 static TreeStructureChange updateOverflowClip(
115 PaintPropertyTreeBuilderContext&);
116 static void updatePerspective(const LayoutObject&,
117 PaintPropertyTreeBuilderContext&);
118 static void updateSvgLocalToBorderBoxTransform(
119 const LayoutObject&, 128 const LayoutObject&,
120 PaintPropertyTreeBuilderContext&); 129 PaintPropertyTreeBuilderContext&);
121 static void updateScrollAndScrollTranslation( 130 static TreeStructureChange updatePerspective(
122 const LayoutObject&, 131 const LayoutObject&,
123 PaintPropertyTreeBuilderContext&); 132 PaintPropertyTreeBuilderContext&);
124 static void updateOutOfFlowContext(const LayoutObject&, 133 static TreeStructureChange updateSvgLocalToBorderBoxTransform(
125 PaintPropertyTreeBuilderContext&); 134 const LayoutObject&,
135 PaintPropertyTreeBuilderContext&);
136 static TreeStructureChange updateScrollAndScrollTranslation(
137 const LayoutObject&,
138 PaintPropertyTreeBuilderContext&);
139 static TreeStructureChange updateOutOfFlowContext(
140 const LayoutObject&,
141 PaintPropertyTreeBuilderContext&);
126 }; 142 };
127 143
128 } // namespace blink 144 } // namespace blink
129 145
130 #endif // PaintPropertyTreeBuilder_h 146 #endif // PaintPropertyTreeBuilder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698