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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 FakeImplProxy proxy_; | 336 FakeImplProxy proxy_; |
337 TestSharedBitmapManager shared_bitmap_manager_; | 337 TestSharedBitmapManager shared_bitmap_manager_; |
338 TestTaskGraphRunner task_graph_runner_; | 338 TestTaskGraphRunner task_graph_runner_; |
339 FakeLayerTreeHostImpl host_impl_; | 339 FakeLayerTreeHostImpl host_impl_; |
340 int root_id_; | 340 int root_id_; |
341 int id_; | 341 int id_; |
342 FakePictureLayerImpl* pending_layer_; | 342 FakePictureLayerImpl* pending_layer_; |
343 FakePictureLayerImpl* old_pending_layer_; | 343 FakePictureLayerImpl* old_pending_layer_; |
344 FakePictureLayerImpl* active_layer_; | 344 FakePictureLayerImpl* active_layer_; |
| 345 LayerSettings layer_settings_; |
345 | 346 |
346 private: | 347 private: |
347 DISALLOW_COPY_AND_ASSIGN(PictureLayerImplTest); | 348 DISALLOW_COPY_AND_ASSIGN(PictureLayerImplTest); |
348 }; | 349 }; |
349 | 350 |
350 class NoLowResPictureLayerImplTest : public PictureLayerImplTest { | 351 class NoLowResPictureLayerImplTest : public PictureLayerImplTest { |
351 public: | 352 public: |
352 NoLowResPictureLayerImplTest() | 353 NoLowResPictureLayerImplTest() |
353 : PictureLayerImplTest(NoLowResTilingsSettings()) {} | 354 : PictureLayerImplTest(NoLowResTilingsSettings()) {} |
354 }; | 355 }; |
(...skipping 4251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4606 base::TimeTicks time_ticks; | 4607 base::TimeTicks time_ticks; |
4607 time_ticks += base::TimeDelta::FromMilliseconds(1); | 4608 time_ticks += base::TimeDelta::FromMilliseconds(1); |
4608 host_impl_.SetCurrentBeginFrameArgs( | 4609 host_impl_.SetCurrentBeginFrameArgs( |
4609 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 4610 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
4610 | 4611 |
4611 gfx::Size tile_size(100, 100); | 4612 gfx::Size tile_size(100, 100); |
4612 gfx::Size layer_bounds(200, 200); | 4613 gfx::Size layer_bounds(200, 200); |
4613 gfx::Rect layer_rect(layer_bounds); | 4614 gfx::Rect layer_rect(layer_bounds); |
4614 | 4615 |
4615 FakeContentLayerClient client; | 4616 FakeContentLayerClient client; |
4616 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 4617 scoped_refptr<PictureLayer> layer = |
| 4618 PictureLayer::Create(layer_settings_, &client); |
4617 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | 4619 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
4618 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); | 4620 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); |
4619 host->SetRootLayer(layer); | 4621 host->SetRootLayer(layer); |
4620 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); | 4622 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); |
4621 | 4623 |
4622 int frame_number = 0; | 4624 int frame_number = 0; |
4623 | 4625 |
4624 client.set_fill_with_nonsolid_color(!test_for_solid); | 4626 client.set_fill_with_nonsolid_color(!test_for_solid); |
4625 | 4627 |
4626 Region invalidation(layer_rect); | 4628 Region invalidation(layer_rect); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4669 base::TimeTicks time_ticks; | 4671 base::TimeTicks time_ticks; |
4670 time_ticks += base::TimeDelta::FromMilliseconds(1); | 4672 time_ticks += base::TimeDelta::FromMilliseconds(1); |
4671 host_impl_.SetCurrentBeginFrameArgs( | 4673 host_impl_.SetCurrentBeginFrameArgs( |
4672 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 4674 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
4673 | 4675 |
4674 gfx::Size tile_size(100, 100); | 4676 gfx::Size tile_size(100, 100); |
4675 gfx::Size layer_bounds(200, 200); | 4677 gfx::Size layer_bounds(200, 200); |
4676 gfx::Rect layer_rect(layer_bounds); | 4678 gfx::Rect layer_rect(layer_bounds); |
4677 | 4679 |
4678 FakeContentLayerClient client; | 4680 FakeContentLayerClient client; |
4679 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 4681 scoped_refptr<PictureLayer> layer = |
| 4682 PictureLayer::Create(layer_settings_, &client); |
4680 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | 4683 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
4681 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); | 4684 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); |
4682 host->SetRootLayer(layer); | 4685 host->SetRootLayer(layer); |
4683 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); | 4686 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); |
4684 | 4687 |
4685 int frame_number = 0; | 4688 int frame_number = 0; |
4686 | 4689 |
4687 client.set_fill_with_nonsolid_color(true); | 4690 client.set_fill_with_nonsolid_color(true); |
4688 | 4691 |
4689 Region invalidation1(layer_rect); | 4692 Region invalidation1(layer_rect); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5099 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 5102 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
5100 EXPECT_EQ(result.width(), 448); | 5103 EXPECT_EQ(result.width(), 448); |
5101 EXPECT_EQ(result.height(), 448); | 5104 EXPECT_EQ(result.height(), 448); |
5102 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 5105 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
5103 EXPECT_EQ(result.width(), 512); | 5106 EXPECT_EQ(result.width(), 512); |
5104 EXPECT_EQ(result.height(), 500 + 2); | 5107 EXPECT_EQ(result.height(), 500 + 2); |
5105 } | 5108 } |
5106 | 5109 |
5107 } // namespace | 5110 } // namespace |
5108 } // namespace cc | 5111 } // namespace cc |
OLD | NEW |