| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 static_cast<FakePictureLayerImpl*>(active_layer_->mask_layer()); | 1493 static_cast<FakePictureLayerImpl*>(active_layer_->mask_layer()); |
| 1494 | 1494 |
| 1495 // Mask layers have a tiling with a single tile in it. | 1495 // Mask layers have a tiling with a single tile in it. |
| 1496 EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size()); | 1496 EXPECT_EQ(1u, active_mask->HighResTiling()->AllTilesForTesting().size()); |
| 1497 // The mask resource exists. | 1497 // The mask resource exists. |
| 1498 ResourceId mask_resource_id; | 1498 ResourceId mask_resource_id; |
| 1499 gfx::Size mask_texture_size; | 1499 gfx::Size mask_texture_size; |
| 1500 active_mask->GetContentsResourceId(&mask_resource_id, &mask_texture_size); | 1500 active_mask->GetContentsResourceId(&mask_resource_id, &mask_texture_size); |
| 1501 EXPECT_NE(0u, mask_resource_id); | 1501 EXPECT_NE(0u, mask_resource_id); |
| 1502 gfx::Size expected_mask_texture_size = | 1502 gfx::Size expected_mask_texture_size = |
| 1503 gfx::ToCeiledSize(gfx::ScaleSize(active_mask->bounds(), 1.3f)); | 1503 gfx::ScaleToCeiledSize(active_mask->bounds(), 1.3f); |
| 1504 EXPECT_EQ(mask_texture_size, expected_mask_texture_size); | 1504 EXPECT_EQ(mask_texture_size, expected_mask_texture_size); |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 TEST_F(PictureLayerImplTest, ReleaseResources) { | 1507 TEST_F(PictureLayerImplTest, ReleaseResources) { |
| 1508 gfx::Size layer_bounds(1300, 1900); | 1508 gfx::Size layer_bounds(1300, 1900); |
| 1509 SetupDefaultTrees(layer_bounds); | 1509 SetupDefaultTrees(layer_bounds); |
| 1510 EXPECT_EQ(1u, pending_layer_->tilings()->num_tilings()); | 1510 EXPECT_EQ(1u, pending_layer_->tilings()->num_tilings()); |
| 1511 | 1511 |
| 1512 // All tilings should be removed when losing output surface. | 1512 // All tilings should be removed when losing output surface. |
| 1513 active_layer_->ReleaseResources(); | 1513 active_layer_->ReleaseResources(); |
| (...skipping 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4979 // New low res tiling. | 4979 // New low res tiling. |
| 4980 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 4980 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
| 4981 | 4981 |
| 4982 // This tiling will be high res now, it won't contain low res content since it | 4982 // This tiling will be high res now, it won't contain low res content since it |
| 4983 // was all destroyed. | 4983 // was all destroyed. |
| 4984 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 4984 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
| 4985 } | 4985 } |
| 4986 | 4986 |
| 4987 } // namespace | 4987 } // namespace |
| 4988 } // namespace cc | 4988 } // namespace cc |
| OLD | NEW |