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/picture_layer_tiling.h" | 5 #include "cc/picture_layer_tiling.h" |
6 | 6 |
7 #include "cc/test/fake_picture_layer_tiling_client.h" | 7 #include "cc/test/fake_picture_layer_tiling_client.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/gfx/size_conversions.h" | 9 #include "ui/gfx/size_conversions.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
| 12 namespace { |
12 | 13 |
13 class PictureLayerTilingIteratorTest : public testing::Test { | 14 class PictureLayerTilingIteratorTest : public testing::Test { |
14 public: | 15 public: |
15 PictureLayerTilingIteratorTest() {} | 16 PictureLayerTilingIteratorTest() {} |
16 virtual ~PictureLayerTilingIteratorTest() {} | 17 virtual ~PictureLayerTilingIteratorTest() {} |
17 | 18 |
18 void Initialize(gfx::Size tile_size, | 19 void Initialize(gfx::Size tile_size, |
19 float contents_scale, | 20 float contents_scale, |
20 gfx::Size layer_bounds) { | 21 gfx::Size layer_bounds) { |
21 client_.SetTileSize(tile_size); | 22 client_.SetTileSize(tile_size); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 VerifyTilesExactlyCoverRect(2.0f, gfx::Rect(512, 365, 253, 182)); | 112 VerifyTilesExactlyCoverRect(2.0f, gfx::Rect(512, 365, 253, 182)); |
112 | 113 |
113 float scale = 6.7f; | 114 float scale = 6.7f; |
114 gfx::Size bounds(800, 600); | 115 gfx::Size bounds(800, 600); |
115 gfx::Rect full_rect(gfx::ToCeiledSize(gfx::ScaleSize(bounds, scale))); | 116 gfx::Rect full_rect(gfx::ToCeiledSize(gfx::ScaleSize(bounds, scale))); |
116 Initialize(gfx::Size(256, 512), 5.2f, bounds); | 117 Initialize(gfx::Size(256, 512), 5.2f, bounds); |
117 VerifyTilesExactlyCoverRect(scale, full_rect); | 118 VerifyTilesExactlyCoverRect(scale, full_rect); |
118 VerifyTilesExactlyCoverRect(scale, gfx::Rect(2014, 1579, 867, 1033)); | 119 VerifyTilesExactlyCoverRect(scale, gfx::Rect(2014, 1579, 867, 1033)); |
119 } | 120 } |
120 | 121 |
| 122 } // namespace |
121 } // namespace cc | 123 } // namespace cc |
OLD | NEW |