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 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2839 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); | 2839 LayerTestCommon::VerifyQuadsExactlyCoverRect(impl.quad_list(), gfx::Rect()); |
2840 EXPECT_EQ(impl.quad_list().size(), 0u); | 2840 EXPECT_EQ(impl.quad_list().size(), 0u); |
2841 } | 2841 } |
2842 | 2842 |
2843 { | 2843 { |
2844 SCOPED_TRACE("Partial occlusion"); | 2844 SCOPED_TRACE("Partial occlusion"); |
2845 gfx::Rect occluded(150, 0, 200, 1000); | 2845 gfx::Rect occluded(150, 0, 200, 1000); |
2846 impl.AppendQuadsWithOcclusion(active_layer_, occluded); | 2846 impl.AppendQuadsWithOcclusion(active_layer_, occluded); |
2847 | 2847 |
2848 size_t partially_occluded_count = 0; | 2848 size_t partially_occluded_count = 0; |
2849 LayerTestCommon::VerifyQuadsCoverRectWithOcclusion( | 2849 LayerTestCommon::VerifyQuadsAreOccluded( |
2850 impl.quad_list(), | 2850 impl.quad_list(), occluded, &partially_occluded_count); |
2851 gfx::Rect(layer_bounds), | |
2852 occluded, | |
2853 &partially_occluded_count); | |
2854 // The layer outputs one quad, which is partially occluded. | 2851 // The layer outputs one quad, which is partially occluded. |
2855 EXPECT_EQ(100u - 10u, impl.quad_list().size()); | 2852 EXPECT_EQ(100u - 10u, impl.quad_list().size()); |
2856 EXPECT_EQ(10u + 10u, partially_occluded_count); | 2853 EXPECT_EQ(10u + 10u, partially_occluded_count); |
2857 } | 2854 } |
2858 } | 2855 } |
2859 | 2856 |
2860 TEST_F(PictureLayerImplTest, RasterScaleChangeWithoutAnimation) { | 2857 TEST_F(PictureLayerImplTest, RasterScaleChangeWithoutAnimation) { |
2861 gfx::Size tile_size(host_impl_.settings().default_tile_size); | 2858 gfx::Size tile_size(host_impl_.settings().default_tile_size); |
2862 SetupDefaultTrees(tile_size); | 2859 SetupDefaultTrees(tile_size); |
2863 | 2860 |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4365 SetupPendingTree(pending_pile2); | 4362 SetupPendingTree(pending_pile2); |
4366 ActivateTree(); | 4363 ActivateTree(); |
4367 | 4364 |
4368 // We've switched to a solid color, so we should end up with no tilings. | 4365 // We've switched to a solid color, so we should end up with no tilings. |
4369 ASSERT_TRUE(active_layer_->tilings()); | 4366 ASSERT_TRUE(active_layer_->tilings()); |
4370 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); | 4367 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); |
4371 } | 4368 } |
4372 | 4369 |
4373 } // namespace | 4370 } // namespace |
4374 } // namespace cc | 4371 } // namespace cc |
OLD | NEW |