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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 can_use_lcd_text(false), | 27 can_use_lcd_text(false), |
28 is_clipped(false), | 28 is_clipped(false), |
29 render_target(nullptr), | 29 render_target(nullptr), |
30 contents_scale_x(1.f), | 30 contents_scale_x(1.f), |
31 contents_scale_y(1.f), | 31 contents_scale_y(1.f), |
32 num_unclipped_descendants(0), | 32 num_unclipped_descendants(0), |
33 layer_or_descendant_has_copy_request(false), | 33 layer_or_descendant_has_copy_request(false), |
34 layer_or_descendant_has_input_handler(false), | 34 layer_or_descendant_has_input_handler(false), |
35 has_child_with_a_scroll_parent(false), | 35 has_child_with_a_scroll_parent(false), |
36 sorted_for_recursion(false), | 36 sorted_for_recursion(false), |
| 37 visited(false), |
37 index_of_first_descendants_addition(0), | 38 index_of_first_descendants_addition(0), |
38 num_descendants_added(0), | 39 num_descendants_added(0), |
39 index_of_first_render_surface_layer_list_addition(0), | 40 index_of_first_render_surface_layer_list_addition(0), |
40 num_render_surfaces_added(0), | 41 num_render_surfaces_added(0), |
41 last_drawn_render_surface_layer_list_id(0), | 42 last_drawn_render_surface_layer_list_id(0), |
42 ideal_contents_scale(0.f), | 43 ideal_contents_scale(0.f), |
43 maximum_animation_contents_scale(0.f), | 44 maximum_animation_contents_scale(0.f), |
44 page_scale_factor(0.f), | 45 page_scale_factor(0.f), |
45 device_scale_factor(0.f) {} | 46 device_scale_factor(0.f) {} |
46 | 47 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // This is true if the layer has any direct child that has a scroll parent. | 117 // This is true if the layer has any direct child that has a scroll parent. |
117 // This layer will not be the scroll parent in this case. This information | 118 // This layer will not be the scroll parent in this case. This information |
118 // lets us avoid work in CalculateDrawPropertiesInternal -- if none of our | 119 // lets us avoid work in CalculateDrawPropertiesInternal -- if none of our |
119 // children have scroll parents, we will not need to recur out of order. | 120 // children have scroll parents, we will not need to recur out of order. |
120 bool has_child_with_a_scroll_parent; | 121 bool has_child_with_a_scroll_parent; |
121 | 122 |
122 // This is true if the order (wrt to its siblings in the tree) in which the | 123 // This is true if the order (wrt to its siblings in the tree) in which the |
123 // layer will be visited while computing draw properties has been determined. | 124 // layer will be visited while computing draw properties has been determined. |
124 bool sorted_for_recursion; | 125 bool sorted_for_recursion; |
125 | 126 |
| 127 // This is used to sanity-check CDP and ensure that we don't revisit a layer. |
| 128 bool visited; |
| 129 |
126 // If this layer is visited out of order, its contribution to the descendant | 130 // If this layer is visited out of order, its contribution to the descendant |
127 // and render surface layer lists will be put aside in a temporary list. | 131 // and render surface layer lists will be put aside in a temporary list. |
128 // These values will allow for an efficient reordering of these additions. | 132 // These values will allow for an efficient reordering of these additions. |
129 size_t index_of_first_descendants_addition; | 133 size_t index_of_first_descendants_addition; |
130 size_t num_descendants_added; | 134 size_t num_descendants_added; |
131 size_t index_of_first_render_surface_layer_list_addition; | 135 size_t index_of_first_render_surface_layer_list_addition; |
132 size_t num_render_surfaces_added; | 136 size_t num_render_surfaces_added; |
133 | 137 |
134 // Each time we generate a new render surface layer list, an ID is used to | 138 // Each time we generate a new render surface layer list, an ID is used to |
135 // identify it. |last_drawn_render_surface_layer_list_id| is set to the ID | 139 // identify it. |last_drawn_render_surface_layer_list_id| is set to the ID |
(...skipping 16 matching lines...) Expand all Loading... |
152 // have page scale applied and others not, this may differ between layers. | 156 // have page scale applied and others not, this may differ between layers. |
153 float page_scale_factor; | 157 float page_scale_factor; |
154 | 158 |
155 // The device scale factor that is applied to the layer. | 159 // The device scale factor that is applied to the layer. |
156 float device_scale_factor; | 160 float device_scale_factor; |
157 }; | 161 }; |
158 | 162 |
159 } // namespace cc | 163 } // namespace cc |
160 | 164 |
161 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ | 165 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ |
OLD | NEW |