Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / cc / trees / draw_property_utils.h
blob1291e0f30bad74394cb7289c3518c12dbf2a86ab
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 struct DrawProperties;
20 class Layer;
21 class LayerImpl;
22 struct RenderSurfaceDrawProperties;
23 class RenderSurfaceImpl;
24 class EffectTree;
25 class TransformTree;
26 class PropertyTrees;
28 // Computes combined clips for every node in |clip_tree|. This function requires
29 // that |transform_tree| has been updated via |ComputeTransforms|.
30 // TODO(vollick): ComputeClips and ComputeTransforms will eventually need to be
31 // done on both threads.
32 void CC_EXPORT
33 ComputeClips(ClipTree* clip_tree, const TransformTree& transform_tree);
35 // Computes combined (screen space) transforms for every node in the transform
36 // tree. This must be done prior to calling |ComputeClips|.
37 void CC_EXPORT ComputeTransforms(TransformTree* transform_tree);
39 // Computes screen space opacity for every node in the opacity tree.
40 void CC_EXPORT ComputeOpacities(EffectTree* effect_tree);
42 // Computes the visible content rect for every layer under |root_layer|. The
43 // visible content rect is the clipped content space rect that will be used for
44 // recording.
45 void CC_EXPORT BuildPropertyTreesAndComputeVisibleRects(
46 Layer* root_layer,
47 const Layer* page_scale_layer,
48 const Layer* inner_viewport_scroll_layer,
49 const Layer* outer_viewport_scroll_layer,
50 float page_scale_factor,
51 float device_scale_factor,
52 const gfx::Rect& viewport,
53 const gfx::Transform& device_transform,
54 PropertyTrees* property_trees,
55 LayerList* update_layer_list);
57 void CC_EXPORT BuildPropertyTreesAndComputeVisibleRects(
58 LayerImpl* root_layer,
59 const LayerImpl* page_scale_layer,
60 const LayerImpl* inner_viewport_scroll_layer,
61 const LayerImpl* outer_viewport_scroll_layer,
62 float page_scale_factor,
63 float device_scale_factor,
64 const gfx::Rect& viewport,
65 const gfx::Transform& device_transform,
66 PropertyTrees* property_trees,
67 LayerImplList* update_layer_list);
69 void CC_EXPORT
70 ComputeVisibleRectsUsingPropertyTrees(Layer* root_layer,
71 PropertyTrees* property_trees,
72 LayerList* update_layer_list);
74 void CC_EXPORT
75 ComputeVisibleRectsUsingPropertyTrees(LayerImpl* root_layer,
76 PropertyTrees* property_trees,
77 LayerImplList* update_layer_list);
79 void CC_EXPORT ComputeLayerDrawPropertiesUsingPropertyTrees(
80 const LayerImpl* layer,
81 const PropertyTrees* property_trees,
82 bool layers_always_allowed_lcd_text,
83 bool can_use_lcd_text,
84 DrawProperties* draw_properties);
86 void CC_EXPORT ComputeSurfaceDrawPropertiesUsingPropertyTrees(
87 RenderSurfaceImpl* render_surface,
88 const PropertyTrees* property_trees,
89 RenderSurfaceDrawProperties* draw_properties);
91 gfx::Transform CC_EXPORT
92 DrawTransformFromPropertyTrees(const Layer* layer, const TransformTree& tree);
94 gfx::Transform CC_EXPORT
95 DrawTransformFromPropertyTrees(const LayerImpl* layer,
96 const TransformTree& tree);
98 gfx::Transform CC_EXPORT
99 ScreenSpaceTransformFromPropertyTrees(const Layer* layer,
100 const TransformTree& tree);
102 gfx::Transform CC_EXPORT
103 ScreenSpaceTransformFromPropertyTrees(const LayerImpl* layer,
104 const TransformTree& tree);
106 } // namespace cc
108 #endif // CC_TREES_DRAW_PROPERTY_UTILS_H_