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 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1162 data_from_ancestor.in_subtree_of_page_scale_application_layer ? | 1162 data_from_ancestor.in_subtree_of_page_scale_application_layer ? |
1163 globals.page_scale_factor : 1.f, | 1163 globals.page_scale_factor : 1.f, |
1164 animating_transform_to_screen); | 1164 animating_transform_to_screen); |
1165 | 1165 |
1166 // The draw_transform that gets computed below is effectively the layer's | 1166 // The draw_transform that gets computed below is effectively the layer's |
1167 // draw_transform, unless the layer itself creates a render_surface. In that | 1167 // draw_transform, unless the layer itself creates a render_surface. In that |
1168 // case, the render_surface re-parents the transforms. | 1168 // case, the render_surface re-parents the transforms. |
1169 layer_draw_properties.target_space_transform = combined_transform; | 1169 layer_draw_properties.target_space_transform = combined_transform; |
1170 // M[draw] = M[parent] * LT * S[layer2content] | 1170 // M[draw] = M[parent] * LT * S[layer2content] |
1171 layer_draw_properties.target_space_transform.Scale | 1171 layer_draw_properties.target_space_transform.Scale |
1172 (1.f / layer->contents_scale_x(), 1.f / layer->contents_scale_y()); | 1172 (1.0 / layer->contents_scale_x(), 1.0 / layer->contents_scale_y()); |
danakj
2013/08/27 02:28:49
The input to this function is a double (at the mom
| |
1173 | 1173 |
1174 // The layer's screen_space_transform represents the transform between root | 1174 // The layer's screen_space_transform represents the transform between root |
1175 // layer's "screen space" and local content space. | 1175 // layer's "screen space" and local content space. |
1176 layer_draw_properties.screen_space_transform = | 1176 layer_draw_properties.screen_space_transform = |
1177 data_from_ancestor.full_hierarchy_matrix; | 1177 data_from_ancestor.full_hierarchy_matrix; |
1178 if (!layer->preserves_3d()) | 1178 if (!layer->preserves_3d()) |
1179 layer_draw_properties.screen_space_transform.FlattenTo2d(); | 1179 layer_draw_properties.screen_space_transform.FlattenTo2d(); |
1180 layer_draw_properties.screen_space_transform.PreconcatTransform | 1180 layer_draw_properties.screen_space_transform.PreconcatTransform |
1181 (layer_draw_properties.target_space_transform); | 1181 (layer_draw_properties.target_space_transform); |
1182 | 1182 |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1950 // At this point, we think the point does hit the touch event handler region | 1950 // At this point, we think the point does hit the touch event handler region |
1951 // on the layer, but we need to walk up the parents to ensure that the layer | 1951 // on the layer, but we need to walk up the parents to ensure that the layer |
1952 // was not clipped in such a way that the hit point actually should not hit | 1952 // was not clipped in such a way that the hit point actually should not hit |
1953 // the layer. | 1953 // the layer. |
1954 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 1954 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
1955 return false; | 1955 return false; |
1956 | 1956 |
1957 return true; | 1957 return true; |
1958 } | 1958 } |
1959 } // namespace cc | 1959 } // namespace cc |
OLD | NEW |