OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CC_TREES_DRAW_PROPERTY_UTILS_H_ | 5 #ifndef CC_TREES_DRAW_PROPERTY_UTILS_H_ |
6 #define CC_TREES_DRAW_PROPERTY_UTILS_H_ | 6 #define CC_TREES_DRAW_PROPERTY_UTILS_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/layers/layer_collections.h" | 9 #include "cc/layers/layer_collections.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Rect; | |
13 class Transform; | 12 class Transform; |
14 class Vector2dF; | 13 class Vector2dF; |
15 } // namespace gfx | 14 } // namespace gfx |
16 | 15 |
17 namespace cc { | 16 namespace cc { |
18 | 17 |
19 class Layer; | 18 class Layer; |
20 class LayerImpl; | 19 class LayerImpl; |
21 class LayerTreeHost; | 20 class LayerTreeHost; |
| 21 class LayerTreeImpl; |
22 class RenderSurfaceImpl; | 22 class RenderSurfaceImpl; |
23 class EffectTree; | 23 class EffectTree; |
24 class TransformTree; | 24 class TransformTree; |
25 class PropertyTrees; | 25 class PropertyTrees; |
26 struct EffectNode; | 26 struct EffectNode; |
27 | 27 |
28 namespace draw_property_utils { | 28 namespace draw_property_utils { |
29 | 29 |
30 void CC_EXPORT PostConcatSurfaceContentsScale(const EffectNode* effect_node, | 30 void CC_EXPORT PostConcatSurfaceContentsScale(const EffectNode* effect_node, |
31 gfx::Transform* transform); | 31 gfx::Transform* transform); |
32 | 32 |
33 void CC_EXPORT ConcatInverseSurfaceContentsScale(const EffectNode* effect_node, | 33 void CC_EXPORT ConcatInverseSurfaceContentsScale(const EffectNode* effect_node, |
34 gfx::Transform* transform); | 34 gfx::Transform* transform); |
35 // Computes combined clips for every node in |clip_tree|. This function requires | |
36 // that |transform_tree| has been updated via |ComputeTransforms|. | |
37 void CC_EXPORT ComputeClips(PropertyTrees* property_trees, | |
38 bool non_root_surfaces_enabled); | |
39 | 35 |
40 // Computes combined (screen space) transforms for every node in the transform | 36 // Computes combined (screen space) transforms for every node in the transform |
41 // tree. This must be done prior to calling |ComputeClips|. | 37 // tree. This must be done prior to calling |ComputeClips|. |
42 void CC_EXPORT ComputeTransforms(TransformTree* transform_tree); | 38 void CC_EXPORT ComputeTransforms(TransformTree* transform_tree); |
43 | 39 |
44 // Computes screen space opacity for every node in the opacity tree. | 40 // Computes screen space opacity for every node in the opacity tree. |
45 void CC_EXPORT ComputeEffects(EffectTree* effect_tree); | 41 void CC_EXPORT ComputeEffects(EffectTree* effect_tree); |
46 | 42 |
47 void CC_EXPORT BuildPropertyTreesAndComputeVisibleRects( | |
48 LayerImpl* root_layer, | |
49 const LayerImpl* page_scale_layer, | |
50 const LayerImpl* inner_viewport_scroll_layer, | |
51 const LayerImpl* outer_viewport_scroll_layer, | |
52 const LayerImpl* overscroll_elasticity_layer, | |
53 const gfx::Vector2dF& elastic_overscroll, | |
54 float page_scale_factor, | |
55 float device_scale_factor, | |
56 const gfx::Rect& viewport, | |
57 const gfx::Transform& device_transform, | |
58 bool can_render_to_separate_surface, | |
59 PropertyTrees* property_trees, | |
60 LayerImplList* visible_layer_list); | |
61 | |
62 void CC_EXPORT UpdatePropertyTrees(PropertyTrees* property_trees, | 43 void CC_EXPORT UpdatePropertyTrees(PropertyTrees* property_trees, |
63 bool can_render_to_separate_surface); | 44 bool can_render_to_separate_surface); |
64 | 45 |
| 46 void CC_EXPORT |
| 47 UpdatePropertyTreesAndRenderSurfaces(LayerImpl* root_layer, |
| 48 PropertyTrees* property_trees, |
| 49 bool can_render_to_separate_surface); |
| 50 |
65 void CC_EXPORT FindLayersThatNeedUpdates(LayerTreeHost* layer_tree_host, | 51 void CC_EXPORT FindLayersThatNeedUpdates(LayerTreeHost* layer_tree_host, |
66 const PropertyTrees* property_trees, | 52 const PropertyTrees* property_trees, |
67 LayerList* update_layer_list); | 53 LayerList* update_layer_list); |
68 | 54 |
69 void CC_EXPORT ComputeVisibleRects(LayerImpl* root_layer, | |
70 PropertyTrees* property_trees, | |
71 bool can_render_to_separate_surface, | |
72 LayerImplList* visible_layer_list); | |
73 | |
74 gfx::Rect CC_EXPORT | |
75 ComputeLayerVisibleRectDynamic(const PropertyTrees* property_trees, | |
76 const LayerImpl* layer); | |
77 void CC_EXPORT | 55 void CC_EXPORT |
78 VerifyVisibleRectsCalculations(const LayerImplList& layer_list, | 56 FindLayersThatNeedUpdates(LayerTreeImpl* layer_tree_impl, |
79 const PropertyTrees* property_trees); | 57 const PropertyTrees* property_trees, |
| 58 std::vector<LayerImpl*>* visible_layer_list); |
80 | 59 |
81 void CC_EXPORT ComputeLayerDrawProperties(LayerImpl* layer, | 60 void CC_EXPORT ComputeLayerDrawProperties(LayerImpl* layer, |
82 const PropertyTrees* property_trees); | 61 PropertyTrees* property_trees); |
83 | 62 |
84 void CC_EXPORT ComputeMaskDrawProperties(LayerImpl* mask_layer, | 63 void CC_EXPORT ComputeMaskDrawProperties(LayerImpl* mask_layer, |
85 const PropertyTrees* property_trees); | 64 const PropertyTrees* property_trees); |
86 | 65 |
87 void CC_EXPORT ComputeSurfaceDrawProperties(const PropertyTrees* property_trees, | 66 void CC_EXPORT ComputeSurfaceDrawProperties(PropertyTrees* property_trees, |
88 RenderSurfaceImpl* render_surface); | 67 RenderSurfaceImpl* render_surface); |
89 | 68 |
90 bool CC_EXPORT LayerShouldBeSkipped(LayerImpl* layer, | 69 bool CC_EXPORT LayerShouldBeSkipped(LayerImpl* layer, |
91 const TransformTree& transform_tree, | 70 const TransformTree& transform_tree, |
92 const EffectTree& effect_tree); | 71 const EffectTree& effect_tree); |
93 | 72 |
94 bool CC_EXPORT LayerNeedsUpdate(Layer* layer, | 73 bool CC_EXPORT LayerNeedsUpdate(Layer* layer, |
95 bool layer_is_drawn, | 74 bool layer_is_drawn, |
96 const PropertyTrees* property_trees); | 75 const PropertyTrees* property_trees); |
97 | 76 |
98 bool CC_EXPORT LayerNeedsUpdate(LayerImpl* layer, | 77 bool CC_EXPORT LayerNeedsUpdate(LayerImpl* layer, |
99 bool layer_is_drawn, | 78 bool layer_is_drawn, |
100 const PropertyTrees* property_trees); | 79 const PropertyTrees* property_trees); |
101 | 80 |
102 void CC_EXPORT VerifyClipTreeCalculations(const LayerImplList& layer_list, | |
103 PropertyTrees* property_trees); | |
104 | |
105 gfx::Transform CC_EXPORT DrawTransform(const LayerImpl* layer, | 81 gfx::Transform CC_EXPORT DrawTransform(const LayerImpl* layer, |
106 const TransformTree& transform_tree, | 82 const TransformTree& transform_tree, |
107 const EffectTree& effect_tree); | 83 const EffectTree& effect_tree); |
108 | 84 |
109 gfx::Transform CC_EXPORT ScreenSpaceTransform(const Layer* layer, | 85 gfx::Transform CC_EXPORT ScreenSpaceTransform(const Layer* layer, |
110 const TransformTree& tree); | 86 const TransformTree& tree); |
111 | 87 |
112 gfx::Transform CC_EXPORT ScreenSpaceTransform(const LayerImpl* layer, | 88 gfx::Transform CC_EXPORT ScreenSpaceTransform(const LayerImpl* layer, |
113 const TransformTree& tree); | 89 const TransformTree& tree); |
114 | 90 |
(...skipping 16 matching lines...) Expand all Loading... |
131 | 107 |
132 void CC_EXPORT | 108 void CC_EXPORT |
133 UpdateElasticOverscroll(PropertyTrees* property_trees, | 109 UpdateElasticOverscroll(PropertyTrees* property_trees, |
134 const Layer* overscroll_elasticity_layer, | 110 const Layer* overscroll_elasticity_layer, |
135 const gfx::Vector2dF& elastic_overscroll); | 111 const gfx::Vector2dF& elastic_overscroll); |
136 | 112 |
137 } // namespace draw_property_utils | 113 } // namespace draw_property_utils |
138 } // namespace cc | 114 } // namespace cc |
139 | 115 |
140 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_ | 116 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_ |
OLD | NEW |