Clip Rect From Property Trees
[chromium-blink-merge.git] / cc / trees / draw_property_utils.h
blobc14b0a551c56337acd0a8d27a84f9ce98c143f9c
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"
11 namespace gfx {
12 class Rect;
13 class Transform;
14 } // namespace gfx
16 namespace cc {
18 class ClipTree;
19 class Layer;
20 class LayerImpl;
21 class RenderSurfaceImpl;
22 class OpacityTree;
23 class TransformTree;
24 class PropertyTrees;
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.
30 void CC_EXPORT
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
42 // recording.
43 void CC_EXPORT BuildPropertyTreesAndComputeVisibleRects(
44 Layer* root_layer,
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);
67 void CC_EXPORT
68 ComputeVisibleRectsUsingPropertyTrees(Layer* root_layer,
69 PropertyTrees* property_trees,
70 LayerList* update_layer_list);
72 void CC_EXPORT
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);
96 bool CC_EXPORT
97 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const Layer* layer,
98 const TransformTree& tree);
100 bool CC_EXPORT
101 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const LayerImpl* layer,
102 const TransformTree& tree);
104 float CC_EXPORT
105 DrawOpacityFromPropertyTrees(const Layer* layer, const OpacityTree& tree);
107 float CC_EXPORT
108 DrawOpacityFromPropertyTrees(const LayerImpl* layer, const OpacityTree& tree);
110 bool CC_EXPORT
111 CanUseLcdTextFromPropertyTrees(const LayerImpl* layer,
112 bool layers_always_allowed_lcd_text,
113 bool can_use_lcd_text,
114 PropertyTrees* property_trees);
116 gfx::Rect CC_EXPORT
117 DrawableContentRectFromPropertyTrees(const LayerImpl* layer,
118 const TransformTree& transform_tree);
120 gfx::Rect CC_EXPORT
121 ClipRectFromPropertyTrees(const LayerImpl* layer,
122 const TransformTree& transform_tree);
123 } // namespace cc
125 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_