| 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 29 matching lines...) Expand all Loading... |
| 40 &draw_properties().content_bounds); | 40 &draw_properties().content_bounds); |
| 41 } | 41 } |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 virtual ~MockContentsScalingLayer() {} | 44 virtual ~MockContentsScalingLayer() {} |
| 45 | 45 |
| 46 gfx::RectF last_needs_display_rect_; | 46 gfx::RectF last_needs_display_rect_; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 void CalcDrawProps(Layer* root, float device_scale) { | 49 void CalcDrawProps(Layer* root, float device_scale) { |
| 50 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 50 LayerList render_surface_layer_list; |
| 51 LayerTreeHostCommon::CalculateDrawProperties( | 51 LayerTreeHostCommon::CalculateDrawProperties( |
| 52 root, | 52 root, |
| 53 gfx::Size(500, 500), | 53 gfx::Size(500, 500), |
| 54 device_scale, | 54 device_scale, |
| 55 1.f, | 55 1.f, |
| 56 1024, | 56 1024, |
| 57 false, | 57 false, |
| 58 &render_surface_layer_list); | 58 &render_surface_layer_list); |
| 59 } | 59 } |
| 60 | 60 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 81 EXPECT_EQ(20, test_layer->content_bounds().width()); | 81 EXPECT_EQ(20, test_layer->content_bounds().width()); |
| 82 EXPECT_EQ(40, test_layer->content_bounds().height()); | 82 EXPECT_EQ(40, test_layer->content_bounds().height()); |
| 83 | 83 |
| 84 CalcDrawProps(root, 1.33f); | 84 CalcDrawProps(root, 1.33f); |
| 85 EXPECT_EQ(14, test_layer->content_bounds().width()); | 85 EXPECT_EQ(14, test_layer->content_bounds().width()); |
| 86 EXPECT_EQ(27, test_layer->content_bounds().height()); | 86 EXPECT_EQ(27, test_layer->content_bounds().height()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace | 89 } // namespace |
| 90 } // namespace cc | 90 } // namespace cc |
| OLD | NEW |