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