| 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 <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 gfx::Transform expected_scale; | 1572 gfx::Transform expected_scale; |
| 1573 expected_scale.Scale(page_scale, page_scale); | 1573 expected_scale.Scale(page_scale, page_scale); |
| 1574 EXPECT_EQ(expected_scale, | 1574 EXPECT_EQ(expected_scale, |
| 1575 host_impl_->active_tree()->root_layer()->impl_transform()); | 1575 host_impl_->active_tree()->root_layer()->impl_transform()); |
| 1576 } | 1576 } |
| 1577 | 1577 |
| 1578 TEST_F(LayerTreeHostImplTest, PageScaleDeltaAppliedToRootScrollLayerOnly) { | 1578 TEST_F(LayerTreeHostImplTest, PageScaleDeltaAppliedToRootScrollLayerOnly) { |
| 1579 gfx::Size surface_size(10, 10); | 1579 gfx::Size surface_size(10, 10); |
| 1580 float default_page_scale = 1.f; | 1580 float default_page_scale = 1.f; |
| 1581 gfx::Transform default_page_scale_matrix; | 1581 gfx::Transform default_page_scale_matrix; |
| 1582 default_page_scale_matrix.Scale(default_page_scale, default_page_scale); |
| 1582 | 1583 |
| 1583 float new_page_scale = 2.f; | 1584 float new_page_scale = 2.f; |
| 1584 gfx::Transform new_page_scale_matrix; | 1585 gfx::Transform new_page_scale_matrix; |
| 1585 new_page_scale_matrix.Scale(new_page_scale, new_page_scale); | 1586 new_page_scale_matrix.Scale(new_page_scale, new_page_scale); |
| 1586 | 1587 |
| 1587 // Create a normal scrollable root layer and another scrollable child layer. | 1588 // Create a normal scrollable root layer and another scrollable child layer. |
| 1588 SetupScrollAndContentsLayers(surface_size); | 1589 SetupScrollAndContentsLayers(surface_size); |
| 1589 LayerImpl* root = host_impl_->active_tree()->root_layer(); | 1590 LayerImpl* root = host_impl_->active_tree()->root_layer(); |
| 1590 LayerImpl* child = root->children()[0]; | 1591 LayerImpl* child = root->children()[0]; |
| 1591 | 1592 |
| (...skipping 3363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4955 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), | 4956 EXPECT_EQ(gfx::RectF(0.f, 0.f, 1.f, 1.f).ToString(), |
| 4956 render_pass_quad->mask_uv_rect.ToString()); | 4957 render_pass_quad->mask_uv_rect.ToString()); |
| 4957 | 4958 |
| 4958 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); | 4959 host_impl_->DrawLayers(&frame, base::TimeTicks::Now()); |
| 4959 host_impl_->DidDrawAllLayers(frame); | 4960 host_impl_->DidDrawAllLayers(frame); |
| 4960 } | 4961 } |
| 4961 } | 4962 } |
| 4962 | 4963 |
| 4963 } // namespace | 4964 } // namespace |
| 4964 } // namespace cc | 4965 } // namespace cc |
| OLD | NEW |