| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| 11 #include "cc/layers/heads_up_display_layer_impl.h" | 11 #include "cc/layers/heads_up_display_layer_impl.h" |
| 12 #include "cc/layers/layer.h" | 12 #include "cc/layers/layer.h" |
| 13 #include "cc/layers/layer_impl.h" | 13 #include "cc/layers/layer_impl.h" |
| 14 #include "cc/layers/layer_iterator.h" | 14 #include "cc/layers/layer_iterator.h" |
| 15 #include "cc/layers/render_surface.h" | 15 #include "cc/layers/render_surface.h" |
| 16 #include "cc/layers/render_surface_impl.h" | 16 #include "cc/layers/render_surface_impl.h" |
| 17 #include "cc/trees/draw_property_utils.h" | 17 #include "cc/trees/draw_property_utils.h" |
| 18 #include "cc/trees/layer_sorter.h" | |
| 19 #include "cc/trees/layer_tree_host.h" | 18 #include "cc/trees/layer_tree_host.h" |
| 20 #include "cc/trees/layer_tree_impl.h" | 19 #include "cc/trees/layer_tree_impl.h" |
| 21 #include "ui/gfx/geometry/rect_conversions.h" | 20 #include "ui/gfx/geometry/rect_conversions.h" |
| 22 #include "ui/gfx/geometry/vector2d_conversions.h" | 21 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 23 #include "ui/gfx/transform.h" | 22 #include "ui/gfx/transform.h" |
| 24 #include "ui/gfx/transform_util.h" | 23 #include "ui/gfx/transform_util.h" |
| 25 | 24 |
| 26 namespace cc { | 25 namespace cc { |
| 27 | 26 |
| 28 ScrollAndScaleSet::ScrollAndScaleSet() | 27 ScrollAndScaleSet::ScrollAndScaleSet() |
| 29 : page_scale_delta(1.f), top_controls_delta(0.f) { | 28 : page_scale_delta(1.f), top_controls_delta(0.f) { |
| 30 } | 29 } |
| 31 | 30 |
| 32 ScrollAndScaleSet::~ScrollAndScaleSet() {} | 31 ScrollAndScaleSet::~ScrollAndScaleSet() {} |
| 33 | 32 |
| 34 static void SortLayers(LayerList::iterator first, | |
| 35 LayerList::iterator end, | |
| 36 void* layer_sorter) { | |
| 37 NOTREACHED(); | |
| 38 } | |
| 39 | |
| 40 static void SortLayers(LayerImplList::iterator first, | |
| 41 LayerImplList::iterator end, | |
| 42 LayerSorter* layer_sorter) { | |
| 43 DCHECK(layer_sorter); | |
| 44 TRACE_EVENT0("cc", "LayerTreeHostCommon::SortLayers"); | |
| 45 layer_sorter->Sort(first, end); | |
| 46 } | |
| 47 | |
| 48 template <typename LayerType> | 33 template <typename LayerType> |
| 49 static gfx::Vector2dF GetEffectiveScrollDelta(LayerType* layer) { | 34 static gfx::Vector2dF GetEffectiveScrollDelta(LayerType* layer) { |
| 50 // Layer's scroll offset can have an integer part and fractional part. | 35 // Layer's scroll offset can have an integer part and fractional part. |
| 51 // Due to Blink's limitation, it only counter-scrolls the position-fixed | 36 // Due to Blink's limitation, it only counter-scrolls the position-fixed |
| 52 // layer using the integer part of Layer's scroll offset. | 37 // layer using the integer part of Layer's scroll offset. |
| 53 // CC scrolls the layer using the full scroll offset, so we have to | 38 // CC scrolls the layer using the full scroll offset, so we have to |
| 54 // add the ScrollCompensationAdjustment (fractional part of the scroll | 39 // add the ScrollCompensationAdjustment (fractional part of the scroll |
| 55 // offset) to the effective scroll delta which is used to counter-scroll | 40 // offset) to the effective scroll delta which is used to counter-scroll |
| 56 // the position-fixed layer. | 41 // the position-fixed layer. |
| 57 gfx::Vector2dF scroll_delta = | 42 gfx::Vector2dF scroll_delta = |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 layer_maximum_animated_scale * | 1106 layer_maximum_animated_scale * |
| 1122 std::max(ancestor_transform_scales.x(), ancestor_transform_scales.y()); | 1107 std::max(ancestor_transform_scales.x(), ancestor_transform_scales.y()); |
| 1123 } | 1108 } |
| 1124 | 1109 |
| 1125 template <typename LayerTypePtr> | 1110 template <typename LayerTypePtr> |
| 1126 static inline void MarkLayerWithRenderSurfaceLayerListId( | 1111 static inline void MarkLayerWithRenderSurfaceLayerListId( |
| 1127 LayerTypePtr layer, | 1112 LayerTypePtr layer, |
| 1128 int current_render_surface_layer_list_id) { | 1113 int current_render_surface_layer_list_id) { |
| 1129 layer->draw_properties().last_drawn_render_surface_layer_list_id = | 1114 layer->draw_properties().last_drawn_render_surface_layer_list_id = |
| 1130 current_render_surface_layer_list_id; | 1115 current_render_surface_layer_list_id; |
| 1116 layer->draw_properties().layer_or_descendant_is_drawn = |
| 1117 !!current_render_surface_layer_list_id; |
| 1131 } | 1118 } |
| 1132 | 1119 |
| 1133 template <typename LayerTypePtr> | 1120 template <typename LayerTypePtr> |
| 1134 static inline void MarkMasksWithRenderSurfaceLayerListId( | 1121 static inline void MarkMasksWithRenderSurfaceLayerListId( |
| 1135 LayerTypePtr layer, | 1122 LayerTypePtr layer, |
| 1136 int current_render_surface_layer_list_id) { | 1123 int current_render_surface_layer_list_id) { |
| 1137 if (layer->mask_layer()) { | 1124 if (layer->mask_layer()) { |
| 1138 MarkLayerWithRenderSurfaceLayerListId(layer->mask_layer(), | 1125 MarkLayerWithRenderSurfaceLayerListId(layer->mask_layer(), |
| 1139 current_render_surface_layer_list_id); | 1126 current_render_surface_layer_list_id); |
| 1140 } | 1127 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 PreCalculateMetaInformationRecursiveData() | 1180 PreCalculateMetaInformationRecursiveData() |
| 1194 : layer_or_descendant_has_copy_request(false), | 1181 : layer_or_descendant_has_copy_request(false), |
| 1195 layer_or_descendant_has_input_handler(false), | 1182 layer_or_descendant_has_input_handler(false), |
| 1196 num_unclipped_descendants(0) {} | 1183 num_unclipped_descendants(0) {} |
| 1197 | 1184 |
| 1198 void Merge(const PreCalculateMetaInformationRecursiveData& data) { | 1185 void Merge(const PreCalculateMetaInformationRecursiveData& data) { |
| 1199 layer_or_descendant_has_copy_request |= | 1186 layer_or_descendant_has_copy_request |= |
| 1200 data.layer_or_descendant_has_copy_request; | 1187 data.layer_or_descendant_has_copy_request; |
| 1201 layer_or_descendant_has_input_handler |= | 1188 layer_or_descendant_has_input_handler |= |
| 1202 data.layer_or_descendant_has_input_handler; | 1189 data.layer_or_descendant_has_input_handler; |
| 1203 num_unclipped_descendants += | 1190 num_unclipped_descendants += data.num_unclipped_descendants; |
| 1204 data.num_unclipped_descendants; | |
| 1205 } | 1191 } |
| 1206 }; | 1192 }; |
| 1207 | 1193 |
| 1208 static void ValidateRenderSurface(LayerImpl* layer) { | 1194 static void ValidateRenderSurface(LayerImpl* layer) { |
| 1209 // This test verifies that there are no cases where a LayerImpl needs | 1195 // This test verifies that there are no cases where a LayerImpl needs |
| 1210 // a render surface, but doesn't have one. | 1196 // a render surface, but doesn't have one. |
| 1211 if (layer->render_surface()) | 1197 if (layer->render_surface()) |
| 1212 return; | 1198 return; |
| 1213 | 1199 |
| 1214 DCHECK(layer->filters().IsEmpty()) << "layer: " << layer->id(); | 1200 DCHECK(layer->filters().IsEmpty()) << "layer: " << layer->id(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1226 // Recursively walks the layer tree to compute any information that is needed | 1212 // Recursively walks the layer tree to compute any information that is needed |
| 1227 // before doing the main recursion. | 1213 // before doing the main recursion. |
| 1228 template <typename LayerType> | 1214 template <typename LayerType> |
| 1229 static void PreCalculateMetaInformation( | 1215 static void PreCalculateMetaInformation( |
| 1230 LayerType* layer, | 1216 LayerType* layer, |
| 1231 PreCalculateMetaInformationRecursiveData* recursive_data) { | 1217 PreCalculateMetaInformationRecursiveData* recursive_data) { |
| 1232 ValidateRenderSurface(layer); | 1218 ValidateRenderSurface(layer); |
| 1233 | 1219 |
| 1234 layer->draw_properties().sorted_for_recursion = false; | 1220 layer->draw_properties().sorted_for_recursion = false; |
| 1235 layer->draw_properties().has_child_with_a_scroll_parent = false; | 1221 layer->draw_properties().has_child_with_a_scroll_parent = false; |
| 1222 layer->draw_properties().layer_or_descendant_is_drawn = false; |
| 1236 layer->draw_properties().visited = false; | 1223 layer->draw_properties().visited = false; |
| 1237 | 1224 |
| 1238 if (!HasInvertibleOrAnimatedTransform(layer)) { | 1225 if (!HasInvertibleOrAnimatedTransform(layer)) { |
| 1239 // Layers with singular transforms should not be drawn, the whole subtree | 1226 // Layers with singular transforms should not be drawn, the whole subtree |
| 1240 // can be skipped. | 1227 // can be skipped. |
| 1241 return; | 1228 return; |
| 1242 } | 1229 } |
| 1243 | 1230 |
| 1244 if (layer->clip_parent()) | 1231 if (layer->clip_parent()) |
| 1245 recursive_data->num_unclipped_descendants++; | 1232 recursive_data->num_unclipped_descendants++; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1272 layer->draw_properties().num_unclipped_descendants = | 1259 layer->draw_properties().num_unclipped_descendants = |
| 1273 recursive_data->num_unclipped_descendants; | 1260 recursive_data->num_unclipped_descendants; |
| 1274 layer->draw_properties().layer_or_descendant_has_copy_request = | 1261 layer->draw_properties().layer_or_descendant_has_copy_request = |
| 1275 recursive_data->layer_or_descendant_has_copy_request; | 1262 recursive_data->layer_or_descendant_has_copy_request; |
| 1276 layer->draw_properties().layer_or_descendant_has_input_handler = | 1263 layer->draw_properties().layer_or_descendant_has_input_handler = |
| 1277 recursive_data->layer_or_descendant_has_input_handler; | 1264 recursive_data->layer_or_descendant_has_input_handler; |
| 1278 } | 1265 } |
| 1279 | 1266 |
| 1280 template <typename LayerType> | 1267 template <typename LayerType> |
| 1281 struct SubtreeGlobals { | 1268 struct SubtreeGlobals { |
| 1282 LayerSorter* layer_sorter; | |
| 1283 int max_texture_size; | 1269 int max_texture_size; |
| 1284 float device_scale_factor; | 1270 float device_scale_factor; |
| 1285 float page_scale_factor; | 1271 float page_scale_factor; |
| 1286 const LayerType* page_scale_application_layer; | 1272 const LayerType* page_scale_application_layer; |
| 1287 gfx::Vector2dF elastic_overscroll; | 1273 gfx::Vector2dF elastic_overscroll; |
| 1288 const LayerType* elastic_overscroll_application_layer; | 1274 const LayerType* elastic_overscroll_application_layer; |
| 1289 bool can_adjust_raster_scales; | 1275 bool can_adjust_raster_scales; |
| 1290 bool can_render_to_separate_surface; | 1276 bool can_render_to_separate_surface; |
| 1291 bool layers_always_allowed_lcd_text; | 1277 bool layers_always_allowed_lcd_text; |
| 1292 }; | 1278 }; |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 layer_draw_properties.target_space_transform = combined_transform; | 1793 layer_draw_properties.target_space_transform = combined_transform; |
| 1808 // M[draw] = M[parent] * LT * S[layer2content] | 1794 // M[draw] = M[parent] * LT * S[layer2content] |
| 1809 layer_draw_properties.target_space_transform.Scale( | 1795 layer_draw_properties.target_space_transform.Scale( |
| 1810 SK_MScalar1 / layer->contents_scale_x(), | 1796 SK_MScalar1 / layer->contents_scale_x(), |
| 1811 SK_MScalar1 / layer->contents_scale_y()); | 1797 SK_MScalar1 / layer->contents_scale_y()); |
| 1812 | 1798 |
| 1813 // The layer's screen_space_transform represents the transform between root | 1799 // The layer's screen_space_transform represents the transform between root |
| 1814 // layer's "screen space" and local content space. | 1800 // layer's "screen space" and local content space. |
| 1815 layer_draw_properties.screen_space_transform = | 1801 layer_draw_properties.screen_space_transform = |
| 1816 data_from_ancestor.full_hierarchy_matrix; | 1802 data_from_ancestor.full_hierarchy_matrix; |
| 1817 if (layer->should_flatten_transform()) | |
| 1818 layer_draw_properties.screen_space_transform.FlattenTo2d(); | |
| 1819 layer_draw_properties.screen_space_transform.PreconcatTransform | 1803 layer_draw_properties.screen_space_transform.PreconcatTransform |
| 1820 (layer_draw_properties.target_space_transform); | 1804 (layer_draw_properties.target_space_transform); |
| 1821 | 1805 |
| 1822 // Adjusting text AA method during animation may cause repaints, which in-turn | 1806 // Adjusting text AA method during animation may cause repaints, which in-turn |
| 1823 // causes jank. | 1807 // causes jank. |
| 1824 bool adjust_text_aa = | 1808 bool adjust_text_aa = |
| 1825 !animating_opacity_to_screen && !animating_transform_to_screen; | 1809 !animating_opacity_to_screen && !animating_transform_to_screen; |
| 1826 bool layer_can_use_lcd_text = true; | 1810 bool layer_can_use_lcd_text = true; |
| 1827 bool subtree_can_use_lcd_text = true; | 1811 bool subtree_can_use_lcd_text = true; |
| 1828 if (!globals.layers_always_allowed_lcd_text) { | 1812 if (!globals.layers_always_allowed_lcd_text) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 layer_draw_properties.target_space_transform_is_animating = | 1911 layer_draw_properties.target_space_transform_is_animating = |
| 1928 animating_transform_to_target; | 1912 animating_transform_to_target; |
| 1929 layer_draw_properties.screen_space_transform_is_animating = | 1913 layer_draw_properties.screen_space_transform_is_animating = |
| 1930 animating_transform_to_screen; | 1914 animating_transform_to_screen; |
| 1931 | 1915 |
| 1932 // Update the aggregate hierarchy matrix to include the transform of the | 1916 // Update the aggregate hierarchy matrix to include the transform of the |
| 1933 // newly created RenderSurfaceImpl. | 1917 // newly created RenderSurfaceImpl. |
| 1934 data_for_children.full_hierarchy_matrix.PreconcatTransform( | 1918 data_for_children.full_hierarchy_matrix.PreconcatTransform( |
| 1935 render_surface->draw_transform()); | 1919 render_surface->draw_transform()); |
| 1936 | 1920 |
| 1921 // A render surface inherently acts as a flattening point for the content of |
| 1922 // its descendants. |
| 1923 data_for_children.full_hierarchy_matrix.FlattenTo2d(); |
| 1924 |
| 1937 if (layer->mask_layer()) { | 1925 if (layer->mask_layer()) { |
| 1938 DrawProperties<LayerType>& mask_layer_draw_properties = | 1926 DrawProperties<LayerType>& mask_layer_draw_properties = |
| 1939 layer->mask_layer()->draw_properties(); | 1927 layer->mask_layer()->draw_properties(); |
| 1940 mask_layer_draw_properties.render_target = layer; | 1928 mask_layer_draw_properties.render_target = layer; |
| 1941 mask_layer_draw_properties.visible_content_rect = | 1929 mask_layer_draw_properties.visible_content_rect = |
| 1942 gfx::Rect(layer->content_bounds()); | 1930 gfx::Rect(layer->content_bounds()); |
| 1943 } | 1931 } |
| 1944 | 1932 |
| 1945 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) { | 1933 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) { |
| 1946 DrawProperties<LayerType>& replica_mask_draw_properties = | 1934 DrawProperties<LayerType>& replica_mask_draw_properties = |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2205 descendants.push_back(child); | 2193 descendants.push_back(child); |
| 2206 } | 2194 } |
| 2207 | 2195 |
| 2208 child->draw_properties().num_descendants_added = | 2196 child->draw_properties().num_descendants_added = |
| 2209 descendants.size() - | 2197 descendants.size() - |
| 2210 child->draw_properties().index_of_first_descendants_addition; | 2198 child->draw_properties().index_of_first_descendants_addition; |
| 2211 child->draw_properties().num_render_surfaces_added = | 2199 child->draw_properties().num_render_surfaces_added = |
| 2212 render_surface_layer_list->size() - | 2200 render_surface_layer_list->size() - |
| 2213 child->draw_properties() | 2201 child->draw_properties() |
| 2214 .index_of_first_render_surface_layer_list_addition; | 2202 .index_of_first_render_surface_layer_list_addition; |
| 2203 layer_draw_properties.layer_or_descendant_is_drawn |= |
| 2204 child->draw_properties().layer_or_descendant_is_drawn; |
| 2215 } | 2205 } |
| 2216 | 2206 |
| 2217 // Add the unsorted layer list contributions, if necessary. | 2207 // Add the unsorted layer list contributions, if necessary. |
| 2218 if (child_order_changed) { | 2208 if (child_order_changed) { |
| 2219 SortLayerListContributions( | 2209 SortLayerListContributions( |
| 2220 *layer, | 2210 *layer, |
| 2221 GetLayerListForSorting(render_surface_layer_list), | 2211 GetLayerListForSorting(render_surface_layer_list), |
| 2222 render_surface_layer_list_child_sorting_start_index, | 2212 render_surface_layer_list_child_sorting_start_index, |
| 2223 &GetNewRenderSurfacesStartIndexAndCount<LayerType>); | 2213 &GetNewRenderSurfacesStartIndexAndCount<LayerType>); |
| 2224 | 2214 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2358 } | 2348 } |
| 2359 | 2349 |
| 2360 SavePaintPropertiesLayer(layer); | 2350 SavePaintPropertiesLayer(layer); |
| 2361 | 2351 |
| 2362 // If neither this layer nor any of its children were added, early out. | 2352 // If neither this layer nor any of its children were added, early out. |
| 2363 if (sorting_start_index == descendants.size()) { | 2353 if (sorting_start_index == descendants.size()) { |
| 2364 DCHECK(!render_to_separate_surface || IsRootLayer(layer)); | 2354 DCHECK(!render_to_separate_surface || IsRootLayer(layer)); |
| 2365 return; | 2355 return; |
| 2366 } | 2356 } |
| 2367 | 2357 |
| 2368 // If preserves-3d then sort all the descendants in 3D so that they can be | |
| 2369 // drawn from back to front. If the preserves-3d property is also set on the | |
| 2370 // parent then skip the sorting as the parent will sort all the descendants | |
| 2371 // anyway. | |
| 2372 if (globals.layer_sorter && descendants.size() && layer->Is3dSorted() && | |
| 2373 !LayerIsInExisting3DRenderingContext(layer)) { | |
| 2374 SortLayers(descendants.begin() + sorting_start_index, | |
| 2375 descendants.end(), | |
| 2376 globals.layer_sorter); | |
| 2377 } | |
| 2378 | |
| 2379 UpdateAccumulatedSurfaceState<LayerType>( | 2358 UpdateAccumulatedSurfaceState<LayerType>( |
| 2380 layer, local_drawable_content_rect_of_subtree, accumulated_surface_state); | 2359 layer, local_drawable_content_rect_of_subtree, accumulated_surface_state); |
| 2381 | 2360 |
| 2382 if (layer->HasContributingDelegatedRenderPasses()) { | 2361 if (layer->HasContributingDelegatedRenderPasses()) { |
| 2383 layer->render_target()->render_surface()-> | 2362 layer->render_target()->render_surface()-> |
| 2384 AddContributingDelegatedRenderPassLayer(layer); | 2363 AddContributingDelegatedRenderPassLayer(layer); |
| 2385 } | 2364 } |
| 2386 } // NOLINT(readability/fn_size) | 2365 } // NOLINT(readability/fn_size) |
| 2387 | 2366 |
| 2388 template <typename LayerType, typename RenderSurfaceLayerListType> | 2367 template <typename LayerType, typename RenderSurfaceLayerListType> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2406 MathUtil::ComputeTransform2dScaleComponents(inputs.device_transform, 1.f); | 2385 MathUtil::ComputeTransform2dScaleComponents(inputs.device_transform, 1.f); |
| 2407 // Not handling the rare case of different x and y device scale. | 2386 // Not handling the rare case of different x and y device scale. |
| 2408 float device_transform_scale = | 2387 float device_transform_scale = |
| 2409 std::max(device_transform_scale_components.x(), | 2388 std::max(device_transform_scale_components.x(), |
| 2410 device_transform_scale_components.y()); | 2389 device_transform_scale_components.y()); |
| 2411 | 2390 |
| 2412 gfx::Transform scaled_device_transform = inputs.device_transform; | 2391 gfx::Transform scaled_device_transform = inputs.device_transform; |
| 2413 scaled_device_transform.Scale(inputs.device_scale_factor, | 2392 scaled_device_transform.Scale(inputs.device_scale_factor, |
| 2414 inputs.device_scale_factor); | 2393 inputs.device_scale_factor); |
| 2415 | 2394 |
| 2416 globals->layer_sorter = NULL; | |
| 2417 globals->max_texture_size = inputs.max_texture_size; | 2395 globals->max_texture_size = inputs.max_texture_size; |
| 2418 globals->device_scale_factor = | 2396 globals->device_scale_factor = |
| 2419 inputs.device_scale_factor * device_transform_scale; | 2397 inputs.device_scale_factor * device_transform_scale; |
| 2420 globals->page_scale_factor = inputs.page_scale_factor; | 2398 globals->page_scale_factor = inputs.page_scale_factor; |
| 2421 globals->page_scale_application_layer = inputs.page_scale_application_layer; | 2399 globals->page_scale_application_layer = inputs.page_scale_application_layer; |
| 2422 globals->elastic_overscroll = inputs.elastic_overscroll; | 2400 globals->elastic_overscroll = inputs.elastic_overscroll; |
| 2423 globals->elastic_overscroll_application_layer = | 2401 globals->elastic_overscroll_application_layer = |
| 2424 inputs.elastic_overscroll_application_layer; | 2402 inputs.elastic_overscroll_application_layer; |
| 2425 globals->can_render_to_separate_surface = | 2403 globals->can_render_to_separate_surface = |
| 2426 inputs.can_render_to_separate_surface; | 2404 inputs.can_render_to_separate_surface; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2570 DCHECK(inputs->root_layer->render_surface()); | 2548 DCHECK(inputs->root_layer->render_surface()); |
| 2571 } | 2549 } |
| 2572 | 2550 |
| 2573 void LayerTreeHostCommon::CalculateDrawProperties( | 2551 void LayerTreeHostCommon::CalculateDrawProperties( |
| 2574 CalcDrawPropsImplInputs* inputs) { | 2552 CalcDrawPropsImplInputs* inputs) { |
| 2575 LayerImplList dummy_layer_list; | 2553 LayerImplList dummy_layer_list; |
| 2576 SubtreeGlobals<LayerImpl> globals; | 2554 SubtreeGlobals<LayerImpl> globals; |
| 2577 DataForRecursion<LayerImpl> data_for_recursion; | 2555 DataForRecursion<LayerImpl> data_for_recursion; |
| 2578 ProcessCalcDrawPropsInputs(*inputs, &globals, &data_for_recursion); | 2556 ProcessCalcDrawPropsInputs(*inputs, &globals, &data_for_recursion); |
| 2579 | 2557 |
| 2580 LayerSorter layer_sorter; | |
| 2581 globals.layer_sorter = &layer_sorter; | |
| 2582 | |
| 2583 PreCalculateMetaInformationRecursiveData recursive_data; | 2558 PreCalculateMetaInformationRecursiveData recursive_data; |
| 2584 PreCalculateMetaInformation(inputs->root_layer, &recursive_data); | 2559 PreCalculateMetaInformation(inputs->root_layer, &recursive_data); |
| 2585 std::vector<AccumulatedSurfaceState<LayerImpl>> accumulated_surface_state; | 2560 std::vector<AccumulatedSurfaceState<LayerImpl>> accumulated_surface_state; |
| 2586 CalculateDrawPropertiesInternal<LayerImpl>( | 2561 CalculateDrawPropertiesInternal<LayerImpl>( |
| 2587 inputs->root_layer, | 2562 inputs->root_layer, |
| 2588 globals, | 2563 globals, |
| 2589 data_for_recursion, | 2564 data_for_recursion, |
| 2590 inputs->render_surface_layer_list, | 2565 inputs->render_surface_layer_list, |
| 2591 &dummy_layer_list, | 2566 &dummy_layer_list, |
| 2592 &accumulated_surface_state, | 2567 &accumulated_surface_state, |
| 2593 inputs->current_render_surface_layer_list_id); | 2568 inputs->current_render_surface_layer_list_id); |
| 2594 | 2569 |
| 2595 // The dummy layer list should not have been used. | 2570 // The dummy layer list should not have been used. |
| 2596 DCHECK_EQ(0u, dummy_layer_list.size()); | 2571 DCHECK_EQ(0u, dummy_layer_list.size()); |
| 2597 // A root layer render_surface should always exist after | 2572 // A root layer render_surface should always exist after |
| 2598 // CalculateDrawProperties. | 2573 // CalculateDrawProperties. |
| 2599 DCHECK(inputs->root_layer->render_surface()); | 2574 DCHECK(inputs->root_layer->render_surface()); |
| 2600 } | 2575 } |
| 2601 | 2576 |
| 2602 } // namespace cc | 2577 } // namespace cc |
| OLD | NEW |