OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_LAYERS_DRAW_PROPERTIES_H_ | 5 #ifndef CC_LAYERS_DRAW_PROPERTIES_H_ |
6 #define CC_LAYERS_DRAW_PROPERTIES_H_ | 6 #define CC_LAYERS_DRAW_PROPERTIES_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/trees/occlusion.h" | 9 #include "cc/trees/occlusion.h" |
10 #include "third_party/skia/include/core/SkXfermode.h" | 10 #include "third_party/skia/include/core/SkXfermode.h" |
11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
12 #include "ui/gfx/transform.h" | 12 #include "ui/gfx/transform.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 // Container for properties that layers need to compute before they can be | 16 // Container for properties that layers need to compute before they can be |
17 // drawn. | 17 // drawn. |
18 template <typename LayerType> | 18 template <typename LayerType> |
19 struct CC_EXPORT DrawProperties { | 19 struct CC_EXPORT DrawProperties { |
20 DrawProperties() | 20 DrawProperties() |
21 : opacity(0.f), | 21 : opacity(0.f), |
22 blend_mode(SkXfermode::kSrcOver_Mode), | 22 blend_mode(SkXfermode::kSrcOver_Mode), |
23 opacity_is_animating(false), | 23 opacity_is_animating(false), |
24 screen_space_opacity_is_animating(false), | 24 screen_space_opacity_is_animating(false), |
25 target_space_transform_is_animating(false), | 25 target_space_transform_is_animating(false), |
26 screen_space_transform_is_animating(false), | 26 screen_space_transform_is_animating(false), |
27 can_use_lcd_text(false), | 27 can_use_lcd_text(false), |
| 28 is_clipped(false), |
28 render_target(nullptr), | 29 render_target(nullptr), |
29 num_unclipped_descendants(0), | 30 num_unclipped_descendants(0), |
30 layer_or_descendant_has_copy_request(false), | 31 layer_or_descendant_has_copy_request(false), |
31 layer_or_descendant_has_input_handler(false), | 32 layer_or_descendant_has_input_handler(false), |
32 has_child_with_a_scroll_parent(false), | 33 has_child_with_a_scroll_parent(false), |
33 index_of_first_descendants_addition(0), | 34 index_of_first_descendants_addition(0), |
34 num_descendants_added(0), | 35 num_descendants_added(0), |
35 index_of_first_render_surface_layer_list_addition(0), | 36 index_of_first_render_surface_layer_list_addition(0), |
36 num_render_surfaces_added(0), | 37 num_render_surfaces_added(0), |
37 last_drawn_render_surface_layer_list_id(0), | 38 last_drawn_render_surface_layer_list_id(0), |
(...skipping 25 matching lines...) Expand all Loading... |
63 // animating, the main thread may not have the same values that are used | 64 // animating, the main thread may not have the same values that are used |
64 // to draw. | 65 // to draw. |
65 bool opacity_is_animating; | 66 bool opacity_is_animating; |
66 bool screen_space_opacity_is_animating; | 67 bool screen_space_opacity_is_animating; |
67 bool target_space_transform_is_animating; | 68 bool target_space_transform_is_animating; |
68 bool screen_space_transform_is_animating; | 69 bool screen_space_transform_is_animating; |
69 | 70 |
70 // True if the layer can use LCD text. | 71 // True if the layer can use LCD text. |
71 bool can_use_lcd_text; | 72 bool can_use_lcd_text; |
72 | 73 |
| 74 // True if the layer needs to be clipped by clip_rect. |
| 75 bool is_clipped; |
| 76 |
73 // The layer whose coordinate space this layer draws into. This can be | 77 // The layer whose coordinate space this layer draws into. This can be |
74 // either the same layer (draw_properties_.render_target == this) or an | 78 // either the same layer (draw_properties_.render_target == this) or an |
75 // ancestor of this layer. | 79 // ancestor of this layer. |
76 LayerType* render_target; | 80 LayerType* render_target; |
77 | 81 |
78 // This rect is a bounding box around what part of the layer is visible, in | 82 // This rect is a bounding box around what part of the layer is visible, in |
79 // the layer's coordinate space. | 83 // the layer's coordinate space. |
80 gfx::Rect visible_layer_rect; | 84 gfx::Rect visible_layer_rect; |
81 | 85 |
82 // In target surface space, the rect that encloses the clipped, drawable | 86 // In target surface space, the rect that encloses the clipped, drawable |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 float maximum_animation_contents_scale; | 134 float maximum_animation_contents_scale; |
131 | 135 |
132 // The scale during the layer animation start at which content should be | 136 // The scale during the layer animation start at which content should be |
133 // rastered at to be crisp. | 137 // rastered at to be crisp. |
134 float starting_animation_contents_scale; | 138 float starting_animation_contents_scale; |
135 }; | 139 }; |
136 | 140 |
137 } // namespace cc | 141 } // namespace cc |
138 | 142 |
139 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ | 143 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ |
OLD | NEW |