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(EffectTree
* effect_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
);
85 RenderSurfaceIsClippedFromPropertyTrees(const RenderSurfaceImpl
* render_surface
,
86 const ClipTree
& tree
);
88 gfx::Rect CC_EXPORT
ClipRectOfRenderSurfaceFromPropertyTrees(
89 const RenderSurfaceImpl
* render_surface
,
90 const ClipTree
& clip_tree
);
92 gfx::Transform CC_EXPORT
ScreenSpaceTransformOfRenderSurfaceFromPropertyTrees(
93 RenderSurfaceImpl
* render_surface
,
94 const TransformTree
& tree
);
96 gfx::Transform CC_EXPORT
97 DrawTransformFromPropertyTrees(const LayerImpl
* layer
,
98 const TransformTree
& tree
);
100 gfx::Transform CC_EXPORT
101 ScreenSpaceTransformFromPropertyTrees(const Layer
* layer
,
102 const TransformTree
& tree
);
104 gfx::Transform CC_EXPORT
105 ScreenSpaceTransformFromPropertyTrees(const LayerImpl
* layer
,
106 const TransformTree
& tree
);
109 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const Layer
* layer
,
110 const TransformTree
& tree
);
113 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const LayerImpl
* layer
,
114 const TransformTree
& tree
);
116 float CC_EXPORT
DrawOpacityFromPropertyTrees(const Layer
* layer
,
117 const EffectTree
& tree
);
119 float CC_EXPORT
DrawOpacityFromPropertyTrees(const LayerImpl
* layer
,
120 const EffectTree
& tree
);
123 DrawOpacityOfRenderSurfaceFromPropertyTrees(RenderSurfaceImpl
* render_surface
,
124 const EffectTree
& tree
);
127 CanUseLcdTextFromPropertyTrees(const LayerImpl
* layer
,
128 bool layers_always_allowed_lcd_text
,
129 bool can_use_lcd_text
,
130 PropertyTrees
* property_trees
);
132 gfx::Rect CC_EXPORT
DrawableContentRectOfSurfaceFromPropertyTrees(
133 const RenderSurfaceImpl
* render_surface
,
134 const TransformTree
& transform_tree
);
137 DrawableContentRectFromPropertyTrees(const LayerImpl
* layer
,
138 const TransformTree
& transform_tree
);
141 ClipRectFromPropertyTrees(const LayerImpl
* layer
,
142 const TransformTree
& transform_tree
);
144 gfx::Rect CC_EXPORT
ViewportRectFromPropertyTrees(const ClipTree
& tree
);
148 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_