OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/layer_position_constraint.h" | 5 #include "cc/layers/layer_position_constraint.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "cc/layers/layer_impl.h" | 9 #include "cc/layers/layer_impl.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 gfx::Transform identity_matrix; | 40 gfx::Transform identity_matrix; |
41 std::vector<LayerImpl*> dummy_render_surface_layer_list; | 41 std::vector<LayerImpl*> dummy_render_surface_layer_list; |
42 int dummy_max_texture_size = 512; | 42 int dummy_max_texture_size = 512; |
43 gfx::Size device_viewport_size = | 43 gfx::Size device_viewport_size = |
44 gfx::Size(root_layer->bounds().width() * device_scale_factor, | 44 gfx::Size(root_layer->bounds().width() * device_scale_factor, |
45 root_layer->bounds().height() * device_scale_factor); | 45 root_layer->bounds().height() * device_scale_factor); |
46 | 46 |
47 // We are probably not testing what is intended if the root_layer bounds are | 47 // We are probably not testing what is intended if the root_layer bounds are |
48 // empty. | 48 // empty. |
49 DCHECK(!root_layer->bounds().IsEmpty()); | 49 DCHECK(!root_layer->bounds().IsEmpty()); |
50 LayerTreeHostCommon::CalculateDrawProperties(root_layer, | 50 LayerTreeHostCommon::CalculateDrawProperties( |
51 device_viewport_size, | 51 root_layer, |
52 device_scale_factor, | 52 device_viewport_size, |
53 page_scale_factor, | 53 device_scale_factor, |
54 page_scale_application_layer, | 54 page_scale_factor, |
55 dummy_max_texture_size, | 55 page_scale_application_layer, |
56 can_use_lcd_text, | 56 dummy_max_texture_size, |
57 &dummy_render_surface_layer_list, | 57 can_use_lcd_text, |
58 false); | 58 &dummy_render_surface_layer_list); |
59 } | 59 } |
60 | 60 |
61 void ExecuteCalculateDrawProperties(LayerImpl* root_layer) { | 61 void ExecuteCalculateDrawProperties(LayerImpl* root_layer) { |
62 LayerImpl* page_scale_application_layer = NULL; | 62 LayerImpl* page_scale_application_layer = NULL; |
63 ExecuteCalculateDrawProperties( | 63 ExecuteCalculateDrawProperties( |
64 root_layer, 1.f, 1.f, page_scale_application_layer, false); | 64 root_layer, 1.f, 1.f, page_scale_application_layer, false); |
65 } | 65 } |
66 | 66 |
67 class LayerPositionConstraintTest : public testing::Test { | 67 class LayerPositionConstraintTest : public testing::Test { |
68 public: | 68 public: |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 ExecuteCalculateDrawProperties(root_.get()); | 1089 ExecuteCalculateDrawProperties(root_.get()); |
1090 | 1090 |
1091 // Root layer is not the fixed-container anyway. | 1091 // Root layer is not the fixed-container anyway. |
1092 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, child->draw_transform()); | 1092 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, child->draw_transform()); |
1093 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_grand_child_transform, | 1093 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_grand_child_transform, |
1094 grand_child->draw_transform()); | 1094 grand_child->draw_transform()); |
1095 } | 1095 } |
1096 | 1096 |
1097 } // namespace | 1097 } // namespace |
1098 } // namespace cc | 1098 } // namespace cc |
OLD | NEW |