| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "cc/layers/append_quads_data.h" | 9 #include "cc/layers/append_quads_data.h" |
| 10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
| (...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1423 Tile* tile = pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0]; | 1423 Tile* tile = pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0]; |
| 1424 EXPECT_EQ(host_impl_.settings().default_tile_size.ToString(), | 1424 EXPECT_EQ(host_impl_.settings().default_tile_size.ToString(), |
| 1425 tile->content_rect().size().ToString()); | 1425 tile->content_rect().size().ToString()); |
| 1426 | 1426 |
| 1427 // Tell the layer to use GPU rasterization. | 1427 // Tell the layer to use GPU rasterization. |
| 1428 pending_layer_->SetShouldUseGpuRasterization(true); | 1428 pending_layer_->SetShouldUseGpuRasterization(true); |
| 1429 EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings()); | 1429 EXPECT_EQ(0u, pending_layer_->tilings()->num_tilings()); |
| 1430 | 1430 |
| 1431 pending_layer_->CalculateContentsScale( | 1431 pending_layer_->CalculateContentsScale( |
| 1432 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); | 1432 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
| 1433 ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); | 1433 ASSERT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
| 1434 | 1434 |
| 1435 pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting(); | 1435 pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting(); |
| 1436 | 1436 |
| 1437 // Tile size should now equal default_tile_size_gpu. | 1437 // Tile size should now equal default_tile_size_gpu. |
| 1438 Tile* tile_gpu = | 1438 Tile* tile_gpu = |
| 1439 pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0]; | 1439 pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0]; |
| 1440 EXPECT_EQ(default_tile_size_gpu.ToString(), | 1440 EXPECT_EQ(default_tile_size_gpu.ToString(), |
| 1441 tile_gpu->content_rect().size().ToString()); | 1441 tile_gpu->content_rect().size().ToString()); |
| 1442 } | 1442 } |
| 1443 | 1443 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 TestContextProvider::Create(), NULL)); | 1552 TestContextProvider::Create(), NULL)); |
| 1553 | 1553 |
| 1554 // These will crash PictureLayerImpl if this is not true. | 1554 // These will crash PictureLayerImpl if this is not true. |
| 1555 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); | 1555 ASSERT_TRUE(host_impl_.pending_tree()->needs_update_draw_properties()); |
| 1556 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); | 1556 ASSERT_TRUE(host_impl_.active_tree()->needs_update_draw_properties()); |
| 1557 host_impl_.active_tree()->UpdateDrawProperties(); | 1557 host_impl_.active_tree()->UpdateDrawProperties(); |
| 1558 } | 1558 } |
| 1559 | 1559 |
| 1560 } // namespace | 1560 } // namespace |
| 1561 } // namespace cc | 1561 } // namespace cc |
| OLD | NEW |