OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/contents_scaling_layer.h" | 5 #include "cc/layers/contents_scaling_layer.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "cc/test/geometry_test_utils.h" | 9 #include "cc/test/geometry_test_utils.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 virtual ~MockContentsScalingLayer() {} | 34 virtual ~MockContentsScalingLayer() {} |
35 | 35 |
36 gfx::RectF last_needs_display_rect_; | 36 gfx::RectF last_needs_display_rect_; |
37 }; | 37 }; |
38 | 38 |
39 void CalcDrawProps(Layer* root, float device_scale) { | 39 void CalcDrawProps(Layer* root, float device_scale) { |
40 LayerList render_surface_layer_list; | 40 LayerList render_surface_layer_list; |
41 LayerTreeHostCommon::CalculateDrawProperties( | 41 LayerTreeHostCommon::CalculateDrawProperties( |
42 root, | 42 root, |
43 gfx::Size(500, 500), | 43 gfx::Size(500, 500), |
| 44 gfx::Transform(), |
44 device_scale, | 45 device_scale, |
45 1.f, | 46 1.f, |
46 NULL, | 47 NULL, |
47 1024, | 48 1024, |
48 false, | 49 false, |
49 false, | 50 false, |
50 &render_surface_layer_list); | 51 &render_surface_layer_list); |
51 } | 52 } |
52 | 53 |
53 TEST(ContentsScalingLayerTest, CheckContentsBounds) { | 54 TEST(ContentsScalingLayerTest, CheckContentsBounds) { |
(...skipping 19 matching lines...) Expand all Loading... |
73 EXPECT_EQ(20, test_layer->content_bounds().width()); | 74 EXPECT_EQ(20, test_layer->content_bounds().width()); |
74 EXPECT_EQ(40, test_layer->content_bounds().height()); | 75 EXPECT_EQ(40, test_layer->content_bounds().height()); |
75 | 76 |
76 CalcDrawProps(root.get(), 1.33f); | 77 CalcDrawProps(root.get(), 1.33f); |
77 EXPECT_EQ(14, test_layer->content_bounds().width()); | 78 EXPECT_EQ(14, test_layer->content_bounds().width()); |
78 EXPECT_EQ(27, test_layer->content_bounds().height()); | 79 EXPECT_EQ(27, test_layer->content_bounds().height()); |
79 } | 80 } |
80 | 81 |
81 } // namespace | 82 } // namespace |
82 } // namespace cc | 83 } // namespace cc |
OLD | NEW |