cc: use property trees instead of CDP on the main thread
[chromium-blink-merge.git] / cc / trees / draw_property_utils.h
blob893645d7dd96c8b0b949db1202d9ac316a64eba1
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 OpacityTree;
22 class TransformTree;
23 class PropertyTrees;
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.
29 void CC_EXPORT
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
38 // recording.
39 void CC_EXPORT
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);
49 void CC_EXPORT
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);
59 void CC_EXPORT
60 ComputeVisibleRectsUsingPropertyTrees(Layer* root_layer,
61 PropertyTrees* property_trees,
62 LayerList* update_layer_list);
64 void CC_EXPORT
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);
84 float CC_EXPORT
85 DrawOpacityFromPropertyTrees(const Layer* layer, const OpacityTree& tree);
87 float CC_EXPORT
88 DrawOpacityFromPropertyTrees(const LayerImpl* layer, const OpacityTree& tree);
90 } // namespace cc
92 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_