| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "cc/animation/layer_animation_controller.h" | 9 #include "cc/animation/layer_animation_controller.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 9671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9682 EXPECT_TRANSFORMATION_MATRIX_EQ( | 9682 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 9683 container_layer->draw_properties().screen_space_transform, | 9683 container_layer->draw_properties().screen_space_transform, |
| 9684 fixed_layer->draw_properties().screen_space_transform); | 9684 fixed_layer->draw_properties().screen_space_transform); |
| 9685 EXPECT_VECTOR_EQ( | 9685 EXPECT_VECTOR_EQ( |
| 9686 fixed_layer->draw_properties().screen_space_transform.To2dTranslation(), | 9686 fixed_layer->draw_properties().screen_space_transform.To2dTranslation(), |
| 9687 container_offset); | 9687 container_offset); |
| 9688 EXPECT_VECTOR_EQ(scroll_layer->draw_properties() | 9688 EXPECT_VECTOR_EQ(scroll_layer->draw_properties() |
| 9689 .screen_space_transform.To2dTranslation(), | 9689 .screen_space_transform.To2dTranslation(), |
| 9690 container_offset - rounded_scroll_delta); | 9690 container_offset - rounded_scroll_delta); |
| 9691 } | 9691 } |
| 9692 |
| 9693 // Scale is applied earlier in the tree. |
| 9694 { |
| 9695 container_transform.Scale3d(3.0, 3.0, 1.0); |
| 9696 container_layer->SetTransform(container_transform); |
| 9697 |
| 9698 gfx::Vector2dF scroll_delta(4.1f, 8.1f); |
| 9699 scroll_layer->SetScrollDelta(scroll_delta); |
| 9700 |
| 9701 LayerImplList render_surface_layer_list; |
| 9702 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
| 9703 root.get(), root->bounds(), &render_surface_layer_list); |
| 9704 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 9705 |
| 9706 EXPECT_TRANSFORMATION_MATRIX_EQ( |
| 9707 container_layer->draw_properties().screen_space_transform, |
| 9708 fixed_layer->draw_properties().screen_space_transform); |
| 9709 EXPECT_VECTOR_EQ( |
| 9710 fixed_layer->draw_properties().screen_space_transform.To2dTranslation(), |
| 9711 container_offset); |
| 9712 } |
| 9692 } | 9713 } |
| 9693 | 9714 |
| 9694 } // namespace | 9715 } // namespace |
| 9695 } // namespace cc | 9716 } // namespace cc |
| OLD | NEW |