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

Unified Diff: cc/resources/picture_layer_tiling_set_unittest.cc

Issue 775483002: cc: Remove max tiles and skewport constants from tiling client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/picture_layer_tiling_set_unittest.cc
diff --git a/cc/resources/picture_layer_tiling_set_unittest.cc b/cc/resources/picture_layer_tiling_set_unittest.cc
index 7acc55b9192e1bec8916f61199ab25ed07d1eab9..5ac8ed7af66b7ea4ea3acdce1cc9ba891156979d 100644
--- a/cc/resources/picture_layer_tiling_set_unittest.cc
+++ b/cc/resources/picture_layer_tiling_set_unittest.cc
@@ -18,10 +18,16 @@
namespace cc {
namespace {
+const size_t kMaxTilesForInterestArea = 128;
danakj 2014/12/02 21:58:37 kinda similar comment here.. these are somewhat me
+const float kSkewportTargetTimeInSeconds = 1.0f;
+const int kSkewportExtrapolationLimitInContentPixels = 2000;
+
TEST(PictureLayerTilingSetTest, NoResources) {
FakePictureLayerTilingClient client;
gfx::Size layer_bounds(1000, 800);
- auto set = PictureLayerTilingSet::Create(&client);
+ auto set = PictureLayerTilingSet::Create(
+ &client, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
client.SetTileSize(gfx::Size(256, 256));
set->AddTiling(1.0, layer_bounds);
@@ -59,7 +65,9 @@ TEST(PictureLayerTilingSetTest, TilingRange) {
PictureLayerTiling* high_res_tiling;
PictureLayerTiling* low_res_tiling;
- auto set = PictureLayerTilingSet::Create(&client);
+ auto set = PictureLayerTilingSet::Create(
+ &client, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
set->AddTiling(2.0, layer_bounds);
high_res_tiling = set->AddTiling(1.0, layer_bounds);
high_res_tiling->set_resolution(HIGH_RESOLUTION);
@@ -91,7 +99,9 @@ TEST(PictureLayerTilingSetTest, TilingRange) {
EXPECT_EQ(4u, lower_than_low_res_range.start);
EXPECT_EQ(5u, lower_than_low_res_range.end);
- auto set_without_low_res = PictureLayerTilingSet::Create(&client);
+ auto set_without_low_res = PictureLayerTilingSet::Create(
+ &client, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
set_without_low_res->AddTiling(2.0, layer_bounds);
high_res_tiling = set_without_low_res->AddTiling(1.0, layer_bounds);
high_res_tiling->set_resolution(HIGH_RESOLUTION);
@@ -121,7 +131,9 @@ TEST(PictureLayerTilingSetTest, TilingRange) {
PictureLayerTilingSet::LOWER_THAN_LOW_RES);
EXPECT_EQ(0u, lower_than_low_res_range.end - lower_than_low_res_range.start);
- auto set_with_only_high_and_low_res = PictureLayerTilingSet::Create(&client);
+ auto set_with_only_high_and_low_res = PictureLayerTilingSet::Create(
+ &client, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
high_res_tiling =
set_with_only_high_and_low_res->AddTiling(1.0, layer_bounds);
high_res_tiling->set_resolution(HIGH_RESOLUTION);
@@ -153,7 +165,9 @@ TEST(PictureLayerTilingSetTest, TilingRange) {
PictureLayerTilingSet::LOWER_THAN_LOW_RES);
EXPECT_EQ(0u, lower_than_low_res_range.end - lower_than_low_res_range.start);
- auto set_with_only_high_res = PictureLayerTilingSet::Create(&client);
+ auto set_with_only_high_res = PictureLayerTilingSet::Create(
+ &client, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
high_res_tiling = set_with_only_high_res->AddTiling(1.0, layer_bounds);
high_res_tiling->set_resolution(HIGH_RESOLUTION);
@@ -209,7 +223,9 @@ class PictureLayerTilingSetTestWithResources : public testing::Test {
client.SetTileSize(gfx::Size(256, 256));
client.set_tree(PENDING_TREE);
gfx::Size layer_bounds(1000, 800);
- auto set = PictureLayerTilingSet::Create(&client);
+ auto set = PictureLayerTilingSet::Create(
+ &client, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
float scale = min_scale;
for (int i = 0; i < num_tilings; ++i, scale += scale_increment) {
@@ -288,8 +304,12 @@ class PictureLayerTilingSetSyncTest : public testing::Test {
source_client_.set_tree(PENDING_TREE);
target_client_.SetTileSize(tile_size_);
target_client_.set_tree(PENDING_TREE);
- source_ = PictureLayerTilingSet::Create(&source_client_);
- target_ = PictureLayerTilingSet::Create(&target_client_);
+ source_ = PictureLayerTilingSet::Create(
+ &source_client_, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
+ target_ = PictureLayerTilingSet::Create(
+ &target_client_, kMaxTilesForInterestArea, kSkewportTargetTimeInSeconds,
+ kSkewportExtrapolationLimitInContentPixels);
}
// Sync from source to target.

Powered by Google App Engine
This is Rietveld 408576698