| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 root_id_(6), | 117 root_id_(6), |
| 118 id_(7) { | 118 id_(7) { |
| 119 host_impl_.SetViewportSize(gfx::Size(10000, 10000)); | 119 host_impl_.SetViewportSize(gfx::Size(10000, 10000)); |
| 120 } | 120 } |
| 121 | 121 |
| 122 ~PictureLayerImplTest() override {} | 122 ~PictureLayerImplTest() override {} |
| 123 | 123 |
| 124 void SetUp() override { InitializeRenderer(); } | 124 void SetUp() override { InitializeRenderer(); } |
| 125 | 125 |
| 126 virtual void InitializeRenderer() { | 126 virtual void InitializeRenderer() { |
| 127 host_impl_.SetVisible(true); |
| 127 host_impl_.InitializeRenderer(output_surface_.get()); | 128 host_impl_.InitializeRenderer(output_surface_.get()); |
| 128 } | 129 } |
| 129 | 130 |
| 130 void SetupDefaultTrees(const gfx::Size& layer_bounds) { | 131 void SetupDefaultTrees(const gfx::Size& layer_bounds) { |
| 131 scoped_refptr<FakeDisplayListRasterSource> pending_raster_source = | 132 scoped_refptr<FakeDisplayListRasterSource> pending_raster_source = |
| 132 FakeDisplayListRasterSource::CreateFilled(layer_bounds); | 133 FakeDisplayListRasterSource::CreateFilled(layer_bounds); |
| 133 scoped_refptr<FakeDisplayListRasterSource> active_raster_source = | 134 scoped_refptr<FakeDisplayListRasterSource> active_raster_source = |
| 134 FakeDisplayListRasterSource::CreateFilled(layer_bounds); | 135 FakeDisplayListRasterSource::CreateFilled(layer_bounds); |
| 135 | 136 |
| 136 SetupTrees(pending_raster_source, active_raster_source); | 137 SetupTrees(pending_raster_source, active_raster_source); |
| (...skipping 3644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3781 ->visible_quad_layer_rect.ToString()); | 3782 ->visible_quad_layer_rect.ToString()); |
| 3782 } | 3783 } |
| 3783 | 3784 |
| 3784 class PictureLayerImplTestWithDelegatingRenderer : public PictureLayerImplTest { | 3785 class PictureLayerImplTestWithDelegatingRenderer : public PictureLayerImplTest { |
| 3785 public: | 3786 public: |
| 3786 PictureLayerImplTestWithDelegatingRenderer() : PictureLayerImplTest() { | 3787 PictureLayerImplTestWithDelegatingRenderer() : PictureLayerImplTest() { |
| 3787 output_surface_ = FakeOutputSurface::CreateDelegating3d(); | 3788 output_surface_ = FakeOutputSurface::CreateDelegating3d(); |
| 3788 } | 3789 } |
| 3789 | 3790 |
| 3790 void InitializeRenderer() override { | 3791 void InitializeRenderer() override { |
| 3792 host_impl_.SetVisible(true); |
| 3791 host_impl_.InitializeRenderer(output_surface_.get()); | 3793 host_impl_.InitializeRenderer(output_surface_.get()); |
| 3792 } | 3794 } |
| 3793 }; | 3795 }; |
| 3794 | 3796 |
| 3795 TEST_F(PictureLayerImplTestWithDelegatingRenderer, | 3797 TEST_F(PictureLayerImplTestWithDelegatingRenderer, |
| 3796 DelegatingRendererWithTileOOM) { | 3798 DelegatingRendererWithTileOOM) { |
| 3797 // This test is added for crbug.com/402321, where quad should be produced when | 3799 // This test is added for crbug.com/402321, where quad should be produced when |
| 3798 // raster on demand is not allowed and tile is OOM. | 3800 // raster on demand is not allowed and tile is OOM. |
| 3799 gfx::Size layer_bounds(1000, 1000); | 3801 gfx::Size layer_bounds(1000, 1000); |
| 3800 | 3802 |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4991 // New low res tiling. | 4993 // New low res tiling. |
| 4992 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 4994 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
| 4993 | 4995 |
| 4994 // This tiling will be high res now, it won't contain low res content since it | 4996 // This tiling will be high res now, it won't contain low res content since it |
| 4995 // was all destroyed. | 4997 // was all destroyed. |
| 4996 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 4998 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
| 4997 } | 4999 } |
| 4998 | 5000 |
| 4999 } // namespace | 5001 } // namespace |
| 5000 } // namespace cc | 5002 } // namespace cc |
| OLD | NEW |