| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 remaining.Subtract(iter.geometry_rect()); | 165 remaining.Subtract(iter.geometry_rect()); |
| 166 callback.Run(*iter, iter.geometry_rect()); | 166 callback.Run(*iter, iter.geometry_rect()); |
| 167 } | 167 } |
| 168 EXPECT_TRUE(remaining.IsEmpty()); | 168 EXPECT_TRUE(remaining.IsEmpty()); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void VerifyTilesCoverNonContainedRect(float rect_scale, | 171 void VerifyTilesCoverNonContainedRect(float rect_scale, |
| 172 const gfx::Rect& dest_rect) { | 172 const gfx::Rect& dest_rect) { |
| 173 float dest_to_contents_scale = tiling_->contents_scale() / rect_scale; | 173 float dest_to_contents_scale = tiling_->contents_scale() / rect_scale; |
| 174 gfx::Rect clamped_rect = gfx::ScaleToEnclosingRect( | 174 gfx::Rect clamped_rect = gfx::ScaleToEnclosingRect( |
| 175 tiling_->TilingRect(), 1.f / dest_to_contents_scale); | 175 gfx::Rect(tiling_->tiling_size()), 1.f / dest_to_contents_scale); |
| 176 clamped_rect.Intersect(dest_rect); | 176 clamped_rect.Intersect(dest_rect); |
| 177 VerifyTilesExactlyCoverRect(rect_scale, dest_rect, clamped_rect); | 177 VerifyTilesExactlyCoverRect(rect_scale, dest_rect, clamped_rect); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void set_max_tiles_for_interest_area(size_t area) { | 180 void set_max_tiles_for_interest_area(size_t area) { |
| 181 client_.set_max_tiles_for_interest_area(area); | 181 client_.set_max_tiles_for_interest_area(area); |
| 182 } | 182 } |
| 183 | 183 |
| 184 protected: | 184 protected: |
| 185 FakePictureLayerTilingClient client_; | 185 FakePictureLayerTilingClient client_; |
| (...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1840 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
| 1841 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1841 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
| 1842 | 1842 |
| 1843 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); | 1843 priority = tiling->TileAt(1, 0)->priority(ACTIVE_TREE); |
| 1844 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); | 1844 EXPECT_FLOAT_EQ(0.f, priority.distance_to_visible); |
| 1845 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); | 1845 EXPECT_EQ(TilePriority::NOW, priority.priority_bin); |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 } // namespace | 1848 } // namespace |
| 1849 } // namespace cc | 1849 } // namespace cc |
| OLD | NEW |