OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/property_tree_builder.h" | 5 #include "cc/trees/property_tree_builder.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 bool in_subtree_of_page_scale_layer; | 49 bool in_subtree_of_page_scale_layer; |
50 bool affected_by_inner_viewport_bounds_delta; | 50 bool affected_by_inner_viewport_bounds_delta; |
51 bool affected_by_outer_viewport_bounds_delta; | 51 bool affected_by_outer_viewport_bounds_delta; |
52 bool should_flatten; | 52 bool should_flatten; |
53 bool is_hidden; | 53 bool is_hidden; |
54 uint32_t main_thread_scrolling_reasons; | 54 uint32_t main_thread_scrolling_reasons; |
55 bool scroll_tree_parent_created_by_uninheritable_criteria; | 55 bool scroll_tree_parent_created_by_uninheritable_criteria; |
56 const gfx::Transform* device_transform; | 56 const gfx::Transform* device_transform; |
57 gfx::Transform compound_transform_since_render_target; | 57 gfx::Transform compound_transform_since_render_target; |
58 bool axis_align_since_render_target; | 58 bool axis_align_since_render_target; |
59 bool not_axis_aligned_since_last_clip; | |
59 SkColor safe_opaque_background_color; | 60 SkColor safe_opaque_background_color; |
60 }; | 61 }; |
61 | 62 |
62 static LayerPositionConstraint PositionConstraint(Layer* layer) { | 63 static LayerPositionConstraint PositionConstraint(Layer* layer) { |
63 return layer->position_constraint(); | 64 return layer->position_constraint(); |
64 } | 65 } |
65 | 66 |
66 static LayerPositionConstraint PositionConstraint(LayerImpl* layer) { | 67 static LayerPositionConstraint PositionConstraint(LayerImpl* layer) { |
67 return layer->test_properties()->position_constraint; | 68 return layer->test_properties()->position_constraint; |
68 } | 69 } |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
884 const bool has_potential_filter_animation = | 885 const bool has_potential_filter_animation = |
885 HasPotentiallyRunningFilterAnimation(layer); | 886 HasPotentiallyRunningFilterAnimation(layer); |
886 const bool has_proxied_opacity = | 887 const bool has_proxied_opacity = |
887 !!(layer->mutable_properties() & MutableProperty::kOpacity); | 888 !!(layer->mutable_properties() & MutableProperty::kOpacity); |
888 const bool should_create_render_surface = ShouldCreateRenderSurface( | 889 const bool should_create_render_surface = ShouldCreateRenderSurface( |
889 layer, data_from_ancestor.compound_transform_since_render_target, | 890 layer, data_from_ancestor.compound_transform_since_render_target, |
890 data_from_ancestor.axis_align_since_render_target); | 891 data_from_ancestor.axis_align_since_render_target); |
891 data_for_children->axis_align_since_render_target &= | 892 data_for_children->axis_align_since_render_target &= |
892 AnimationsPreserveAxisAlignment(layer); | 893 AnimationsPreserveAxisAlignment(layer); |
893 | 894 |
895 bool not_axis_aligned_since_last_clip = | |
896 data_from_ancestor.not_axis_aligned_since_last_clip | |
897 ? true | |
898 : !AnimationsPreserveAxisAlignment(layer) || | |
899 !Transform(layer).Preserves2dAxisAlignment(); | |
chrishtr
2017/05/16 23:36:42
What about transforms that don't have effects?
jaydasika
2017/05/16 23:46:28
The recursion variable not_axis_aligned_since_last
chrishtr
2017/05/17 00:44:49
Oh I see. AddEffectNodeIfNeeded is called uncondit
jaydasika
2017/05/17 21:20:46
The reason I put it here is to avoid duplicating t
| |
900 bool has_non_axis_aligned_clip = | |
901 not_axis_aligned_since_last_clip && LayerClipsSubtree(layer); | |
902 data_for_children->not_axis_aligned_since_last_clip = | |
903 !has_non_axis_aligned_clip; | |
904 | |
894 bool requires_node = is_root || has_transparency || | 905 bool requires_node = is_root || has_transparency || |
895 has_potential_opacity_animation || has_proxied_opacity || | 906 has_potential_opacity_animation || has_proxied_opacity || |
907 has_non_axis_aligned_clip || | |
896 should_create_render_surface; | 908 should_create_render_surface; |
897 | 909 |
898 int parent_id = data_from_ancestor.effect_tree_parent; | 910 int parent_id = data_from_ancestor.effect_tree_parent; |
899 | 911 |
900 if (!requires_node) { | 912 if (!requires_node) { |
901 layer->SetEffectTreeIndex(parent_id); | 913 layer->SetEffectTreeIndex(parent_id); |
902 data_for_children->effect_tree_parent = parent_id; | 914 data_for_children->effect_tree_parent = parent_id; |
903 data_for_children->compound_transform_since_render_target *= | 915 data_for_children->compound_transform_since_render_target *= |
904 Transform(layer); | 916 Transform(layer); |
905 return false; | 917 return false; |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1266 data_for_recursion.is_hidden = false; | 1278 data_for_recursion.is_hidden = false; |
1267 data_for_recursion.main_thread_scrolling_reasons = | 1279 data_for_recursion.main_thread_scrolling_reasons = |
1268 MainThreadScrollingReason::kNotScrollingOnMain; | 1280 MainThreadScrollingReason::kNotScrollingOnMain; |
1269 data_for_recursion.scroll_tree_parent_created_by_uninheritable_criteria = | 1281 data_for_recursion.scroll_tree_parent_created_by_uninheritable_criteria = |
1270 true; | 1282 true; |
1271 data_for_recursion.device_transform = &device_transform; | 1283 data_for_recursion.device_transform = &device_transform; |
1272 | 1284 |
1273 data_for_recursion.property_trees->clear(); | 1285 data_for_recursion.property_trees->clear(); |
1274 data_for_recursion.compound_transform_since_render_target = gfx::Transform(); | 1286 data_for_recursion.compound_transform_since_render_target = gfx::Transform(); |
1275 data_for_recursion.axis_align_since_render_target = true; | 1287 data_for_recursion.axis_align_since_render_target = true; |
1288 data_for_recursion.not_axis_aligned_since_last_clip = false; | |
1276 data_for_recursion.property_trees->transform_tree.set_device_scale_factor( | 1289 data_for_recursion.property_trees->transform_tree.set_device_scale_factor( |
1277 device_scale_factor); | 1290 device_scale_factor); |
1278 data_for_recursion.safe_opaque_background_color = color; | 1291 data_for_recursion.safe_opaque_background_color = color; |
1279 | 1292 |
1280 ClipNode root_clip; | 1293 ClipNode root_clip; |
1281 root_clip.clip_type = ClipNode::ClipType::APPLIES_LOCAL_CLIP; | 1294 root_clip.clip_type = ClipNode::ClipType::APPLIES_LOCAL_CLIP; |
1282 root_clip.clip = gfx::RectF(viewport); | 1295 root_clip.clip = gfx::RectF(viewport); |
1283 root_clip.transform_id = TransformTree::kRootNodeId; | 1296 root_clip.transform_id = TransformTree::kRootNodeId; |
1284 data_for_recursion.clip_tree_parent = | 1297 data_for_recursion.clip_tree_parent = |
1285 data_for_recursion.property_trees->clip_tree.Insert( | 1298 data_for_recursion.property_trees->clip_tree.Insert( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1379 root_layer, page_scale_layer, inner_viewport_scroll_layer, | 1392 root_layer, page_scale_layer, inner_viewport_scroll_layer, |
1380 outer_viewport_scroll_layer, overscroll_elasticity_layer, | 1393 outer_viewport_scroll_layer, overscroll_elasticity_layer, |
1381 elastic_overscroll, page_scale_factor, device_scale_factor, viewport, | 1394 elastic_overscroll, page_scale_factor, device_scale_factor, viewport, |
1382 device_transform, property_trees, color); | 1395 device_transform, property_trees, color); |
1383 property_trees->effect_tree.CreateOrReuseRenderSurfaces( | 1396 property_trees->effect_tree.CreateOrReuseRenderSurfaces( |
1384 &render_surfaces, root_layer->layer_tree_impl()); | 1397 &render_surfaces, root_layer->layer_tree_impl()); |
1385 property_trees->ResetCachedData(); | 1398 property_trees->ResetCachedData(); |
1386 } | 1399 } |
1387 | 1400 |
1388 } // namespace cc | 1401 } // namespace cc |
OLD | NEW |