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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 host_impl_.settings().default_tile_size.ToString()); | 795 host_impl_.settings().default_tile_size.ToString()); |
796 | 796 |
797 Tile* tile = pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0]; | 797 Tile* tile = pending_layer_->tilings()->tiling_at(0)->AllTilesForTesting()[0]; |
798 EXPECT_EQ(gfx::Size(256, 256).ToString(), | 798 EXPECT_EQ(gfx::Size(256, 256).ToString(), |
799 tile->content_rect().size().ToString()); | 799 tile->content_rect().size().ToString()); |
800 | 800 |
801 pending_layer_->DidLoseOutputSurface(); | 801 pending_layer_->DidLoseOutputSurface(); |
802 | 802 |
803 // Change the max texture size on the output surface context. | 803 // Change the max texture size on the output surface context. |
804 scoped_ptr<TestWebGraphicsContext3D> context = | 804 scoped_ptr<TestWebGraphicsContext3D> context = |
805 TestWebGraphicsContext3D::Create(); | 805 TestWebGraphicsContext3D::CreateShared(); |
806 context->set_max_texture_size(140); | 806 context->set_max_texture_size(140); |
807 host_impl_.InitializeRenderer(FakeOutputSurface::Create3d( | 807 host_impl_.InitializeRenderer(FakeOutputSurface::Create3d( |
808 context.PassAs<WebKit::WebGraphicsContext3D>()).PassAs<OutputSurface>()); | 808 context.PassAs<WebKit::WebGraphicsContext3D>()).PassAs<OutputSurface>()); |
809 | 809 |
810 pending_layer_->CalculateContentsScale( | 810 pending_layer_->CalculateContentsScale( |
811 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); | 811 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
812 ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); | 812 ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); |
813 | 813 |
814 pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting(); | 814 pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting(); |
815 | 815 |
(...skipping 30 matching lines...) Expand all Loading... |
846 host_impl_.settings().max_untiled_layer_size.ToString()); | 846 host_impl_.settings().max_untiled_layer_size.ToString()); |
847 | 847 |
848 // There should be a single tile since the layer is small. | 848 // There should be a single tile since the layer is small. |
849 PictureLayerTiling* high_res_tiling = pending_layer_->tilings()->tiling_at(0); | 849 PictureLayerTiling* high_res_tiling = pending_layer_->tilings()->tiling_at(0); |
850 EXPECT_EQ(1u, high_res_tiling->AllTilesForTesting().size()); | 850 EXPECT_EQ(1u, high_res_tiling->AllTilesForTesting().size()); |
851 | 851 |
852 pending_layer_->DidLoseOutputSurface(); | 852 pending_layer_->DidLoseOutputSurface(); |
853 | 853 |
854 // Change the max texture size on the output surface context. | 854 // Change the max texture size on the output surface context. |
855 scoped_ptr<TestWebGraphicsContext3D> context = | 855 scoped_ptr<TestWebGraphicsContext3D> context = |
856 TestWebGraphicsContext3D::Create(); | 856 TestWebGraphicsContext3D::CreateShared(); |
857 context->set_max_texture_size(140); | 857 context->set_max_texture_size(140); |
858 host_impl_.InitializeRenderer(FakeOutputSurface::Create3d( | 858 host_impl_.InitializeRenderer(FakeOutputSurface::Create3d( |
859 context.PassAs<WebKit::WebGraphicsContext3D>()).PassAs<OutputSurface>()); | 859 context.PassAs<WebKit::WebGraphicsContext3D>()).PassAs<OutputSurface>()); |
860 | 860 |
861 pending_layer_->CalculateContentsScale( | 861 pending_layer_->CalculateContentsScale( |
862 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); | 862 1.f, 1.f, 1.f, false, &result_scale_x, &result_scale_y, &result_bounds); |
863 ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); | 863 ASSERT_EQ(2u, pending_layer_->tilings()->num_tilings()); |
864 | 864 |
865 pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting(); | 865 pending_layer_->tilings()->tiling_at(0)->CreateAllTilesForTesting(); |
866 | 866 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 num_offscreen++; | 985 num_offscreen++; |
986 } | 986 } |
987 } | 987 } |
988 | 988 |
989 EXPECT_GT(num_visible, 0); | 989 EXPECT_GT(num_visible, 0); |
990 EXPECT_GT(num_offscreen, 0); | 990 EXPECT_GT(num_offscreen, 0); |
991 } | 991 } |
992 | 992 |
993 } // namespace | 993 } // namespace |
994 } // namespace cc | 994 } // namespace cc |
OLD | NEW |