| 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/tiles/picture_layer_tiling_set.h" | 5 #include "cc/tiles/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_provider.h" | 10 #include "cc/resources/resource_provider.h" |
| 11 #include "cc/test/fake_output_surface.h" | 11 #include "cc/test/fake_output_surface.h" |
| 12 #include "cc/test/fake_output_surface_client.h" | 12 #include "cc/test/fake_output_surface_client.h" |
| 13 #include "cc/test/fake_picture_layer_tiling_client.h" | 13 #include "cc/test/fake_picture_layer_tiling_client.h" |
| 14 #include "cc/test/fake_picture_pile_impl.h" | 14 #include "cc/test/fake_picture_pile_impl.h" |
| 15 #include "cc/test/fake_resource_provider.h" | 15 #include "cc/test/fake_resource_provider.h" |
| 16 #include "cc/test/test_shared_bitmap_manager.h" | 16 #include "cc/test/test_shared_bitmap_manager.h" |
| 17 #include "cc/trees/layer_tree_settings.h" | 17 #include "cc/trees/layer_tree_settings.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "ui/gfx/geometry/size_conversions.h" | 19 #include "ui/gfx/geometry/size_conversions.h" |
| 20 | 20 |
| 21 namespace cc { | 21 namespace cc { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 scoped_ptr<PictureLayerTilingSet> CreateTilingSet( | 24 scoped_ptr<PictureLayerTilingSet> CreateTilingSet( |
| 25 PictureLayerTilingClient* client) { | 25 PictureLayerTilingClient* client) { |
| 26 LayerTreeSettings defaults; | 26 LayerTreeSettings defaults; |
| 27 return PictureLayerTilingSet::Create( | 27 return PictureLayerTilingSet::Create( |
| 28 ACTIVE_TREE, client, defaults.tiling_interest_area_viewport_multiplier, | 28 ACTIVE_TREE, client, defaults.max_tiles_for_interest_area, |
| 29 defaults.skewport_target_time_in_seconds, | 29 defaults.skewport_target_time_in_seconds, |
| 30 defaults.skewport_extrapolation_limit_in_content_pixels); | 30 defaults.skewport_extrapolation_limit_in_content_pixels); |
| 31 } | 31 } |
| 32 | 32 |
| 33 TEST(PictureLayerTilingSetTest, NoResources) { | 33 TEST(PictureLayerTilingSetTest, NoResources) { |
| 34 FakePictureLayerTilingClient client; | 34 FakePictureLayerTilingClient client; |
| 35 gfx::Size layer_bounds(1000, 800); | 35 gfx::Size layer_bounds(1000, 800); |
| 36 scoped_ptr<PictureLayerTilingSet> set = CreateTilingSet(&client); | 36 scoped_ptr<PictureLayerTilingSet> set = CreateTilingSet(&client); |
| 37 client.SetTileSize(gfx::Size(256, 256)); | 37 client.SetTileSize(gfx::Size(256, 256)); |
| 38 | 38 |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 448 |
| 449 // Clone from the pending to the active tree with the same max content size. | 449 // Clone from the pending to the active tree with the same max content size. |
| 450 active_set->UpdateTilingsToCurrentRasterSourceForActivation( | 450 active_set->UpdateTilingsToCurrentRasterSourceForActivation( |
| 451 pile.get(), pending_set.get(), Region(), 1.f, max_content_scale); | 451 pile.get(), pending_set.get(), Region(), 1.f, max_content_scale); |
| 452 // All the tilings are on the active tree. | 452 // All the tilings are on the active tree. |
| 453 EXPECT_EQ(2u, active_set->num_tilings()); | 453 EXPECT_EQ(2u, active_set->num_tilings()); |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace | 456 } // namespace |
| 457 } // namespace cc | 457 } // namespace cc |
| OLD | NEW |