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

Side by Side Diff: cc/picture_layer_tiling_set_unittest.cc

Issue 12289021: cc: Only register live tiles with the TileManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments, fix 80+char line Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « cc/picture_layer_tiling.cc ('k') | cc/tile_manager.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/picture_layer_tiling_set.h" 5 #include "cc/picture_layer_tiling_set.h"
6 6
7 #include "cc/resource_pool.h" 7 #include "cc/resource_pool.h"
8 #include "cc/resource_provider.h" 8 #include "cc/resource_provider.h"
9 #include "cc/test/fake_output_surface.h" 9 #include "cc/test/fake_output_surface.h"
10 #include "cc/test/fake_picture_layer_tiling_client.h" 10 #include "cc/test/fake_picture_layer_tiling_client.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 FakePictureLayerTilingClient client; 67 FakePictureLayerTilingClient client;
68 client.SetTileSize(gfx::Size(256, 256)); 68 client.SetTileSize(gfx::Size(256, 256));
69 PictureLayerTilingSet set(&client); 69 PictureLayerTilingSet set(&client);
70 70
71 gfx::Size layer_bounds(1000, 800); 71 gfx::Size layer_bounds(1000, 800);
72 set.SetLayerBounds(layer_bounds); 72 set.SetLayerBounds(layer_bounds);
73 73
74 float scale = min_scale; 74 float scale = min_scale;
75 for (int i = 0; i < num_tilings; ++i, scale += scale_increment) { 75 for (int i = 0; i < num_tilings; ++i, scale += scale_increment) {
76 PictureLayerTiling* tiling = set.AddTiling(scale); 76 PictureLayerTiling* tiling = set.AddTiling(scale);
77 tiling->RegisterAllTilesManagedForTesting();
77 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); 78 std::vector<Tile*> tiles = tiling->AllTilesForTesting();
78 for (size_t i = 0; i < tiles.size(); ++i) { 79 for (size_t i = 0; i < tiles.size(); ++i) {
79 EXPECT_FALSE(tiles[i]->ManagedStateForTesting()->resource); 80 EXPECT_FALSE(tiles[i]->ManagedStateForTesting()->resource);
80 81
81 tiles[i]->ManagedStateForTesting()->resource = 82 tiles[i]->ManagedStateForTesting()->resource =
82 make_scoped_ptr(new ResourcePool::Resource( 83 make_scoped_ptr(new ResourcePool::Resource(
83 resource_provider.get(), 84 resource_provider.get(),
84 gfx::Size(1, 1), 85 gfx::Size(1, 1),
85 resource_provider->bestTextureFormat())); 86 resource_provider->bestTextureFormat()));
86 } 87 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 TEST_F(PictureLayerTilingSetTestWithResources, ManyTilings_Equal) { 145 TEST_F(PictureLayerTilingSetTestWithResources, ManyTilings_Equal) {
145 runTest(10, 1.f, 1.f, 5.f, 5.f); 146 runTest(10, 1.f, 1.f, 5.f, 5.f);
146 } 147 }
147 148
148 TEST_F(PictureLayerTilingSetTestWithResources, ManyTilings_NotEqual) { 149 TEST_F(PictureLayerTilingSetTestWithResources, ManyTilings_NotEqual) {
149 runTest(10, 1.f, 1.f, 4.5f, 5.f); 150 runTest(10, 1.f, 1.f, 4.5f, 5.f);
150 } 151 }
151 152
152 } // namespace 153 } // namespace
153 } // namespace cc 154 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture_layer_tiling.cc ('k') | cc/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698