Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: cc/resources/picture_layer_tiling_unittest.cc

Issue 389973004: cc: Give TilingData back a Size instead of a Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tilingsize: comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture_layer_tiling_set_unittest.cc ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_set_unittest.cc ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698