| 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 "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 #include "ui/gfx/transform.h" | 10 #include "ui/gfx/transform.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 // Container for properties that layers need to compute before they can be | 14 // Container for properties that layers need to compute before they can be |
| 15 // drawn. | 15 // drawn. |
| 16 template <typename LayerType> | 16 template <typename LayerType> |
| 17 struct CC_EXPORT DrawProperties { | 17 struct CC_EXPORT DrawProperties { |
| 18 DrawProperties() | 18 DrawProperties() |
| 19 : opacity(0.f), | 19 : opacity(0.f), |
| 20 opacity_is_animating(false), | 20 opacity_is_animating(false), |
| 21 screen_space_opacity_is_animating(false), | 21 screen_space_opacity_is_animating(false), |
| 22 target_space_transform_is_animating(false), | 22 target_space_transform_is_animating(false), |
| 23 screen_space_transform_is_animating(false), | 23 screen_space_transform_is_animating(false), |
| 24 can_use_lcd_text(false), | 24 can_use_lcd_text(false), |
| 25 is_clipped(false), | 25 is_clipped(false), |
| 26 render_target(NULL), | 26 render_target(NULL), |
| 27 contents_scale_x(1.f), | 27 contents_scale_x(1.f), |
| 28 contents_scale_y(1.f), | 28 contents_scale_y(1.f), |
| 29 num_descendants_that_draw_content(0), | |
| 30 num_unclipped_descendants(0), | 29 num_unclipped_descendants(0), |
| 31 layer_or_descendant_has_copy_request(false), | 30 layer_or_descendant_has_copy_request(false), |
| 32 layer_or_descendant_has_input_handler(false), | 31 layer_or_descendant_has_input_handler(false), |
| 33 has_child_with_a_scroll_parent(false), | 32 has_child_with_a_scroll_parent(false), |
| 34 sorted_for_recursion(false), | 33 sorted_for_recursion(false), |
| 35 index_of_first_descendants_addition(0), | 34 index_of_first_descendants_addition(0), |
| 36 num_descendants_added(0), | 35 num_descendants_added(0), |
| 37 index_of_first_render_surface_layer_list_addition(0), | 36 index_of_first_render_surface_layer_list_addition(0), |
| 38 num_render_surfaces_added(0), | 37 num_render_surfaces_added(0), |
| 39 last_drawn_render_surface_layer_list_id(0), | 38 last_drawn_render_surface_layer_list_id(0), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 gfx::Rect clip_rect; | 88 gfx::Rect clip_rect; |
| 90 | 89 |
| 91 // The scale used to move between layer space and content space, and bounds | 90 // The scale used to move between layer space and content space, and bounds |
| 92 // of the space. One is always a function of the other, but which one | 91 // of the space. One is always a function of the other, but which one |
| 93 // depends on the layer type. For picture layers, this is an ideal scale, | 92 // depends on the layer type. For picture layers, this is an ideal scale, |
| 94 // and not always the one used. | 93 // and not always the one used. |
| 95 float contents_scale_x; | 94 float contents_scale_x; |
| 96 float contents_scale_y; | 95 float contents_scale_y; |
| 97 gfx::Size content_bounds; | 96 gfx::Size content_bounds; |
| 98 | 97 |
| 99 // Does not include this layer itself, only its children and descendants. | |
| 100 int num_descendants_that_draw_content; | |
| 101 | |
| 102 // Number of descendants with a clip parent that is our ancestor. NB - this | 98 // Number of descendants with a clip parent that is our ancestor. NB - this |
| 103 // does not include our clip children because they are clipped by us. | 99 // does not include our clip children because they are clipped by us. |
| 104 int num_unclipped_descendants; | 100 int num_unclipped_descendants; |
| 105 | 101 |
| 106 // If true, the layer or some layer in its sub-tree has a CopyOutputRequest | 102 // If true, the layer or some layer in its sub-tree has a CopyOutputRequest |
| 107 // present on it. | 103 // present on it. |
| 108 bool layer_or_descendant_has_copy_request; | 104 bool layer_or_descendant_has_copy_request; |
| 109 | 105 |
| 110 // If true, the layer or one of its descendants has a wheel or touch handler. | 106 // If true, the layer or one of its descendants has a wheel or touch handler. |
| 111 bool layer_or_descendant_has_input_handler; | 107 bool layer_or_descendant_has_input_handler; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // have page scale applied and others not, this may differ between layers. | 145 // have page scale applied and others not, this may differ between layers. |
| 150 float page_scale_factor; | 146 float page_scale_factor; |
| 151 | 147 |
| 152 // The device scale factor that is applied to the layer. | 148 // The device scale factor that is applied to the layer. |
| 153 float device_scale_factor; | 149 float device_scale_factor; |
| 154 }; | 150 }; |
| 155 | 151 |
| 156 } // namespace cc | 152 } // namespace cc |
| 157 | 153 |
| 158 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ | 154 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ |
| OLD | NEW |