Landing Recent QUIC changes until 8/19/2015 17:00 UTC.
[chromium-blink-merge.git] / cc / trees / draw_property_utils.h
blob5303d4834536b4d2e7a5f5bee0ea422954520d88
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 EffectTree;
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(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
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 bool CC_EXPORT
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 const 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);
108 bool CC_EXPORT
109 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const Layer* layer,
110 const TransformTree& tree);
112 bool CC_EXPORT
113 ScreenSpaceTransformIsAnimatingFromPropertyTrees(const LayerImpl* layer,
114 const TransformTree& tree);
116 float CC_EXPORT
117 MaximumAnimationTargetScaleFromPropertyTrees(const LayerImpl* layer,
118 const TransformTree& tree);
120 float CC_EXPORT
121 StartingAnimationScaleFromPropertyTrees(const LayerImpl* layer,
122 const TransformTree& tree);
124 float CC_EXPORT DrawOpacityFromPropertyTrees(const Layer* layer,
125 const EffectTree& tree);
127 float CC_EXPORT DrawOpacityFromPropertyTrees(const LayerImpl* layer,
128 const EffectTree& tree);
130 float CC_EXPORT
131 DrawOpacityOfRenderSurfaceFromPropertyTrees(RenderSurfaceImpl* render_surface,
132 const EffectTree& tree);
134 bool CC_EXPORT
135 CanUseLcdTextFromPropertyTrees(const LayerImpl* layer,
136 bool layers_always_allowed_lcd_text,
137 bool can_use_lcd_text,
138 PropertyTrees* property_trees);
140 gfx::Rect CC_EXPORT DrawableContentRectOfSurfaceFromPropertyTrees(
141 const RenderSurfaceImpl* render_surface,
142 const TransformTree& transform_tree);
144 gfx::Rect CC_EXPORT
145 DrawableContentRectFromPropertyTrees(const LayerImpl* layer,
146 const TransformTree& transform_tree);
148 gfx::Rect CC_EXPORT
149 ClipRectFromPropertyTrees(const LayerImpl* layer,
150 const TransformTree& transform_tree);
152 gfx::Rect CC_EXPORT ViewportRectFromPropertyTrees(const ClipTree& tree);
154 gfx::Transform CC_EXPORT DrawTransformOfRenderSurfaceReplicaFromPropertyTrees(
155 const RenderSurfaceImpl* render_surface,
156 const TransformTree& tree);
158 gfx::Transform CC_EXPORT
159 ScreenSpaceTransformOfRenderSurfaceReplicaFromPropertyTrees(
160 const RenderSurfaceImpl* render_surface,
161 const TransformTree& tree);
163 } // namespace cc
165 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_