| 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/cc_export.h" | 8 #include "cc/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 | 43 |
| 62 void CC_EXPORT UpdatePropertyTrees(LayerTreeHost* layer_tree_host, | 44 void CC_EXPORT UpdatePropertyTrees(LayerTreeHost* layer_tree_host, |
| 63 PropertyTrees* property_trees, | 45 PropertyTrees* property_trees, |
| 64 bool can_render_to_separate_surface); | 46 bool can_render_to_separate_surface); |
| 65 | 47 |
| 48 void CC_EXPORT |
| 49 UpdatePropertyTreesAndRenderSurfaces(LayerImpl* root_layer, |
| 50 PropertyTrees* property_trees, |
| 51 bool can_render_to_separate_surface); |
| 52 |
| 66 void CC_EXPORT FindLayersThatNeedUpdates(LayerTreeHost* layer_tree_host, | 53 void CC_EXPORT FindLayersThatNeedUpdates(LayerTreeHost* layer_tree_host, |
| 67 const PropertyTrees* property_trees, | 54 const PropertyTrees* property_trees, |
| 68 LayerList* update_layer_list); | 55 LayerList* update_layer_list); |
| 69 | 56 |
| 70 void CC_EXPORT ComputeVisibleRects(LayerImpl* root_layer, | 57 void CC_EXPORT |
| 71 PropertyTrees* property_trees, | 58 FindLayersThatNeedUpdates(LayerTreeImpl* layer_tree_impl, |
| 72 bool can_render_to_separate_surface, | 59 const PropertyTrees* property_trees, |
| 73 LayerImplList* visible_layer_list); | 60 std::vector<LayerImpl*>* visible_layer_list); |
| 74 | 61 |
| 75 gfx::Rect CC_EXPORT | |
| 76 ComputeLayerVisibleRectDynamic(const PropertyTrees* property_trees, | |
| 77 const LayerImpl* layer); | |
| 78 void CC_EXPORT | 62 void CC_EXPORT |
| 79 VerifyVisibleRectsCalculations(const LayerImplList& layer_list, | 63 ComputeDrawPropertiesOfVisibleLayers(const LayerImplList* layer_list, |
| 80 const PropertyTrees* property_trees); | 64 PropertyTrees* property_trees); |
| 81 | |
| 82 void CC_EXPORT ComputeLayerDrawProperties(LayerImpl* layer, | |
| 83 const PropertyTrees* property_trees); | |
| 84 | 65 |
| 85 void CC_EXPORT ComputeMaskDrawProperties(LayerImpl* mask_layer, | 66 void CC_EXPORT ComputeMaskDrawProperties(LayerImpl* mask_layer, |
| 86 const PropertyTrees* property_trees); | 67 const PropertyTrees* property_trees); |
| 87 | 68 |
| 88 void CC_EXPORT ComputeSurfaceDrawProperties(const PropertyTrees* property_trees, | 69 void CC_EXPORT ComputeSurfaceDrawProperties(PropertyTrees* property_trees, |
| 89 RenderSurfaceImpl* render_surface); | 70 RenderSurfaceImpl* render_surface, |
| 71 const bool use_layer_lists); |
| 90 | 72 |
| 91 bool CC_EXPORT LayerShouldBeSkipped(LayerImpl* layer, | 73 bool CC_EXPORT LayerShouldBeSkipped(LayerImpl* layer, |
| 92 const TransformTree& transform_tree, | 74 const TransformTree& transform_tree, |
| 93 const EffectTree& effect_tree); | 75 const EffectTree& effect_tree); |
| 94 | 76 |
| 95 bool CC_EXPORT LayerNeedsUpdate(Layer* layer, | 77 bool CC_EXPORT LayerNeedsUpdate(Layer* layer, |
| 96 bool layer_is_drawn, | 78 bool layer_is_drawn, |
| 97 const PropertyTrees* property_trees); | 79 const PropertyTrees* property_trees); |
| 98 | 80 |
| 99 bool CC_EXPORT LayerNeedsUpdate(LayerImpl* layer, | 81 bool CC_EXPORT LayerNeedsUpdate(LayerImpl* layer, |
| 100 bool layer_is_drawn, | 82 bool layer_is_drawn, |
| 101 const PropertyTrees* property_trees); | 83 const PropertyTrees* property_trees); |
| 102 | 84 |
| 103 void CC_EXPORT VerifyClipTreeCalculations(const LayerImplList& layer_list, | |
| 104 PropertyTrees* property_trees); | |
| 105 | |
| 106 gfx::Transform CC_EXPORT DrawTransform(const LayerImpl* layer, | 85 gfx::Transform CC_EXPORT DrawTransform(const LayerImpl* layer, |
| 107 const TransformTree& transform_tree, | 86 const TransformTree& transform_tree, |
| 108 const EffectTree& effect_tree); | 87 const EffectTree& effect_tree); |
| 109 | 88 |
| 110 gfx::Transform CC_EXPORT ScreenSpaceTransform(const Layer* layer, | 89 gfx::Transform CC_EXPORT ScreenSpaceTransform(const Layer* layer, |
| 111 const TransformTree& tree); | 90 const TransformTree& tree); |
| 112 | 91 |
| 113 gfx::Transform CC_EXPORT ScreenSpaceTransform(const LayerImpl* layer, | 92 gfx::Transform CC_EXPORT ScreenSpaceTransform(const LayerImpl* layer, |
| 114 const TransformTree& tree); | 93 const TransformTree& tree); |
| 115 | 94 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 132 | 111 |
| 133 void CC_EXPORT | 112 void CC_EXPORT |
| 134 UpdateElasticOverscroll(PropertyTrees* property_trees, | 113 UpdateElasticOverscroll(PropertyTrees* property_trees, |
| 135 const Layer* overscroll_elasticity_layer, | 114 const Layer* overscroll_elasticity_layer, |
| 136 const gfx::Vector2dF& elastic_overscroll); | 115 const gfx::Vector2dF& elastic_overscroll); |
| 137 | 116 |
| 138 } // namespace draw_property_utils | 117 } // namespace draw_property_utils |
| 139 } // namespace cc | 118 } // namespace cc |
| 140 | 119 |
| 141 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_ | 120 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_ |
| OLD | NEW |