[Android] Introduce new UMA action for when user copies Image URL from context menu
[chromium-blink-merge.git] / cc / trees / draw_property_utils.h
blob952bef1a691cd3648693eefc334075fb4d338391
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 screen space opacity for every node in the opacity tree.
37 void CC_EXPORT ComputeOpacities(OpacityTree* opacity_tree);
39 // Computes the visible content rect for every layer under |root_layer|. The
40 // visible content rect is the clipped content space rect that will be used for
41 // recording.
42 void CC_EXPORT BuildPropertyTreesAndComputeVisibleRects(
43 Layer* root_layer,
44 const Layer* page_scale_layer,
45 const Layer* inner_viewport_scroll_layer,
46 const Layer* outer_viewport_scroll_layer,
47 float page_scale_factor,
48 float device_scale_factor,
49 const gfx::Rect& viewport,
50 const gfx::Transform& device_transform,
51 PropertyTrees* property_trees,
52 LayerList* update_layer_list);
54 void CC_EXPORT BuildPropertyTreesAndComputeVisibleRects(
55 LayerImpl* root_layer,
56 const LayerImpl* page_scale_layer,
57 const LayerImpl* inner_viewport_scroll_layer,
58 const LayerImpl* outer_viewport_scroll_layer,
59 float page_scale_factor,
60 float device_scale_factor,
61 const gfx::Rect& viewport,
62 const gfx::Transform& device_transform,
63 PropertyTrees* property_trees,
64 LayerImplList* update_layer_list);
66 void CC_EXPORT
67 ComputeVisibleRectsUsingPropertyTrees(Layer* root_layer,
68 PropertyTrees* property_trees,
69 LayerList* update_layer_list);
71 void CC_EXPORT
72 ComputeVisibleRectsUsingPropertyTrees(LayerImpl* root_layer,
73 PropertyTrees* property_trees,
74 LayerImplList* update_layer_list);
76 gfx::Transform CC_EXPORT
77 DrawTransformFromPropertyTrees(const Layer* layer, const TransformTree& tree);
79 gfx::Transform CC_EXPORT
80 DrawTransformFromPropertyTrees(const LayerImpl* layer,
81 const TransformTree& tree);
83 gfx::Transform CC_EXPORT
84 ScreenSpaceTransformFromPropertyTrees(const Layer* layer,
85 const TransformTree& tree);
87 gfx::Transform CC_EXPORT
88 ScreenSpaceTransformFromPropertyTrees(const LayerImpl* layer,
89 const TransformTree& tree);
91 float CC_EXPORT
92 DrawOpacityFromPropertyTrees(const Layer* layer, const OpacityTree& tree);
94 float CC_EXPORT
95 DrawOpacityFromPropertyTrees(const LayerImpl* layer, const OpacityTree& tree);
97 bool CC_EXPORT
98 CanUseLcdTextFromPropertyTrees(const LayerImpl* layer,
99 bool layers_always_allowed_lcd_text,
100 bool can_use_lcd_text,
101 PropertyTrees* property_trees);
103 } // namespace cc
105 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_