OLD | NEW |
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 float scale_increment, | 195 float scale_increment, |
196 float ideal_contents_scale, | 196 float ideal_contents_scale, |
197 float expected_scale) { | 197 float expected_scale) { |
198 FakeOutputSurfaceClient output_surface_client; | 198 FakeOutputSurfaceClient output_surface_client; |
199 scoped_ptr<FakeOutputSurface> output_surface = | 199 scoped_ptr<FakeOutputSurface> output_surface = |
200 FakeOutputSurface::Create3d(); | 200 FakeOutputSurface::Create3d(); |
201 CHECK(output_surface->BindToClient(&output_surface_client)); | 201 CHECK(output_surface->BindToClient(&output_surface_client)); |
202 | 202 |
203 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( | 203 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( |
204 new TestSharedBitmapManager()); | 204 new TestSharedBitmapManager()); |
205 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 205 scoped_ptr<ResourceProvider> resource_provider = |
206 output_surface.get(), shared_bitmap_manager.get(), 0, false, 1, false); | 206 ResourceProvider::Create(output_surface.get(), |
| 207 shared_bitmap_manager.get(), |
| 208 NULL, |
| 209 0, |
| 210 false, |
| 211 1, |
| 212 false); |
207 | 213 |
208 FakePictureLayerTilingClient client(resource_provider.get()); | 214 FakePictureLayerTilingClient client(resource_provider.get()); |
209 client.SetTileSize(gfx::Size(256, 256)); | 215 client.SetTileSize(gfx::Size(256, 256)); |
210 client.set_tree(PENDING_TREE); | 216 client.set_tree(PENDING_TREE); |
211 gfx::Size layer_bounds(1000, 800); | 217 gfx::Size layer_bounds(1000, 800); |
212 PictureLayerTilingSet set(&client, layer_bounds); | 218 PictureLayerTilingSet set(&client, layer_bounds); |
213 | 219 |
214 float scale = min_scale; | 220 float scale = min_scale; |
215 for (int i = 0; i < num_tilings; ++i, scale += scale_increment) { | 221 for (int i = 0; i < num_tilings; ++i, scale += scale_increment) { |
216 PictureLayerTiling* tiling = set.AddTiling(scale); | 222 PictureLayerTiling* tiling = set.AddTiling(scale); |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); | 557 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); |
552 for (size_t i = 0; i < original_tiles.size(); ++i) { | 558 for (size_t i = 0; i < original_tiles.size(); ++i) { |
553 std::vector<Tile*>::iterator find = | 559 std::vector<Tile*>::iterator find = |
554 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); | 560 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); |
555 EXPECT_TRUE(find == new_tiles.end()); | 561 EXPECT_TRUE(find == new_tiles.end()); |
556 } | 562 } |
557 } | 563 } |
558 | 564 |
559 } // namespace | 565 } // namespace |
560 } // namespace cc | 566 } // namespace cc |
OLD | NEW |