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 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1747 layer, | 1747 layer, |
1748 globals.can_adjust_raster_scales, | 1748 globals.can_adjust_raster_scales, |
1749 ideal_contents_scale, | 1749 ideal_contents_scale, |
1750 globals.device_scale_factor, | 1750 globals.device_scale_factor, |
1751 data_from_ancestor.in_subtree_of_page_scale_application_layer | 1751 data_from_ancestor.in_subtree_of_page_scale_application_layer |
1752 ? globals.page_scale_factor | 1752 ? globals.page_scale_factor |
1753 : 1.f, | 1753 : 1.f, |
1754 combined_maximum_animation_contents_scale, | 1754 combined_maximum_animation_contents_scale, |
1755 animating_transform_to_screen); | 1755 animating_transform_to_screen); |
1756 | 1756 |
| 1757 layer_draw_properties.ideal_contents_scale = ideal_contents_scale; |
| 1758 layer_draw_properties.maximum_animation_contents_scale = |
| 1759 combined_maximum_animation_contents_scale; |
| 1760 layer_draw_properties.page_scale = |
| 1761 data_from_ancestor.in_subtree_of_page_scale_application_layer |
| 1762 ? globals.page_scale_factor |
| 1763 : 1.f; |
| 1764 |
1757 // The draw_transform that gets computed below is effectively the layer's | 1765 // The draw_transform that gets computed below is effectively the layer's |
1758 // draw_transform, unless the layer itself creates a render_surface. In that | 1766 // draw_transform, unless the layer itself creates a render_surface. In that |
1759 // case, the render_surface re-parents the transforms. | 1767 // case, the render_surface re-parents the transforms. |
1760 layer_draw_properties.target_space_transform = combined_transform; | 1768 layer_draw_properties.target_space_transform = combined_transform; |
1761 // M[draw] = M[parent] * LT * S[layer2content] | 1769 // M[draw] = M[parent] * LT * S[layer2content] |
1762 layer_draw_properties.target_space_transform.Scale( | 1770 layer_draw_properties.target_space_transform.Scale( |
1763 SK_MScalar1 / layer->contents_scale_x(), | 1771 SK_MScalar1 / layer->contents_scale_x(), |
1764 SK_MScalar1 / layer->contents_scale_y()); | 1772 SK_MScalar1 / layer->contents_scale_y()); |
1765 | 1773 |
1766 // The layer's screen_space_transform represents the transform between root | 1774 // The layer's screen_space_transform represents the transform between root |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2637 // At this point, we think the point does hit the touch event handler region | 2645 // At this point, we think the point does hit the touch event handler region |
2638 // on the layer, but we need to walk up the parents to ensure that the layer | 2646 // on the layer, but we need to walk up the parents to ensure that the layer |
2639 // was not clipped in such a way that the hit point actually should not hit | 2647 // was not clipped in such a way that the hit point actually should not hit |
2640 // the layer. | 2648 // the layer. |
2641 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 2649 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
2642 return false; | 2650 return false; |
2643 | 2651 |
2644 return true; | 2652 return true; |
2645 } | 2653 } |
2646 } // namespace cc | 2654 } // namespace cc |
OLD | NEW |