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
3 // found in the LICENSE file.
5 #ifndef CC_TREES_DRAW_PROPERTY_UTILS_H_
6 #define CC_TREES_DRAW_PROPERTY_UTILS_H_
8 #include "cc/base/cc_export.h"
9 #include "cc/layers/layer_lists.h"
21 class RenderSurfaceImpl
;
26 // Computes combined clips for every node in |clip_tree|. This function requires
27 // that |transform_tree| has been updated via |ComputeTransforms|.
28 // TODO(vollick): ComputeClips and ComputeTransforms will eventually need to be
29 // done on both threads.
31 ComputeClips(ClipTree
* clip_tree
, const TransformTree
& transform_tree
);
33 // Computes combined (screen space) transforms for every node in the transform
34 // tree. This must be done prior to calling |ComputeClips|.
35 void CC_EXPORT
ComputeTransforms(TransformTree
* transform_tree
);
37 // Computes screen space opacity for every node in the opacity tree.
38 void CC_EXPORT
ComputeOpacities(OpacityTree
* opacity_tree
);
40 // Computes the visible content rect for every layer under |root_layer|. The
41 // visible content rect is the clipped content space rect that will be used for
43 void CC_EXPORT
BuildPropertyTreesAndComputeVisibleRects(
45 const Layer
* page_scale_layer
,
46 const Layer
* inner_viewport_scroll_layer
,
47 const Layer
* outer_viewport_scroll_layer
,
48 float page_scale_factor
,
49 float device_scale_factor
,
50 const gfx::Rect
& viewport
,
51 const gfx::Transform
& device_transform
,
52 PropertyTrees
* property_trees
,
53 LayerList
* update_layer_list
);
55 void CC_EXPORT
BuildPropertyTreesAndComputeVisibleRects(
56 LayerImpl
* root_layer
,
57 const LayerImpl
* page_scale_layer
,
58 const LayerImpl
* inner_viewport_scroll_layer
,
59 const LayerImpl
* outer_viewport_scroll_layer
,
60 float page_scale_factor
,
61 float device_scale_factor
,
62 const gfx::Rect
& viewport
,
63 const gfx::Transform
& device_transform
,
64 PropertyTrees
* property_trees
,
65 LayerImplList
* update_layer_list
);
68 ComputeVisibleRectsUsingPropertyTrees(Layer
* root_layer
,
69 PropertyTrees
* property_trees
,
70 LayerList
* update_layer_list
);
73 ComputeVisibleRectsUsingPropertyTrees(LayerImpl
* root_layer
,
74 PropertyTrees
* property_trees
,
75 LayerImplList
* update_layer_list
);
77 gfx::Transform CC_EXPORT
78 DrawTransformFromPropertyTrees(const Layer
* layer
, const TransformTree
& tree
);
80 gfx::Transform CC_EXPORT
DrawTransformOfRenderSurfaceFromPropertyTrees(
81 const RenderSurfaceImpl
* render_Surface
,
82 const TransformTree
& tree
);
84 gfx::Transform CC_EXPORT
85 DrawTransformFromPropertyTrees(const LayerImpl
* layer
,
86 const TransformTree
& tree
);
88 gfx::Transform CC_EXPORT
89 ScreenSpaceTransformFromPropertyTrees(const Layer
* layer
,
90 const TransformTree
& tree
);
92 gfx::Transform CC_EXPORT
93 ScreenSpaceTransformFromPropertyTrees(const LayerImpl
* layer
,
94 const TransformTree
& tree
);
97 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const Layer
* layer
,
98 const TransformTree
& tree
);
101 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const LayerImpl
* layer
,
102 const TransformTree
& tree
);
105 DrawOpacityFromPropertyTrees(const Layer
* layer
, const OpacityTree
& tree
);
108 DrawOpacityFromPropertyTrees(const LayerImpl
* layer
, const OpacityTree
& tree
);
111 CanUseLcdTextFromPropertyTrees(const LayerImpl
* layer
,
112 bool layers_always_allowed_lcd_text
,
113 bool can_use_lcd_text
,
114 PropertyTrees
* property_trees
);
118 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_