| 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 4723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4734 | 4734 |
| 4735 // The root scroll layer should not have scrolled, because the input delta | 4735 // The root scroll layer should not have scrolled, because the input delta |
| 4736 // was close to the layer's axis of movement. | 4736 // was close to the layer's axis of movement. |
| 4737 EXPECT_EQ(scroll_info->scrolls.size(), 1u); | 4737 EXPECT_EQ(scroll_info->scrolls.size(), 1u); |
| 4738 } | 4738 } |
| 4739 } | 4739 } |
| 4740 | 4740 |
| 4741 TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) { | 4741 TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) { |
| 4742 LayerImpl* scroll_layer = | 4742 LayerImpl* scroll_layer = |
| 4743 SetupScrollAndContentsLayers(gfx::Size(100, 100)); | 4743 SetupScrollAndContentsLayers(gfx::Size(100, 100)); |
| 4744 scroll_layer->SetDrawsContent(true); | |
| 4745 | 4744 |
| 4746 // Scale the layer to twice its normal size. | 4745 // Scale the layer to twice its normal size. |
| 4747 int scale = 2; | 4746 int scale = 2; |
| 4748 gfx::Transform scale_transform; | 4747 gfx::Transform scale_transform; |
| 4749 scale_transform.Scale(scale, scale); | 4748 scale_transform.Scale(scale, scale); |
| 4750 scroll_layer->parent()->SetTransform(scale_transform); | 4749 scroll_layer->parent()->SetTransform(scale_transform); |
| 4751 | 4750 |
| 4752 gfx::Size surface_size(50, 50); | 4751 gfx::Size surface_size(50, 50); |
| 4753 host_impl_->SetViewportSize(surface_size); | 4752 host_impl_->SetViewportSize(surface_size); |
| 4754 DrawFrame(); | 4753 DrawFrame(); |
| (...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9079 host_impl_->active_tree()->SetPageScaleOnActiveTree(2.f); | 9078 host_impl_->active_tree()->SetPageScaleOnActiveTree(2.f); |
| 9080 DrawFrame(); | 9079 DrawFrame(); |
| 9081 in_subtree_of_page_scale_layer = host_impl_->active_tree()->LayerById(100); | 9080 in_subtree_of_page_scale_layer = host_impl_->active_tree()->LayerById(100); |
| 9082 node = host_impl_->active_tree()->property_trees()->transform_tree.Node( | 9081 node = host_impl_->active_tree()->property_trees()->transform_tree.Node( |
| 9083 in_subtree_of_page_scale_layer->transform_tree_index()); | 9082 in_subtree_of_page_scale_layer->transform_tree_index()); |
| 9084 EXPECT_EQ(node->data.sublayer_scale, gfx::Vector2dF(2.f, 2.f)); | 9083 EXPECT_EQ(node->data.sublayer_scale, gfx::Vector2dF(2.f, 2.f)); |
| 9085 } | 9084 } |
| 9086 | 9085 |
| 9087 } // namespace | 9086 } // namespace |
| 9088 } // namespace cc | 9087 } // namespace cc |
| OLD | NEW |