| 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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 bool animating_transform_to_screen = animating_transform_to_target; | 1031 bool animating_transform_to_screen = animating_transform_to_target; |
| 1032 if (layer->parent()) { | 1032 if (layer->parent()) { |
| 1033 animating_transform_to_target |= | 1033 animating_transform_to_target |= |
| 1034 layer->parent()->draw_transform_is_animating(); | 1034 layer->parent()->draw_transform_is_animating(); |
| 1035 animating_transform_to_screen |= | 1035 animating_transform_to_screen |= |
| 1036 layer->parent()->screen_space_transform_is_animating(); | 1036 layer->parent()->screen_space_transform_is_animating(); |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 gfx::Size bounds = layer->bounds(); | 1039 gfx::Size bounds = layer->bounds(); |
| 1040 gfx::PointF anchor_point = layer->anchor_point(); | 1040 gfx::PointF anchor_point = layer->anchor_point(); |
| 1041 gfx::PointF position = layer->position() - layer->ScrollDelta(); | 1041 gfx::PointF position = layer->position() - layer->TotalScrollOffset(); |
| 1042 | 1042 |
| 1043 gfx::Transform combined_transform = parent_matrix; | 1043 gfx::Transform combined_transform = parent_matrix; |
| 1044 if (!layer->transform().IsIdentity()) { | 1044 if (!layer->transform().IsIdentity()) { |
| 1045 // LT = Tr[origin] * Tr[origin2anchor] | 1045 // LT = Tr[origin] * Tr[origin2anchor] |
| 1046 combined_transform.Translate3d( | 1046 combined_transform.Translate3d( |
| 1047 position.x() + anchor_point.x() * bounds.width(), | 1047 position.x() + anchor_point.x() * bounds.width(), |
| 1048 position.y() + anchor_point.y() * bounds.height(), | 1048 position.y() + anchor_point.y() * bounds.height(), |
| 1049 layer->anchor_point_z()); | 1049 layer->anchor_point_z()); |
| 1050 // LT = Tr[origin] * Tr[origin2anchor] * M[layer] | 1050 // LT = Tr[origin] * Tr[origin2anchor] * M[layer] |
| 1051 combined_transform.PreconcatTransform(layer->transform()); | 1051 combined_transform.PreconcatTransform(layer->transform()); |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 // At this point, we think the point does hit the touch event handler region | 1889 // At this point, we think the point does hit the touch event handler region |
| 1890 // on the layer, but we need to walk up the parents to ensure that the layer | 1890 // on the layer, but we need to walk up the parents to ensure that the layer |
| 1891 // was not clipped in such a way that the hit point actually should not hit | 1891 // was not clipped in such a way that the hit point actually should not hit |
| 1892 // the layer. | 1892 // the layer. |
| 1893 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 1893 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
| 1894 return false; | 1894 return false; |
| 1895 | 1895 |
| 1896 return true; | 1896 return true; |
| 1897 } | 1897 } |
| 1898 } // namespace cc | 1898 } // namespace cc |
| OLD | NEW |