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

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

Issue 662473003: cc: Replace > > with >> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: angles: . Created 6 years, 2 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
« no previous file with comments | « cc/resources/picture_layer_tiling.h ('k') | cc/resources/pixel_buffer_raster_worker_pool.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_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_pool.h" 10 #include "cc/resources/resource_pool.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 layer_invalidation.Union(gfx::Rect(100, 100, 1, 1)); 508 layer_invalidation.Union(gfx::Rect(100, 100, 1, 1));
509 509
510 Region content_invalidation; 510 Region content_invalidation;
511 for (Region::Iterator iter(layer_invalidation); iter.has_rect(); 511 for (Region::Iterator iter(layer_invalidation); iter.has_rect();
512 iter.next()) { 512 iter.next()) {
513 gfx::Rect content_rect = gfx::ScaleToEnclosingRect(iter.rect(), 2.f); 513 gfx::Rect content_rect = gfx::ScaleToEnclosingRect(iter.rect(), 2.f);
514 content_invalidation.Union(content_rect); 514 content_invalidation.Union(content_rect);
515 } 515 }
516 516
517 std::vector<Tile*> old_tiles = target_->tiling_at(0)->AllTilesForTesting(); 517 std::vector<Tile*> old_tiles = target_->tiling_at(0)->AllTilesForTesting();
518 std::map<gfx::Point, scoped_refptr<Tile> > old_tile_map; 518 std::map<gfx::Point, scoped_refptr<Tile>> old_tile_map;
519 for (size_t i = 0; i < old_tiles.size(); ++i) 519 for (size_t i = 0; i < old_tiles.size(); ++i)
520 old_tile_map[old_tiles[i]->content_rect().origin()] = old_tiles[i]; 520 old_tile_map[old_tiles[i]->content_rect().origin()] = old_tiles[i];
521 521
522 SyncTilings(target_bounds_, layer_invalidation); 522 SyncTilings(target_bounds_, layer_invalidation);
523 VerifyTargetEqualsSource(target_bounds_); 523 VerifyTargetEqualsSource(target_bounds_);
524 524
525 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); 525 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting();
526 for (size_t i = 0; i < new_tiles.size(); ++i) { 526 for (size_t i = 0; i < new_tiles.size(); ++i) {
527 const Tile* tile = new_tiles[i]; 527 const Tile* tile = new_tiles[i];
528 std::map<gfx::Point, scoped_refptr<Tile> >::iterator find = 528 std::map<gfx::Point, scoped_refptr<Tile>>::iterator find =
529 old_tile_map.find(tile->content_rect().origin()); 529 old_tile_map.find(tile->content_rect().origin());
530 if (content_invalidation.Intersects(tile->content_rect())) 530 if (content_invalidation.Intersects(tile->content_rect()))
531 EXPECT_NE(tile, find->second.get()); 531 EXPECT_NE(tile, find->second.get());
532 else 532 else
533 EXPECT_EQ(tile, find->second.get()); 533 EXPECT_EQ(tile, find->second.get());
534 } 534 }
535 } 535 }
536 536
537 TEST_F(PictureLayerTilingSetSyncTest, TileSizeChange) { 537 TEST_F(PictureLayerTilingSetSyncTest, TileSizeChange) {
538 source_->AddTiling(1.f); 538 source_->AddTiling(1.f);
(...skipping 19 matching lines...) Expand all
558 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); 558 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting();
559 for (size_t i = 0; i < original_tiles.size(); ++i) { 559 for (size_t i = 0; i < original_tiles.size(); ++i) {
560 std::vector<Tile*>::iterator find = 560 std::vector<Tile*>::iterator find =
561 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); 561 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]);
562 EXPECT_TRUE(find == new_tiles.end()); 562 EXPECT_TRUE(find == new_tiles.end());
563 } 563 }
564 } 564 }
565 565
566 } // namespace 566 } // namespace
567 } // namespace cc 567 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling.h ('k') | cc/resources/pixel_buffer_raster_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698