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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
900 } | 900 } |
901 | 901 |
902 return next_scroll_compensation_matrix; | 902 return next_scroll_compensation_matrix; |
903 } | 903 } |
904 | 904 |
905 template <typename LayerType> | 905 template <typename LayerType> |
906 static inline void CalculateContentsScale(LayerType* layer, | 906 static inline void CalculateContentsScale(LayerType* layer, |
907 float contents_scale, | 907 float contents_scale, |
908 float device_scale_factor, | 908 float device_scale_factor, |
909 float page_scale_factor, | 909 float page_scale_factor, |
910 float maximum_animation_scale_factor, | |
910 bool animating_transform_to_screen) { | 911 bool animating_transform_to_screen) { |
911 layer->CalculateContentsScale(contents_scale, | 912 layer->CalculateContentsScale(contents_scale, |
912 device_scale_factor, | 913 device_scale_factor, |
913 page_scale_factor, | 914 page_scale_factor, |
915 maximum_animation_scale_factor, | |
914 animating_transform_to_screen, | 916 animating_transform_to_screen, |
915 &layer->draw_properties().contents_scale_x, | 917 &layer->draw_properties().contents_scale_x, |
916 &layer->draw_properties().contents_scale_y, | 918 &layer->draw_properties().contents_scale_y, |
917 &layer->draw_properties().content_bounds); | 919 &layer->draw_properties().content_bounds); |
918 | 920 |
919 LayerType* mask_layer = layer->mask_layer(); | 921 LayerType* mask_layer = layer->mask_layer(); |
920 if (mask_layer) { | 922 if (mask_layer) { |
921 mask_layer->CalculateContentsScale( | 923 mask_layer->CalculateContentsScale( |
922 contents_scale, | 924 contents_scale, |
923 device_scale_factor, | 925 device_scale_factor, |
924 page_scale_factor, | 926 page_scale_factor, |
927 maximum_animation_scale_factor, | |
925 animating_transform_to_screen, | 928 animating_transform_to_screen, |
926 &mask_layer->draw_properties().contents_scale_x, | 929 &mask_layer->draw_properties().contents_scale_x, |
927 &mask_layer->draw_properties().contents_scale_y, | 930 &mask_layer->draw_properties().contents_scale_y, |
928 &mask_layer->draw_properties().content_bounds); | 931 &mask_layer->draw_properties().content_bounds); |
929 } | 932 } |
930 | 933 |
931 LayerType* replica_mask_layer = | 934 LayerType* replica_mask_layer = |
932 layer->replica_layer() ? layer->replica_layer()->mask_layer() : NULL; | 935 layer->replica_layer() ? layer->replica_layer()->mask_layer() : NULL; |
933 if (replica_mask_layer) { | 936 if (replica_mask_layer) { |
934 replica_mask_layer->CalculateContentsScale( | 937 replica_mask_layer->CalculateContentsScale( |
935 contents_scale, | 938 contents_scale, |
936 device_scale_factor, | 939 device_scale_factor, |
937 page_scale_factor, | 940 page_scale_factor, |
941 maximum_animation_scale_factor, | |
938 animating_transform_to_screen, | 942 animating_transform_to_screen, |
939 &replica_mask_layer->draw_properties().contents_scale_x, | 943 &replica_mask_layer->draw_properties().contents_scale_x, |
940 &replica_mask_layer->draw_properties().contents_scale_y, | 944 &replica_mask_layer->draw_properties().contents_scale_y, |
941 &replica_mask_layer->draw_properties().content_bounds); | 945 &replica_mask_layer->draw_properties().content_bounds); |
942 } | 946 } |
943 } | 947 } |
944 | 948 |
945 static inline void UpdateLayerContentsScale( | 949 static inline void UpdateLayerContentsScale( |
946 LayerImpl* layer, | 950 LayerImpl* layer, |
947 bool can_adjust_raster_scale, | 951 bool can_adjust_raster_scale, |
948 float ideal_contents_scale, | 952 float ideal_contents_scale, |
949 float device_scale_factor, | 953 float device_scale_factor, |
950 float page_scale_factor, | 954 float page_scale_factor, |
955 float maximum_animation_scale_factor, | |
951 bool animating_transform_to_screen) { | 956 bool animating_transform_to_screen) { |
952 CalculateContentsScale(layer, | 957 CalculateContentsScale(layer, |
953 ideal_contents_scale, | 958 ideal_contents_scale, |
954 device_scale_factor, | 959 device_scale_factor, |
955 page_scale_factor, | 960 page_scale_factor, |
961 maximum_animation_scale_factor, | |
956 animating_transform_to_screen); | 962 animating_transform_to_screen); |
957 } | 963 } |
958 | 964 |
959 static inline void UpdateLayerContentsScale( | 965 static inline void UpdateLayerContentsScale( |
960 Layer* layer, | 966 Layer* layer, |
961 bool can_adjust_raster_scale, | 967 bool can_adjust_raster_scale, |
962 float ideal_contents_scale, | 968 float ideal_contents_scale, |
963 float device_scale_factor, | 969 float device_scale_factor, |
964 float page_scale_factor, | 970 float page_scale_factor, |
971 float maximum_animation_scale_factor, | |
965 bool animating_transform_to_screen) { | 972 bool animating_transform_to_screen) { |
966 if (can_adjust_raster_scale) { | 973 if (can_adjust_raster_scale) { |
967 float ideal_raster_scale = | 974 float ideal_raster_scale = |
968 ideal_contents_scale / (device_scale_factor * page_scale_factor); | 975 ideal_contents_scale / (device_scale_factor * page_scale_factor); |
969 | 976 |
970 bool need_to_set_raster_scale = layer->raster_scale_is_unknown(); | 977 bool need_to_set_raster_scale = layer->raster_scale_is_unknown(); |
971 | 978 |
972 // If we've previously saved a raster_scale but the ideal changes, things | 979 // If we've previously saved a raster_scale but the ideal changes, things |
973 // are unpredictable and we should just use 1. | 980 // are unpredictable and we should just use 1. |
974 if (!need_to_set_raster_scale && layer->raster_scale() != 1.f && | 981 if (!need_to_set_raster_scale && layer->raster_scale() != 1.f && |
(...skipping 16 matching lines...) Expand all Loading... | |
991 | 998 |
992 gfx::Size old_content_bounds = layer->content_bounds(); | 999 gfx::Size old_content_bounds = layer->content_bounds(); |
993 float old_contents_scale_x = layer->contents_scale_x(); | 1000 float old_contents_scale_x = layer->contents_scale_x(); |
994 float old_contents_scale_y = layer->contents_scale_y(); | 1001 float old_contents_scale_y = layer->contents_scale_y(); |
995 | 1002 |
996 float contents_scale = raster_scale * device_scale_factor * page_scale_factor; | 1003 float contents_scale = raster_scale * device_scale_factor * page_scale_factor; |
997 CalculateContentsScale(layer, | 1004 CalculateContentsScale(layer, |
998 contents_scale, | 1005 contents_scale, |
999 device_scale_factor, | 1006 device_scale_factor, |
1000 page_scale_factor, | 1007 page_scale_factor, |
1008 maximum_animation_scale_factor, | |
1001 animating_transform_to_screen); | 1009 animating_transform_to_screen); |
1002 | 1010 |
1003 if (layer->content_bounds() != old_content_bounds || | 1011 if (layer->content_bounds() != old_content_bounds || |
1004 layer->contents_scale_x() != old_contents_scale_x || | 1012 layer->contents_scale_x() != old_contents_scale_x || |
1005 layer->contents_scale_y() != old_contents_scale_y) | 1013 layer->contents_scale_y() != old_contents_scale_y) |
1006 layer->SetNeedsPushProperties(); | 1014 layer->SetNeedsPushProperties(); |
1007 } | 1015 } |
1008 | 1016 |
1017 static inline void CalculateAnimationScaleFactor( | |
1018 Layer* layer, | |
1019 bool ancestor_is_animating_scale, | |
1020 float ancestor_maximum_animation_scale_factor, | |
1021 const gfx::Transform& parent_transform, | |
1022 const gfx::Transform& combined_transform, | |
1023 bool* combined_is_animating_scale, | |
1024 float* combined_maximum_animation_scale_factor) { | |
1025 *combined_is_animating_scale = false; | |
1026 *combined_maximum_animation_scale_factor = 0.f; | |
1027 } | |
1028 | |
1029 static inline void CalculateAnimationScaleFactor( | |
1030 LayerImpl* layer, | |
1031 bool ancestor_is_animating_scale, | |
1032 float ancestor_maximum_animation_scale_factor, | |
1033 const gfx::Transform& ancestor_transform, | |
1034 const gfx::Transform& combined_transform, | |
1035 bool* combined_is_animating_scale, | |
1036 float* combined_maximum_animation_scale_factor) { | |
1037 if (ancestor_is_animating_scale && | |
1038 ancestor_maximum_animation_scale_factor == 0.f) { | |
1039 // We've already failed to compute a maximum animated scale at an | |
1040 // ancestor, so we'll continue to fail. | |
1041 *combined_maximum_animation_scale_factor = 0.f; | |
1042 *combined_is_animating_scale = true; | |
1043 return; | |
1044 } | |
1045 | |
1046 if (!combined_transform.IsScaleOrTranslation()) { | |
1047 // Computing maximum animated scale in the presence of | |
1048 // non-scale/translation transforms isn't supported. | |
1049 *combined_maximum_animation_scale_factor = 0.f; | |
1050 *combined_is_animating_scale = true; | |
1051 return; | |
1052 } | |
1053 | |
1054 bool layer_is_animating_scale = | |
1055 !layer->layer_animation_controller()->HasOnlyTranslationTransforms(); | |
enne (OOO)
2014/04/08 19:18:47
This is a weird bit of logic to read. Couldn't a
ajuma
2014/04/08 20:30:40
I've added a comment to clarify this.
| |
1056 | |
1057 if (!layer_is_animating_scale && !ancestor_is_animating_scale) { | |
1058 *combined_maximum_animation_scale_factor = 0.f; | |
1059 *combined_is_animating_scale = false; | |
1060 return; | |
1061 } | |
1062 | |
1063 // We don't attempt to accumulate animation scale factors from multiple nodes, | |
1064 // because of the risk of significant overestimation. For example, one node | |
1065 // may be increasing scale from 1 to 10 at the same time as a descendant is | |
1066 // decreasing scale from 10 to 1. Naively combining these scales would produce | |
1067 // a scale of 100. | |
1068 if (layer_is_animating_scale && ancestor_is_animating_scale) { | |
1069 *combined_maximum_animation_scale_factor = 0.f; | |
1070 *combined_is_animating_scale = true; | |
1071 return; | |
1072 } | |
1073 | |
1074 // At this point, we know either the layer or an ancestor, but not both, | |
1075 // is animating scale. | |
1076 *combined_is_animating_scale = true; | |
1077 if (!layer_is_animating_scale) { | |
1078 gfx::Vector2dF layer_transform_scales = | |
1079 MathUtil::ComputeTransform2dScaleComponents(layer->transform(), 0.f); | |
1080 *combined_maximum_animation_scale_factor = | |
1081 ancestor_maximum_animation_scale_factor * | |
1082 std::max(layer_transform_scales.x(), layer_transform_scales.y()); | |
1083 return; | |
1084 } | |
1085 | |
1086 float layer_maximum_animated_scale = 0.f; | |
1087 if (!layer->layer_animation_controller()->MaximumScale( | |
1088 &layer_maximum_animated_scale)) { | |
1089 *combined_maximum_animation_scale_factor = 0.f; | |
1090 return; | |
1091 } | |
1092 gfx::Vector2dF ancestor_transform_scales = | |
1093 MathUtil::ComputeTransform2dScaleComponents(ancestor_transform, 0.f); | |
1094 *combined_maximum_animation_scale_factor = | |
1095 layer_maximum_animated_scale * | |
1096 std::max(ancestor_transform_scales.x(), ancestor_transform_scales.y()); | |
1097 } | |
1098 | |
1009 static inline RenderSurface* CreateOrReuseRenderSurface(Layer* layer) { | 1099 static inline RenderSurface* CreateOrReuseRenderSurface(Layer* layer) { |
1010 // The render surface should always be new on the main thread, as the | 1100 // The render surface should always be new on the main thread, as the |
1011 // RenderSurfaceLayerList should be a new empty list when given to | 1101 // RenderSurfaceLayerList should be a new empty list when given to |
1012 // CalculateDrawProperties. | 1102 // CalculateDrawProperties. |
1013 DCHECK(!layer->render_surface()); | 1103 DCHECK(!layer->render_surface()); |
1014 layer->CreateRenderSurface(); | 1104 layer->CreateRenderSurface(); |
1015 return layer->render_surface(); | 1105 return layer->render_surface(); |
1016 } | 1106 } |
1017 | 1107 |
1018 static inline RenderSurfaceImpl* CreateOrReuseRenderSurface(LayerImpl* layer) { | 1108 static inline RenderSurfaceImpl* CreateOrReuseRenderSurface(LayerImpl* layer) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1158 // When the layer's children want to compute their visible content rect, they | 1248 // When the layer's children want to compute their visible content rect, they |
1159 // want to know what their target surface's clip rect will be. BUT - they | 1249 // want to know what their target surface's clip rect will be. BUT - they |
1160 // want to know this clip rect represented in their own target space. This | 1250 // want to know this clip rect represented in their own target space. This |
1161 // requires inverse-projecting the surface's clip rect from the surface's | 1251 // requires inverse-projecting the surface's clip rect from the surface's |
1162 // render target space down to the surface's own space. Instead of computing | 1252 // render target space down to the surface's own space. Instead of computing |
1163 // this value redundantly for each child layer, it is computed only once | 1253 // this value redundantly for each child layer, it is computed only once |
1164 // while dealing with the parent layer, and then this precomputed value is | 1254 // while dealing with the parent layer, and then this precomputed value is |
1165 // passed down the recursion to the children that actually use it. | 1255 // passed down the recursion to the children that actually use it. |
1166 gfx::Rect clip_rect_of_target_surface_in_target_space; | 1256 gfx::Rect clip_rect_of_target_surface_in_target_space; |
1167 | 1257 |
1258 // The maximum amount by which this layer will be scaled during the lifetime | |
1259 // of currently running animations. | |
1260 float maximum_animation_scale_factor; | |
1261 | |
1262 bool ancestor_is_animating_scale; | |
1168 bool ancestor_clips_subtree; | 1263 bool ancestor_clips_subtree; |
1169 typename LayerType::RenderSurfaceType* | 1264 typename LayerType::RenderSurfaceType* |
1170 nearest_occlusion_immune_ancestor_surface; | 1265 nearest_occlusion_immune_ancestor_surface; |
1171 bool in_subtree_of_page_scale_application_layer; | 1266 bool in_subtree_of_page_scale_application_layer; |
1172 bool subtree_can_use_lcd_text; | 1267 bool subtree_can_use_lcd_text; |
1173 bool subtree_is_visible_from_ancestor; | 1268 bool subtree_is_visible_from_ancestor; |
1174 }; | 1269 }; |
1175 | 1270 |
1176 template <typename LayerType> | 1271 template <typename LayerType> |
1177 static LayerType* GetChildContainingLayer(const LayerType& parent, | 1272 static LayerType* GetChildContainingLayer(const LayerType& parent, |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1539 effective_scroll_delta -= | 1634 effective_scroll_delta -= |
1540 gfx::ScaleVector2d(current_translation - previous_translation, | 1635 gfx::ScaleVector2d(current_translation - previous_translation, |
1541 1.f / parent_scales.x(), | 1636 1.f / parent_scales.x(), |
1542 1.f / parent_scales.y()); | 1637 1.f / parent_scales.y()); |
1543 } | 1638 } |
1544 | 1639 |
1545 // Apply adjustment from position constraints. | 1640 // Apply adjustment from position constraints. |
1546 ApplyPositionAdjustment(layer, data_from_ancestor.fixed_container, | 1641 ApplyPositionAdjustment(layer, data_from_ancestor.fixed_container, |
1547 data_from_ancestor.scroll_compensation_matrix, &combined_transform); | 1642 data_from_ancestor.scroll_compensation_matrix, &combined_transform); |
1548 | 1643 |
1644 bool combined_is_animating_scale = false; | |
1645 float combined_maximum_animation_scale_factor = 0.f; | |
1646 if (globals.can_adjust_raster_scales) { | |
1647 CalculateAnimationScaleFactor( | |
1648 layer, | |
1649 data_from_ancestor.ancestor_is_animating_scale, | |
1650 data_from_ancestor.maximum_animation_scale_factor, | |
1651 data_from_ancestor.parent_matrix, | |
1652 combined_transform, | |
1653 &combined_is_animating_scale, | |
1654 &combined_maximum_animation_scale_factor); | |
1655 } | |
1656 data_for_children.ancestor_is_animating_scale = combined_is_animating_scale; | |
1657 data_for_children.maximum_animation_scale_factor = | |
1658 combined_maximum_animation_scale_factor; | |
1659 | |
1549 // Compute the 2d scale components of the transform hierarchy up to the target | 1660 // Compute the 2d scale components of the transform hierarchy up to the target |
1550 // surface. From there, we can decide on a contents scale for the layer. | 1661 // surface. From there, we can decide on a contents scale for the layer. |
1551 float layer_scale_factors = globals.device_scale_factor; | 1662 float layer_scale_factors = globals.device_scale_factor; |
1552 if (data_from_ancestor.in_subtree_of_page_scale_application_layer) | 1663 if (data_from_ancestor.in_subtree_of_page_scale_application_layer) |
1553 layer_scale_factors *= globals.page_scale_factor; | 1664 layer_scale_factors *= globals.page_scale_factor; |
1554 gfx::Vector2dF combined_transform_scales = | 1665 gfx::Vector2dF combined_transform_scales = |
1555 MathUtil::ComputeTransform2dScaleComponents( | 1666 MathUtil::ComputeTransform2dScaleComponents( |
1556 combined_transform, | 1667 combined_transform, |
1557 layer_scale_factors); | 1668 layer_scale_factors); |
1558 | 1669 |
1559 float ideal_contents_scale = | 1670 float ideal_contents_scale = |
1560 globals.can_adjust_raster_scales | 1671 globals.can_adjust_raster_scales |
1561 ? std::max(combined_transform_scales.x(), | 1672 ? std::max(combined_transform_scales.x(), |
1562 combined_transform_scales.y()) | 1673 combined_transform_scales.y()) |
1563 : layer_scale_factors; | 1674 : layer_scale_factors; |
1564 UpdateLayerContentsScale( | 1675 UpdateLayerContentsScale( |
1565 layer, | 1676 layer, |
1566 globals.can_adjust_raster_scales, | 1677 globals.can_adjust_raster_scales, |
1567 ideal_contents_scale, | 1678 ideal_contents_scale, |
1568 globals.device_scale_factor, | 1679 globals.device_scale_factor, |
1569 data_from_ancestor.in_subtree_of_page_scale_application_layer ? | 1680 data_from_ancestor.in_subtree_of_page_scale_application_layer |
1570 globals.page_scale_factor : 1.f, | 1681 ? globals.page_scale_factor |
1682 : 1.f, | |
1683 combined_maximum_animation_scale_factor, | |
1571 animating_transform_to_screen); | 1684 animating_transform_to_screen); |
1572 | 1685 |
1573 // The draw_transform that gets computed below is effectively the layer's | 1686 // The draw_transform that gets computed below is effectively the layer's |
1574 // draw_transform, unless the layer itself creates a render_surface. In that | 1687 // draw_transform, unless the layer itself creates a render_surface. In that |
1575 // case, the render_surface re-parents the transforms. | 1688 // case, the render_surface re-parents the transforms. |
1576 layer_draw_properties.target_space_transform = combined_transform; | 1689 layer_draw_properties.target_space_transform = combined_transform; |
1577 // M[draw] = M[parent] * LT * S[layer2content] | 1690 // M[draw] = M[parent] * LT * S[layer2content] |
1578 layer_draw_properties.target_space_transform.Scale( | 1691 layer_draw_properties.target_space_transform.Scale( |
1579 SK_MScalar1 / layer->contents_scale_x(), | 1692 SK_MScalar1 / layer->contents_scale_x(), |
1580 SK_MScalar1 / layer->contents_scale_y()); | 1693 SK_MScalar1 / layer->contents_scale_y()); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2148 globals.can_adjust_raster_scales = inputs->can_adjust_raster_scales; | 2261 globals.can_adjust_raster_scales = inputs->can_adjust_raster_scales; |
2149 | 2262 |
2150 DataForRecursion<Layer> data_for_recursion; | 2263 DataForRecursion<Layer> data_for_recursion; |
2151 data_for_recursion.parent_matrix = scaled_device_transform; | 2264 data_for_recursion.parent_matrix = scaled_device_transform; |
2152 data_for_recursion.full_hierarchy_matrix = identity_matrix; | 2265 data_for_recursion.full_hierarchy_matrix = identity_matrix; |
2153 data_for_recursion.scroll_compensation_matrix = identity_matrix; | 2266 data_for_recursion.scroll_compensation_matrix = identity_matrix; |
2154 data_for_recursion.fixed_container = inputs->root_layer; | 2267 data_for_recursion.fixed_container = inputs->root_layer; |
2155 data_for_recursion.clip_rect_in_target_space = device_viewport_rect; | 2268 data_for_recursion.clip_rect_in_target_space = device_viewport_rect; |
2156 data_for_recursion.clip_rect_of_target_surface_in_target_space = | 2269 data_for_recursion.clip_rect_of_target_surface_in_target_space = |
2157 device_viewport_rect; | 2270 device_viewport_rect; |
2271 data_for_recursion.maximum_animation_scale_factor = 1.f; | |
2272 data_for_recursion.ancestor_is_animating_scale = false; | |
2158 data_for_recursion.ancestor_clips_subtree = true; | 2273 data_for_recursion.ancestor_clips_subtree = true; |
2159 data_for_recursion.nearest_occlusion_immune_ancestor_surface = NULL; | 2274 data_for_recursion.nearest_occlusion_immune_ancestor_surface = NULL; |
2160 data_for_recursion.in_subtree_of_page_scale_application_layer = false; | 2275 data_for_recursion.in_subtree_of_page_scale_application_layer = false; |
2161 data_for_recursion.subtree_can_use_lcd_text = inputs->can_use_lcd_text; | 2276 data_for_recursion.subtree_can_use_lcd_text = inputs->can_use_lcd_text; |
2162 data_for_recursion.subtree_is_visible_from_ancestor = true; | 2277 data_for_recursion.subtree_is_visible_from_ancestor = true; |
2163 | 2278 |
2164 PreCalculateMetaInformationRecursiveData recursive_data; | 2279 PreCalculateMetaInformationRecursiveData recursive_data; |
2165 PreCalculateMetaInformation(inputs->root_layer, &recursive_data); | 2280 PreCalculateMetaInformation(inputs->root_layer, &recursive_data); |
2166 std::vector<AccumulatedSurfaceState<Layer> > accumulated_surface_state; | 2281 std::vector<AccumulatedSurfaceState<Layer> > accumulated_surface_state; |
2167 CalculateDrawPropertiesInternal<Layer>(inputs->root_layer, | 2282 CalculateDrawPropertiesInternal<Layer>(inputs->root_layer, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2206 globals.can_adjust_raster_scales = inputs->can_adjust_raster_scales; | 2321 globals.can_adjust_raster_scales = inputs->can_adjust_raster_scales; |
2207 | 2322 |
2208 DataForRecursion<LayerImpl> data_for_recursion; | 2323 DataForRecursion<LayerImpl> data_for_recursion; |
2209 data_for_recursion.parent_matrix = scaled_device_transform; | 2324 data_for_recursion.parent_matrix = scaled_device_transform; |
2210 data_for_recursion.full_hierarchy_matrix = identity_matrix; | 2325 data_for_recursion.full_hierarchy_matrix = identity_matrix; |
2211 data_for_recursion.scroll_compensation_matrix = identity_matrix; | 2326 data_for_recursion.scroll_compensation_matrix = identity_matrix; |
2212 data_for_recursion.fixed_container = inputs->root_layer; | 2327 data_for_recursion.fixed_container = inputs->root_layer; |
2213 data_for_recursion.clip_rect_in_target_space = device_viewport_rect; | 2328 data_for_recursion.clip_rect_in_target_space = device_viewport_rect; |
2214 data_for_recursion.clip_rect_of_target_surface_in_target_space = | 2329 data_for_recursion.clip_rect_of_target_surface_in_target_space = |
2215 device_viewport_rect; | 2330 device_viewport_rect; |
2331 data_for_recursion.maximum_animation_scale_factor = 1.f; | |
2332 data_for_recursion.ancestor_is_animating_scale = false; | |
2216 data_for_recursion.ancestor_clips_subtree = true; | 2333 data_for_recursion.ancestor_clips_subtree = true; |
2217 data_for_recursion.nearest_occlusion_immune_ancestor_surface = NULL; | 2334 data_for_recursion.nearest_occlusion_immune_ancestor_surface = NULL; |
2218 data_for_recursion.in_subtree_of_page_scale_application_layer = false; | 2335 data_for_recursion.in_subtree_of_page_scale_application_layer = false; |
2219 data_for_recursion.subtree_can_use_lcd_text = inputs->can_use_lcd_text; | 2336 data_for_recursion.subtree_can_use_lcd_text = inputs->can_use_lcd_text; |
2220 data_for_recursion.subtree_is_visible_from_ancestor = true; | 2337 data_for_recursion.subtree_is_visible_from_ancestor = true; |
2221 | 2338 |
2222 PreCalculateMetaInformationRecursiveData recursive_data; | 2339 PreCalculateMetaInformationRecursiveData recursive_data; |
2223 PreCalculateMetaInformation(inputs->root_layer, &recursive_data); | 2340 PreCalculateMetaInformation(inputs->root_layer, &recursive_data); |
2224 std::vector<AccumulatedSurfaceState<LayerImpl> > | 2341 std::vector<AccumulatedSurfaceState<LayerImpl> > |
2225 accumulated_surface_state; | 2342 accumulated_surface_state; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2406 // At this point, we think the point does hit the touch event handler region | 2523 // At this point, we think the point does hit the touch event handler region |
2407 // on the layer, but we need to walk up the parents to ensure that the layer | 2524 // on the layer, but we need to walk up the parents to ensure that the layer |
2408 // was not clipped in such a way that the hit point actually should not hit | 2525 // was not clipped in such a way that the hit point actually should not hit |
2409 // the layer. | 2526 // the layer. |
2410 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 2527 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
2411 return false; | 2528 return false; |
2412 | 2529 |
2413 return true; | 2530 return true; |
2414 } | 2531 } |
2415 } // namespace cc | 2532 } // namespace cc |
OLD | NEW |