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

Side by Side Diff: cc/resources/picture_layer_tiling_set_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: rebase 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
« no previous file with comments | « cc/resources/picture_layer_tiling_set.cc ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('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_set.h" 5 #include "cc/resources/picture_layer_tiling_set.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "cc/resources/resource_provider.h" 10 #include "cc/resources/resource_provider.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 294
295 // Sync from source to target. 295 // Sync from source to target.
296 void SyncTilings(const gfx::Size& new_bounds, 296 void SyncTilings(const gfx::Size& new_bounds,
297 const Region& invalidation, 297 const Region& invalidation,
298 float minimum_scale) { 298 float minimum_scale) {
299 for (size_t i = 0; i < source_->num_tilings(); ++i) 299 for (size_t i = 0; i < source_->num_tilings(); ++i)
300 source_->tiling_at(i)->CreateAllTilesForTesting(); 300 source_->tiling_at(i)->CreateAllTilesForTesting();
301 for (size_t i = 0; i < target_->num_tilings(); ++i) 301 for (size_t i = 0; i < target_->num_tilings(); ++i)
302 target_->tiling_at(i)->CreateAllTilesForTesting(); 302 target_->tiling_at(i)->CreateAllTilesForTesting();
303 303
304 target_->SyncTilings(*source_.get(), new_bounds, invalidation, 304 target_->SyncTilingsForTesting(*source_.get(), new_bounds, invalidation,
305 minimum_scale, target_client_.raster_source()); 305 minimum_scale,
306 target_client_.raster_source());
306 } 307 }
307 void SyncTilings(const gfx::Size& new_bounds) { 308 void SyncTilings(const gfx::Size& new_bounds) {
308 Region invalidation; 309 Region invalidation;
309 SyncTilings(new_bounds, invalidation, 0.f); 310 SyncTilings(new_bounds, invalidation, 0.f);
310 } 311 }
311 void SyncTilings(const gfx::Size& new_bounds, const Region& invalidation) { 312 void SyncTilings(const gfx::Size& new_bounds, const Region& invalidation) {
312 SyncTilings(new_bounds, invalidation, 0.f); 313 SyncTilings(new_bounds, invalidation, 0.f);
313 } 314 }
314 void SyncTilings(const gfx::Size& new_bounds, float minimum_scale) { 315 void SyncTilings(const gfx::Size& new_bounds, float minimum_scale) {
315 Region invalidation; 316 Region invalidation;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); 547 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting();
547 for (size_t i = 0; i < original_tiles.size(); ++i) { 548 for (size_t i = 0; i < original_tiles.size(); ++i) {
548 std::vector<Tile*>::iterator find = 549 std::vector<Tile*>::iterator find =
549 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); 550 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]);
550 EXPECT_TRUE(find == new_tiles.end()); 551 EXPECT_TRUE(find == new_tiles.end());
551 } 552 }
552 } 553 }
553 554
554 } // namespace 555 } // namespace
555 } // namespace cc 556 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_set.cc ('k') | cc/resources/picture_layer_tiling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698