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

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

Issue 716283003: cc: Remove GetRasterSource from PictureLayerTilingClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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_unittest.cc ('k') | cc/test/fake_picture_layer_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/eviction_tile_priority_queue.h" 5 #include "cc/resources/eviction_tile_priority_queue.h"
6 #include "cc/resources/raster_tile_priority_queue.h" 6 #include "cc/resources/raster_tile_priority_queue.h"
7 #include "cc/resources/tile.h" 7 #include "cc/resources/tile.h"
8 #include "cc/resources/tile_priority.h" 8 #include "cc/resources/tile_priority.h"
9 #include "cc/test/fake_impl_proxy.h" 9 #include "cc/test/fake_impl_proxy.h"
10 #include "cc/test/fake_layer_tree_host_impl.h" 10 #include "cc/test/fake_layer_tree_host_impl.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 queue.Pop(); 187 queue.Pop();
188 } 188 }
189 EXPECT_EQ(all_tiles, smoothness_tiles); 189 EXPECT_EQ(all_tiles, smoothness_tiles);
190 EXPECT_TRUE(had_low_res); 190 EXPECT_TRUE(had_low_res);
191 191
192 Region invalidation(gfx::Rect(0, 0, 500, 500)); 192 Region invalidation(gfx::Rect(0, 0, 500, 500));
193 193
194 // Invalidate the pending tree. 194 // Invalidate the pending tree.
195 pending_layer_->set_invalidation(invalidation); 195 pending_layer_->set_invalidation(invalidation);
196 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource( 196 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource(
197 invalidation, gfx::Size(1000, 1000)); 197 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000));
198 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource( 198 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource(
199 invalidation, gfx::Size(1000, 1000)); 199 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000));
200 200
201 active_layer_->ResetAllTilesPriorities(); 201 active_layer_->ResetAllTilesPriorities();
202 pending_layer_->ResetAllTilesPriorities(); 202 pending_layer_->ResetAllTilesPriorities();
203 203
204 // Renew all of the tile priorities. 204 // Renew all of the tile priorities.
205 gfx::Rect viewport(50, 50, 100, 100); 205 gfx::Rect viewport(50, 50, 100, 100);
206 pending_layer_->HighResTiling()->ComputeTilePriorityRects( 206 pending_layer_->HighResTiling()->ComputeTilePriorityRects(
207 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion()); 207 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
208 pending_layer_->LowResTiling()->ComputeTilePriorityRects( 208 pending_layer_->LowResTiling()->ComputeTilePriorityRects(
209 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion()); 209 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 EXPECT_EQ(all_tiles, smoothness_tiles); 435 EXPECT_EQ(all_tiles, smoothness_tiles);
436 436
437 tile_manager()->ReleaseTileResourcesForTesting( 437 tile_manager()->ReleaseTileResourcesForTesting(
438 std::vector<Tile*>(all_tiles.begin(), all_tiles.end())); 438 std::vector<Tile*>(all_tiles.begin(), all_tiles.end()));
439 439
440 Region invalidation(gfx::Rect(0, 0, 500, 500)); 440 Region invalidation(gfx::Rect(0, 0, 500, 500));
441 441
442 // Invalidate the pending tree. 442 // Invalidate the pending tree.
443 pending_layer_->set_invalidation(invalidation); 443 pending_layer_->set_invalidation(invalidation);
444 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource( 444 pending_layer_->HighResTiling()->UpdateTilesToCurrentRasterSource(
445 invalidation, gfx::Size(1000, 1000)); 445 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000));
446 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource( 446 pending_layer_->LowResTiling()->UpdateTilesToCurrentRasterSource(
447 invalidation, gfx::Size(1000, 1000)); 447 pending_layer_->raster_source(), invalidation, gfx::Size(1000, 1000));
448 448
449 active_layer_->ResetAllTilesPriorities(); 449 active_layer_->ResetAllTilesPriorities();
450 pending_layer_->ResetAllTilesPriorities(); 450 pending_layer_->ResetAllTilesPriorities();
451 451
452 // Renew all of the tile priorities. 452 // Renew all of the tile priorities.
453 gfx::Rect viewport(50, 50, 100, 100); 453 gfx::Rect viewport(50, 50, 100, 100);
454 pending_layer_->HighResTiling()->ComputeTilePriorityRects( 454 pending_layer_->HighResTiling()->ComputeTilePriorityRects(
455 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion()); 455 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
456 pending_layer_->LowResTiling()->ComputeTilePriorityRects( 456 pending_layer_->LowResTiling()->ComputeTilePriorityRects(
457 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion()); 457 PENDING_TREE, viewport, 1.0f, 1.0, Occlusion());
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 all_tiles.insert(queue.Top()); 858 all_tiles.insert(queue.Top());
859 ++tile_count; 859 ++tile_count;
860 queue.Pop(); 860 queue.Pop();
861 } 861 }
862 EXPECT_EQ(tile_count, all_tiles.size()); 862 EXPECT_EQ(tile_count, all_tiles.size());
863 EXPECT_EQ(16u, tile_count); 863 EXPECT_EQ(16u, tile_count);
864 } 864 }
865 865
866 } // namespace 866 } // namespace
867 } // namespace cc 867 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling_unittest.cc ('k') | cc/test/fake_picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698