OLD | NEW |
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/TransformPaintPropertyNode.h" | 11 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
12 #include "wtf/RefPtr.h" | 12 #include "wtf/RefPtr.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class FrameView; | 16 class FrameView; |
17 class LayoutObject; | 17 class LayoutObject; |
| 18 class ObjectPaintProperties; |
18 | 19 |
19 // The context for PaintPropertyTreeBuilder. | 20 // The context for PaintPropertyTreeBuilder. |
20 // It's responsible for bookkeeping tree state in other order, for example, the
most recent | 21 // It's responsible for bookkeeping tree state in other order, for example, the
most recent |
21 // position container seen. | 22 // position container seen. |
22 struct PaintPropertyTreeBuilderContext { | 23 struct PaintPropertyTreeBuilderContext { |
23 // State that propagates on the containing block chain (and so is adjusted | 24 // State that propagates on the containing block chain (and so is adjusted |
24 // when an absolute or fixed position object is encountered). | 25 // when an absolute or fixed position object is encountered). |
25 struct ContainingBlockContext { | 26 struct ContainingBlockContext { |
26 // The combination of a transform and paint offset describes a linear sp
ace. | 27 // The combination of a transform and paint offset describes a linear sp
ace. |
27 // When a layout object recur to its children, the main context is expec
ted to refer | 28 // When a layout object recur to its children, the main context is expec
ted to refer |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Special things include but not limit to: overflow clip, transform, fixed-pos,
animation, | 61 // Special things include but not limit to: overflow clip, transform, fixed-pos,
animation, |
61 // mask, filter, ... etc. | 62 // mask, filter, ... etc. |
62 // It expects to be invoked for each layout tree node in DOM order during InPreP
aint phase. | 63 // It expects to be invoked for each layout tree node in DOM order during InPreP
aint phase. |
63 class PaintPropertyTreeBuilder { | 64 class PaintPropertyTreeBuilder { |
64 public: | 65 public: |
65 void buildTreeRootNodes(FrameView&, PaintPropertyTreeBuilderContext&); | 66 void buildTreeRootNodes(FrameView&, PaintPropertyTreeBuilderContext&); |
66 void buildTreeNodes(FrameView&, PaintPropertyTreeBuilderContext&); | 67 void buildTreeNodes(FrameView&, PaintPropertyTreeBuilderContext&); |
67 void buildTreeNodes(const LayoutObject&, PaintPropertyTreeBuilderContext&); | 68 void buildTreeNodes(const LayoutObject&, PaintPropertyTreeBuilderContext&); |
68 | 69 |
69 private: | 70 private: |
| 71 |
| 72 static void clearTransformProperty(const LayoutObject&, void (ObjectPaintPro
perties::*setter)(PassRefPtr<TransformPaintPropertyNode>)); |
| 73 static void updateOrCreateTransformProperty(const LayoutObject&, TransformPa
intPropertyNode* (ObjectPaintProperties::*getter)() const, void (ObjectPaintProp
erties::*setter)(PassRefPtr<TransformPaintPropertyNode>), const TransformationMa
trix&, const FloatPoint3D&, PassRefPtr<TransformPaintPropertyNode>); |
| 74 |
70 static void updatePaintOffsetTranslation(const LayoutObject&, PaintPropertyT
reeBuilderContext&); | 75 static void updatePaintOffsetTranslation(const LayoutObject&, PaintPropertyT
reeBuilderContext&); |
71 static void updateTransform(const LayoutObject&, PaintPropertyTreeBuilderCon
text&); | 76 static void updateTransform(const LayoutObject&, PaintPropertyTreeBuilderCon
text&); |
72 static void updateEffect(const LayoutObject&, PaintPropertyTreeBuilderContex
t&); | 77 static void updateEffect(const LayoutObject&, PaintPropertyTreeBuilderContex
t&); |
73 static void updateCssClip(const LayoutObject&, PaintPropertyTreeBuilderConte
xt&); | 78 static void updateCssClip(const LayoutObject&, PaintPropertyTreeBuilderConte
xt&); |
74 static void updateLocalBorderBoxContext(const LayoutObject&, const PaintProp
ertyTreeBuilderContext&); | 79 static void updateLocalBorderBoxContext(const LayoutObject&, const PaintProp
ertyTreeBuilderContext&); |
75 static void updateScrollbarPaintOffset(const LayoutObject&, const PaintPrope
rtyTreeBuilderContext&); | 80 static void updateScrollbarPaintOffset(const LayoutObject&, const PaintPrope
rtyTreeBuilderContext&); |
76 static void updateOverflowClip(const LayoutObject&, PaintPropertyTreeBuilder
Context&); | 81 static void updateOverflowClip(const LayoutObject&, PaintPropertyTreeBuilder
Context&); |
77 static void updatePerspective(const LayoutObject&, PaintPropertyTreeBuilderC
ontext&); | 82 static void updatePerspective(const LayoutObject&, PaintPropertyTreeBuilderC
ontext&); |
78 static void updateSvgLocalToBorderBoxTransform(const LayoutObject&, PaintPro
pertyTreeBuilderContext&); | 83 static void updateSvgLocalToBorderBoxTransform(const LayoutObject&, PaintPro
pertyTreeBuilderContext&); |
79 static void updateScrollTranslation(const LayoutObject&, PaintPropertyTreeBu
ilderContext&); | 84 static void updateScrollTranslation(const LayoutObject&, PaintPropertyTreeBu
ilderContext&); |
80 static void updateOutOfFlowContext(const LayoutObject&, PaintPropertyTreeBui
lderContext&); | 85 static void updateOutOfFlowContext(const LayoutObject&, PaintPropertyTreeBui
lderContext&); |
81 }; | 86 }; |
82 | 87 |
83 } // namespace blink | 88 } // namespace blink |
84 | 89 |
85 #endif // PaintPropertyTreeBuilder_h | 90 #endif // PaintPropertyTreeBuilder_h |
OLD | NEW |