forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraw_property_utils.h
142 lines (111 loc) · 5.73 KB
/
draw_property_utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_TREES_DRAW_PROPERTY_UTILS_H_
#define CC_TREES_DRAW_PROPERTY_UTILS_H_
#include "cc/base/cc_export.h"
#include "cc/layers/layer_collections.h"
namespace gfx {
class Rect;
class Transform;
class Vector2dF;
} // namespace gfx
namespace cc {
class ClipTree;
struct DrawProperties;
class Layer;
class LayerImpl;
class LayerTree;
class RenderSurfaceImpl;
class EffectTree;
class TransformTree;
class PropertyTrees;
struct EffectNode;
namespace draw_property_utils {
void CC_EXPORT PostConcatSurfaceContentsScale(const EffectNode* effect_node,
gfx::Transform* transform);
void CC_EXPORT ConcatInverseSurfaceContentsScale(const EffectNode* effect_node,
gfx::Transform* transform);
// Computes combined clips for every node in |clip_tree|. This function requires
// that |transform_tree| has been updated via |ComputeTransforms|.
void CC_EXPORT ComputeClips(PropertyTrees* property_trees,
bool non_root_surfaces_enabled);
// Computes combined (screen space) transforms for every node in the transform
// tree. This must be done prior to calling |ComputeClips|.
void CC_EXPORT ComputeTransforms(TransformTree* transform_tree);
// Computes screen space opacity for every node in the opacity tree.
void CC_EXPORT ComputeEffects(EffectTree* effect_tree);
void CC_EXPORT BuildPropertyTreesAndComputeVisibleRects(
LayerImpl* root_layer,
const LayerImpl* page_scale_layer,
const LayerImpl* inner_viewport_scroll_layer,
const LayerImpl* outer_viewport_scroll_layer,
const LayerImpl* overscroll_elasticity_layer,
const gfx::Vector2dF& elastic_overscroll,
float page_scale_factor,
float device_scale_factor,
const gfx::Rect& viewport,
const gfx::Transform& device_transform,
bool can_render_to_separate_surface,
PropertyTrees* property_trees,
LayerImplList* visible_layer_list);
void CC_EXPORT UpdatePropertyTrees(PropertyTrees* property_trees,
bool can_render_to_separate_surface);
void CC_EXPORT FindLayersThatNeedUpdates(LayerTree* layer_tree,
const PropertyTrees* property_trees,
LayerList* update_layer_list);
void CC_EXPORT ComputeVisibleRects(LayerImpl* root_layer,
PropertyTrees* property_trees,
bool can_render_to_separate_surface,
LayerImplList* visible_layer_list);
gfx::Rect CC_EXPORT
ComputeLayerVisibleRectDynamic(const PropertyTrees* property_trees,
const LayerImpl* layer);
void CC_EXPORT
VerifyVisibleRectsCalculations(const LayerImplList& layer_list,
const PropertyTrees* property_trees);
void CC_EXPORT ComputeLayerDrawProperties(LayerImpl* layer,
const PropertyTrees* property_trees);
void CC_EXPORT ComputeMaskDrawProperties(LayerImpl* mask_layer,
const PropertyTrees* property_trees);
void CC_EXPORT ComputeSurfaceDrawProperties(const PropertyTrees* property_trees,
RenderSurfaceImpl* render_surface);
bool CC_EXPORT LayerShouldBeSkipped(LayerImpl* layer,
const TransformTree& transform_tree,
const EffectTree& effect_tree);
bool CC_EXPORT LayerNeedsUpdate(Layer* layer,
bool layer_is_drawn,
const PropertyTrees* property_trees);
bool CC_EXPORT LayerNeedsUpdate(LayerImpl* layer,
bool layer_is_drawn,
const PropertyTrees* property_trees);
void CC_EXPORT VerifyClipTreeCalculations(const LayerImplList& layer_list,
PropertyTrees* property_trees);
gfx::Transform CC_EXPORT DrawTransform(const LayerImpl* layer,
const TransformTree& transform_tree,
const EffectTree& effect_tree);
gfx::Transform CC_EXPORT ScreenSpaceTransform(const Layer* layer,
const TransformTree& tree);
gfx::Transform CC_EXPORT ScreenSpaceTransform(const LayerImpl* layer,
const TransformTree& tree);
void CC_EXPORT UpdatePageScaleFactor(PropertyTrees* property_trees,
const LayerImpl* page_scale_layer,
float page_scale_factor,
float device_scale_factor,
const gfx::Transform device_transform);
void CC_EXPORT UpdatePageScaleFactor(PropertyTrees* property_trees,
const Layer* page_scale_layer,
float page_scale_factor,
float device_scale_factor,
const gfx::Transform device_transform);
void CC_EXPORT
UpdateElasticOverscroll(PropertyTrees* property_trees,
const LayerImpl* overscroll_elasticity_layer,
const gfx::Vector2dF& elastic_overscroll);
void CC_EXPORT
UpdateElasticOverscroll(PropertyTrees* property_trees,
const Layer* overscroll_elasticity_layer,
const gfx::Vector2dF& elastic_overscroll);
} // namespace draw_property_utils
} // namespace cc
#endif // CC_TREES_DRAW_PROPERTY_UTILS_H_