| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 float min_scale, | 59 float min_scale, |
| 60 float scale_increment, | 60 float scale_increment, |
| 61 float ideal_contents_scale, | 61 float ideal_contents_scale, |
| 62 float expected_scale) { | 62 float expected_scale) { |
| 63 FakeOutputSurfaceClient output_surface_client; | 63 FakeOutputSurfaceClient output_surface_client; |
| 64 scoped_ptr<FakeOutputSurface> output_surface = | 64 scoped_ptr<FakeOutputSurface> output_surface = |
| 65 FakeOutputSurface::Create3d(); | 65 FakeOutputSurface::Create3d(); |
| 66 CHECK(output_surface->BindToClient(&output_surface_client)); | 66 CHECK(output_surface->BindToClient(&output_surface_client)); |
| 67 | 67 |
| 68 scoped_ptr<ResourceProvider> resource_provider = | 68 scoped_ptr<ResourceProvider> resource_provider = |
| 69 ResourceProvider::Create(output_surface.get(), NULL, 0, false); | 69 ResourceProvider::Create(output_surface.get(), NULL, 0, false, 1); |
| 70 | 70 |
| 71 FakePictureLayerTilingClient client; | 71 FakePictureLayerTilingClient client; |
| 72 client.SetTileSize(gfx::Size(256, 256)); | 72 client.SetTileSize(gfx::Size(256, 256)); |
| 73 gfx::Size layer_bounds(1000, 800); | 73 gfx::Size layer_bounds(1000, 800); |
| 74 PictureLayerTilingSet set(&client, layer_bounds); | 74 PictureLayerTilingSet set(&client, layer_bounds); |
| 75 | 75 |
| 76 float scale = min_scale; | 76 float scale = min_scale; |
| 77 for (int i = 0; i < num_tilings; ++i, scale += scale_increment) { | 77 for (int i = 0; i < num_tilings; ++i, scale += scale_increment) { |
| 78 PictureLayerTiling* tiling = set.AddTiling(scale); | 78 PictureLayerTiling* tiling = set.AddTiling(scale); |
| 79 tiling->CreateAllTilesForTesting(); | 79 tiling->CreateAllTilesForTesting(); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); | 407 std::vector<Tile*> new_tiles = target_->tiling_at(0)->AllTilesForTesting(); |
| 408 for (size_t i = 0; i < original_tiles.size(); ++i) { | 408 for (size_t i = 0; i < original_tiles.size(); ++i) { |
| 409 std::vector<Tile*>::iterator find = | 409 std::vector<Tile*>::iterator find = |
| 410 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); | 410 std::find(new_tiles.begin(), new_tiles.end(), original_tiles[i]); |
| 411 EXPECT_TRUE(find == new_tiles.end()); | 411 EXPECT_TRUE(find == new_tiles.end()); |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace | 415 } // namespace |
| 416 } // namespace cc | 416 } // namespace cc |
| OLD | NEW |