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

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

Issue 2732573003: Skip paint property update and visual rect update if no geometry change (Closed)
Patch Set: - Created 3 years, 8 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 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 class FrameView; 17 class FrameView;
18 class LayoutBoxModelObject; 18 class LayoutBoxModelObject;
19 class LayoutObject; 19 class LayoutObject;
20 20
21 // The context for PaintPropertyTreeBuilder. 21 // The context for PaintPropertyTreeBuilder.
22 // It's responsible for bookkeeping tree state in other order, for example, the 22 // It's responsible for bookkeeping tree state in other order, for example, the
23 // most recent position container seen. 23 // most recent position container seen.
24 struct PaintPropertyTreeBuilderContext { 24 struct PaintPropertyTreeBuilderContext {
25 USING_FAST_MALLOC(PaintPropertyTreeBuilderContext); 25 USING_FAST_MALLOC(PaintPropertyTreeBuilderContext);
26 26
27 public: 27 public:
28 // Initializes all property tree nodes to the roots.
29 PaintPropertyTreeBuilderContext();
30
28 // 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
29 // when an absolute or fixed position object is encountered). 32 // when an absolute or fixed position object is encountered).
30 struct ContainingBlockContext { 33 struct ContainingBlockContext {
31 // The combination of a transform and paint offset describes a linear space. 34 // The combination of a transform and paint offset describes a linear space.
32 // When a layout object recur to its children, the main context is expected 35 // When a layout object recur to its children, the main context is expected
33 // to refer the object's border box, then the callee will derive its own 36 // to refer the object's border box, then the callee will derive its own
34 // border box by translating the space with its own layout location. 37 // border box by translating the space with its own layout location.
35 const TransformPaintPropertyNode* transform = nullptr; 38 const TransformPaintPropertyNode* transform = nullptr;
36 LayoutPoint paintOffset; 39 LayoutPoint paintOffset;
37 // Whether newly created children should flatten their inherited transform 40 // Whether newly created children should flatten their inherited transform
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // clip. The cull rect for its input shall be derived from its output clip. 86 // clip. The cull rect for its input shall be derived from its output clip.
84 // This variable represents the input cull of current effect, also serves as 87 // This variable represents the input cull of current effect, also serves as
85 // output clip of child effects that don't have a hard clip. 88 // output clip of child effects that don't have a hard clip.
86 const ClipPaintPropertyNode* inputClipOfCurrentEffect; 89 const ClipPaintPropertyNode* inputClipOfCurrentEffect;
87 90
88 // True if a change has forced all properties in a subtree to be updated. This 91 // True if a change has forced all properties in a subtree to be updated. This
89 // can be set due to paint offset changes or when the structure of the 92 // can be set due to paint offset changes or when the structure of the
90 // property tree changes (i.e., a node is added or removed). 93 // property tree changes (i.e., a node is added or removed).
91 bool forceSubtreeUpdate; 94 bool forceSubtreeUpdate;
92 95
93 // Initializes all property tree nodes to the roots. 96 #if DCHECK_IS_ON()
94 PaintPropertyTreeBuilderContext(); 97 // When DCHECK_IS_ON() we create PaintPropertyTreeBuilderContext even if not
98 // needed. See FindPaintOffsetAndVisualRectNeedingUpdate.h.
99 bool isActuallyNeeded = true;
100 #endif
95 }; 101 };
96 102
97 // Creates paint property tree nodes for special things in the layout tree. 103 // Creates paint property tree nodes for special things in the layout tree.
98 // Special things include but not limit to: overflow clip, transform, fixed-pos, 104 // Special things include but not limit to: overflow clip, transform, fixed-pos,
99 // animation, mask, filter, ... etc. 105 // animation, mask, filter, ... etc.
100 // It expects to be invoked for each layout tree node in DOM order during 106 // It expects to be invoked for each layout tree node in DOM order during
101 // InPrePaint phase. 107 // InPrePaint phase.
102 class PaintPropertyTreeBuilder { 108 class PaintPropertyTreeBuilder {
103 public: 109 public:
104 // Update the paint properties for a frame and ensure the context is up to 110 // Update the paint properties for a frame and ensure the context is up to
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 const LayoutObject&, 159 const LayoutObject&,
154 PaintPropertyTreeBuilderContext&); 160 PaintPropertyTreeBuilderContext&);
155 ALWAYS_INLINE static void updateOutOfFlowContext( 161 ALWAYS_INLINE static void updateOutOfFlowContext(
156 const LayoutObject&, 162 const LayoutObject&,
157 PaintPropertyTreeBuilderContext&); 163 PaintPropertyTreeBuilderContext&);
158 }; 164 };
159 165
160 } // namespace blink 166 } // namespace blink
161 167
162 #endif // PaintPropertyTreeBuilder_h 168 #endif // PaintPropertyTreeBuilder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698