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

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

Issue 640063010: cc: Don't swap PictureLayerTilingSet on activate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: noswap: maskconstructor 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 unified diff | Download patch
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 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 1.f, // current contents scale 1362 1.f, // current contents scale
1363 1.0); // current frame time 1363 1.0); // current frame time
1364 1364
1365 // The active tiling has tiles now. 1365 // The active tiling has tiles now.
1366 VerifyTiles(active_set->tiling_at(0), 1.f, gfx::Rect(layer_bounds), 1366 VerifyTiles(active_set->tiling_at(0), 1.f, gfx::Rect(layer_bounds),
1367 base::Bind(&TileExists, true)); 1367 base::Bind(&TileExists, true));
1368 1368
1369 // Add the same tilings to the pending set. 1369 // Add the same tilings to the pending set.
1370 auto pending_set = PictureLayerTilingSet::Create(&client_); 1370 auto pending_set = PictureLayerTilingSet::Create(&client_);
1371 Region invalidation; 1371 Region invalidation;
1372 pending_set->SyncTilings(*active_set, layer_bounds, invalidation, 0.f, 1372 pending_set->SyncTilingsForTesting(*active_set, layer_bounds, invalidation,
1373 client_.raster_source()); 1373 0.f, client_.raster_source());
1374 1374
1375 // The pending tiling starts with no tiles. 1375 // The pending tiling starts with no tiles.
1376 VerifyTiles(pending_set->tiling_at(0), 1.f, gfx::Rect(layer_bounds), 1376 VerifyTiles(pending_set->tiling_at(0), 1.f, gfx::Rect(layer_bounds),
1377 base::Bind(&TileExists, false)); 1377 base::Bind(&TileExists, false));
1378 1378
1379 // ComputeTilePriorityRects on the pending tiling at the same frame time. The 1379 // ComputeTilePriorityRects on the pending tiling at the same frame time. The
1380 // pending tiling should get tiles. 1380 // pending tiling should get tiles.
1381 UpdateAllTilePriorities(pending_set.get(), 1381 UpdateAllTilePriorities(pending_set.get(),
1382 gfx::Rect(layer_bounds), // visible content rect 1382 gfx::Rect(layer_bounds), // visible content rect
1383 1.f, // current contents scale 1383 1.f, // current contents scale
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 invalidation, gfx::Size(250, 150)); 2055 invalidation, gfx::Size(250, 150));
2056 2056
2057 // Tile size in the tiling should be resized to 250x200. 2057 // Tile size in the tiling should be resized to 250x200.
2058 EXPECT_EQ(250, tiling_->TilingDataForTesting().max_texture_size().width()); 2058 EXPECT_EQ(250, tiling_->TilingDataForTesting().max_texture_size().width());
2059 EXPECT_EQ(200, tiling_->TilingDataForTesting().max_texture_size().height()); 2059 EXPECT_EQ(200, tiling_->TilingDataForTesting().max_texture_size().height());
2060 EXPECT_EQ(0u, tiling_->AllRefTilesForTesting().size()); 2060 EXPECT_EQ(0u, tiling_->AllRefTilesForTesting().size());
2061 } 2061 }
2062 2062
2063 } // namespace 2063 } // namespace
2064 } // namespace cc 2064 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698