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/resources/picture_layer_tiling.h" | 5 #include "cc/resources/picture_layer_tiling.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 remaining.Subtract(iter.geometry_rect()); | 149 remaining.Subtract(iter.geometry_rect()); |
150 callback.Run(*iter, iter.geometry_rect()); | 150 callback.Run(*iter, iter.geometry_rect()); |
151 } | 151 } |
152 EXPECT_TRUE(remaining.IsEmpty()); | 152 EXPECT_TRUE(remaining.IsEmpty()); |
153 } | 153 } |
154 | 154 |
155 void VerifyTilesCoverNonContainedRect(float rect_scale, | 155 void VerifyTilesCoverNonContainedRect(float rect_scale, |
156 const gfx::Rect& dest_rect) { | 156 const gfx::Rect& dest_rect) { |
157 float dest_to_contents_scale = tiling_->contents_scale() / rect_scale; | 157 float dest_to_contents_scale = tiling_->contents_scale() / rect_scale; |
158 gfx::Rect clamped_rect = gfx::ScaleToEnclosingRect( | 158 gfx::Rect clamped_rect = gfx::ScaleToEnclosingRect( |
159 tiling_->ContentRect(), 1.f / dest_to_contents_scale); | 159 tiling_->TilingRect(), 1.f / dest_to_contents_scale); |
160 clamped_rect.Intersect(dest_rect); | 160 clamped_rect.Intersect(dest_rect); |
161 VerifyTilesExactlyCoverRect(rect_scale, dest_rect, clamped_rect); | 161 VerifyTilesExactlyCoverRect(rect_scale, dest_rect, clamped_rect); |
162 } | 162 } |
163 | 163 |
164 void set_max_tiles_for_interest_area(size_t area) { | 164 void set_max_tiles_for_interest_area(size_t area) { |
165 client_.set_max_tiles_for_interest_area(area); | 165 client_.set_max_tiles_for_interest_area(area); |
166 } | 166 } |
167 | 167 |
168 protected: | 168 protected: |
169 FakePictureLayerTilingClient client_; | 169 FakePictureLayerTilingClient client_; |
(...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1689 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1690 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1690 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
1691 | 1691 |
1692 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); | 1692 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); |
1693 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1693 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
1694 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1694 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
1695 } | 1695 } |
1696 | 1696 |
1697 } // namespace | 1697 } // namespace |
1698 } // namespace cc | 1698 } // namespace cc |
OLD | NEW |