Chromium Code Reviews| 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 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1402 globals.device_scale_factor, | 1402 globals.device_scale_factor, |
| 1403 data_from_ancestor.in_subtree_of_page_scale_application_layer ? | 1403 data_from_ancestor.in_subtree_of_page_scale_application_layer ? |
| 1404 globals.page_scale_factor : 1.f, | 1404 globals.page_scale_factor : 1.f, |
| 1405 animating_transform_to_screen); | 1405 animating_transform_to_screen); |
| 1406 | 1406 |
| 1407 // The draw_transform that gets computed below is effectively the layer's | 1407 // The draw_transform that gets computed below is effectively the layer's |
| 1408 // draw_transform, unless the layer itself creates a render_surface. In that | 1408 // draw_transform, unless the layer itself creates a render_surface. In that |
| 1409 // case, the render_surface re-parents the transforms. | 1409 // case, the render_surface re-parents the transforms. |
| 1410 layer_draw_properties.target_space_transform = combined_transform; | 1410 layer_draw_properties.target_space_transform = combined_transform; |
| 1411 // M[draw] = M[parent] * LT * S[layer2content] | 1411 // M[draw] = M[parent] * LT * S[layer2content] |
| 1412 layer_draw_properties.target_space_transform.Scale | 1412 SkMScalar one(1.0); |
|
danakj
2013/09/07 00:54:59
nit: use SK_MScalar1? or maybe not?
enne (OOO)
2013/09/07 01:25:18
Sure, done.
| |
| 1413 (1.f / layer->contents_scale_x(), 1.f / layer->contents_scale_y()); | 1413 layer_draw_properties.target_space_transform.Scale( |
| 1414 one / layer->contents_scale_x(), one / layer->contents_scale_y()); | |
| 1414 | 1415 |
| 1415 // The layer's screen_space_transform represents the transform between root | 1416 // The layer's screen_space_transform represents the transform between root |
| 1416 // layer's "screen space" and local content space. | 1417 // layer's "screen space" and local content space. |
| 1417 layer_draw_properties.screen_space_transform = | 1418 layer_draw_properties.screen_space_transform = |
| 1418 data_from_ancestor.full_hierarchy_matrix; | 1419 data_from_ancestor.full_hierarchy_matrix; |
| 1419 if (!layer->preserves_3d()) | 1420 if (!layer->preserves_3d()) |
| 1420 layer_draw_properties.screen_space_transform.FlattenTo2d(); | 1421 layer_draw_properties.screen_space_transform.FlattenTo2d(); |
| 1421 layer_draw_properties.screen_space_transform.PreconcatTransform | 1422 layer_draw_properties.screen_space_transform.PreconcatTransform |
| 1422 (layer_draw_properties.target_space_transform); | 1423 (layer_draw_properties.target_space_transform); |
| 1423 | 1424 |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2215 // At this point, we think the point does hit the touch event handler region | 2216 // At this point, we think the point does hit the touch event handler region |
| 2216 // on the layer, but we need to walk up the parents to ensure that the layer | 2217 // on the layer, but we need to walk up the parents to ensure that the layer |
| 2217 // was not clipped in such a way that the hit point actually should not hit | 2218 // was not clipped in such a way that the hit point actually should not hit |
| 2218 // the layer. | 2219 // the layer. |
| 2219 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 2220 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
| 2220 return false; | 2221 return false; |
| 2221 | 2222 |
| 2222 return true; | 2223 return true; |
| 2223 } | 2224 } |
| 2224 } // namespace cc | 2225 } // namespace cc |
| OLD | NEW |