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 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 VerifyTilesExactlyCoverRect(2.0f, gfx::Rect(512, 365, 253, 182)); | 112 VerifyTilesExactlyCoverRect(2.0f, gfx::Rect(512, 365, 253, 182)); |
113 | 113 |
114 float scale = 6.7f; | 114 float scale = 6.7f; |
115 gfx::Size bounds(800, 600); | 115 gfx::Size bounds(800, 600); |
116 gfx::Rect full_rect(gfx::ToCeiledSize(gfx::ScaleSize(bounds, scale))); | 116 gfx::Rect full_rect(gfx::ToCeiledSize(gfx::ScaleSize(bounds, scale))); |
117 Initialize(gfx::Size(256, 512), 5.2f, bounds); | 117 Initialize(gfx::Size(256, 512), 5.2f, bounds); |
118 VerifyTilesExactlyCoverRect(scale, full_rect); | 118 VerifyTilesExactlyCoverRect(scale, full_rect); |
119 VerifyTilesExactlyCoverRect(scale, gfx::Rect(2014, 1579, 867, 1033)); | 119 VerifyTilesExactlyCoverRect(scale, gfx::Rect(2014, 1579, 867, 1033)); |
120 } | 120 } |
121 | 121 |
| 122 TEST_F(PictureLayerTilingIteratorTest, IteratorEmptyRect) { |
| 123 Initialize(gfx::Size(100, 100), 1, gfx::Size(800, 600)); |
| 124 |
| 125 gfx::Rect empty; |
| 126 PictureLayerTiling::Iterator iter(tiling_.get(), 1, empty); |
| 127 EXPECT_FALSE(iter); |
| 128 } |
| 129 |
122 } // namespace | 130 } // namespace |
123 } // namespace cc | 131 } // namespace cc |
OLD | NEW |