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