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

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

Issue 2464823003: Refactor LayoutView paint offset updates out of FrameView update code (Closed)
Patch Set: Incorporate Tien-Ren's review ideas 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 class FrameView; 17 class FrameView;
18 class LayoutObject; 18 class LayoutObject;
19 class LayoutView;
19 20
20 // The context for PaintPropertyTreeBuilder. 21 // The context for PaintPropertyTreeBuilder.
21 // 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
22 // most recent position container seen. 23 // most recent position container seen.
23 struct PaintPropertyTreeBuilderContext { 24 struct PaintPropertyTreeBuilderContext {
24 // State that propagates on the containing block chain (and so is adjusted 25 // State that propagates on the containing block chain (and so is adjusted
25 // when an absolute or fixed position object is encountered). 26 // when an absolute or fixed position object is encountered).
26 struct ContainingBlockContext { 27 struct ContainingBlockContext {
27 // The combination of a transform and paint offset describes a linear space. 28 // The combination of a transform and paint offset describes a linear space.
28 // When a layout object recur to its children, the main context is expected 29 // When a layout object recur to its children, the main context is expected
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Creates paint property tree nodes for special things in the layout tree. 78 // 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, 79 // Special things include but not limit to: overflow clip, transform, fixed-pos,
79 // animation, mask, filter, ... etc. 80 // animation, mask, filter, ... etc.
80 // It expects to be invoked for each layout tree node in DOM order during 81 // It expects to be invoked for each layout tree node in DOM order during
81 // InPrePaint phase. 82 // InPrePaint phase.
82 class PaintPropertyTreeBuilder { 83 class PaintPropertyTreeBuilder {
83 public: 84 public:
84 PaintPropertyTreeBuilderContext setupInitialContext(); 85 PaintPropertyTreeBuilderContext setupInitialContext();
85 // Update the paint properties for |FrameView| and ensure the context is 86 // Update the paint properties for |FrameView| and ensure the context is
86 // up to date. 87 // up to date.
87 void updatePropertiesAndContext(FrameView&, PaintPropertyTreeBuilderContext&); 88 void updateFramePropertiesAndContext(FrameView&,
89 PaintPropertyTreeBuilderContext&);
88 90
89 // Update the paint properties that affect this object (e.g., properties like 91 // Update the paint properties that affect this object (e.g., properties like
90 // paint offset translation) and ensure the context is up to date. 92 // paint offset translation) and ensure the context is up to date.
91 void updatePropertiesAndContextForSelf(const LayoutObject&, 93 void updatePropertiesAndContextForSelf(const LayoutObject&,
92 PaintPropertyTreeBuilderContext&); 94 PaintPropertyTreeBuilderContext&);
93 // Update the paint properties that affect children of this object (e.g., 95 // Update the paint properties that affect children of this object (e.g.,
94 // scroll offset transform) and ensure the context is up to date. 96 // scroll offset transform) and ensure the context is up to date.
95 void updatePropertiesAndContextForChildren(const LayoutObject&, 97 void updatePropertiesAndContextForChildren(const LayoutObject&,
96 PaintPropertyTreeBuilderContext&); 98 PaintPropertyTreeBuilderContext&);
97 99
98 private: 100 private:
101 static void updateLayoutViewPaintOffsetTranslation(
102 const LayoutView&,
103 PaintPropertyTreeBuilderContext&);
99 static void updatePaintOffsetTranslation(const LayoutObject&, 104 static void updatePaintOffsetTranslation(const LayoutObject&,
100 PaintPropertyTreeBuilderContext&); 105 PaintPropertyTreeBuilderContext&);
101 static void updateTransform(const LayoutObject&, 106 static void updateTransform(const LayoutObject&,
102 PaintPropertyTreeBuilderContext&); 107 PaintPropertyTreeBuilderContext&);
103 static void updateTransformForNonRootSVG(const LayoutObject&, 108 static void updateTransformForNonRootSVG(const LayoutObject&,
104 PaintPropertyTreeBuilderContext&); 109 PaintPropertyTreeBuilderContext&);
105 static void updateEffect(const LayoutObject&, 110 static void updateEffect(const LayoutObject&,
106 PaintPropertyTreeBuilderContext&); 111 PaintPropertyTreeBuilderContext&);
107 static void updateCssClip(const LayoutObject&, 112 static void updateCssClip(const LayoutObject&,
108 PaintPropertyTreeBuilderContext&); 113 PaintPropertyTreeBuilderContext&);
(...skipping 15 matching lines...) Expand all
124 static void updateScrollAndScrollTranslation( 129 static void updateScrollAndScrollTranslation(
125 const LayoutObject&, 130 const LayoutObject&,
126 PaintPropertyTreeBuilderContext&); 131 PaintPropertyTreeBuilderContext&);
127 static void updateOutOfFlowContext(const LayoutObject&, 132 static void updateOutOfFlowContext(const LayoutObject&,
128 PaintPropertyTreeBuilderContext&); 133 PaintPropertyTreeBuilderContext&);
129 }; 134 };
130 135
131 } // namespace blink 136 } // namespace blink
132 137
133 #endif // PaintPropertyTreeBuilder_h 138 #endif // PaintPropertyTreeBuilder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698