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"
25 // Computes combined clips for every node in |clip_tree|. This function requires
26 // that |transform_tree| has been updated via |ComputeTransforms|.
27 // TODO(vollick): ComputeClips and ComputeTransforms will eventually need to be
28 // done on both threads.
30 ComputeClips(ClipTree
* clip_tree
, const TransformTree
& transform_tree
);
32 // Computes combined (screen space) transforms for every node in the transform
33 // tree. This must be done prior to calling |ComputeClips|.
34 void CC_EXPORT
ComputeTransforms(TransformTree
* transform_tree
);
36 // Computes the visible content rect for every layer under |root_layer|. The
37 // visible content rect is the clipped content space rect that will be used for
40 BuildPropertyTreesAndComputeVisibleRects(Layer
* root_layer
,
41 const Layer
* page_scale_layer
,
42 float page_scale_factor
,
43 float device_scale_factor
,
44 const gfx::Rect
& viewport
,
45 const gfx::Transform
& device_transform
,
46 PropertyTrees
* property_trees
,
47 LayerList
* update_layer_list
);
50 BuildPropertyTreesAndComputeVisibleRects(LayerImpl
* root_layer
,
51 const LayerImpl
* page_scale_layer
,
52 float page_scale_factor
,
53 float device_scale_factor
,
54 const gfx::Rect
& viewport
,
55 const gfx::Transform
& device_transform
,
56 PropertyTrees
* property_trees
,
57 LayerImplList
* update_layer_list
);
60 ComputeVisibleRectsUsingPropertyTrees(Layer
* root_layer
,
61 PropertyTrees
* property_trees
,
62 LayerList
* update_layer_list
);
65 ComputeVisibleRectsUsingPropertyTrees(LayerImpl
* root_layer
,
66 PropertyTrees
* property_trees
,
67 LayerImplList
* update_layer_list
);
69 gfx::Transform CC_EXPORT
70 DrawTransformFromPropertyTrees(const Layer
* layer
, const TransformTree
& tree
);
72 gfx::Transform CC_EXPORT
73 DrawTransformFromPropertyTrees(const LayerImpl
* layer
,
74 const TransformTree
& tree
);
76 gfx::Transform CC_EXPORT
77 ScreenSpaceTransformFromPropertyTrees(const Layer
* layer
,
78 const TransformTree
& tree
);
80 gfx::Transform CC_EXPORT
81 ScreenSpaceTransformFromPropertyTrees(const LayerImpl
* layer
,
82 const TransformTree
& tree
);
85 DrawOpacityFromPropertyTrees(const Layer
* layer
, const OpacityTree
& tree
);
88 DrawOpacityFromPropertyTrees(const LayerImpl
* layer
, const OpacityTree
& tree
);
92 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_