| 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 4278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4633 base::TimeTicks time_ticks; | 4634 base::TimeTicks time_ticks; |
| 4634 time_ticks += base::TimeDelta::FromMilliseconds(1); | 4635 time_ticks += base::TimeDelta::FromMilliseconds(1); |
| 4635 host_impl_.SetCurrentBeginFrameArgs( | 4636 host_impl_.SetCurrentBeginFrameArgs( |
| 4636 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 4637 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| 4637 | 4638 |
| 4638 gfx::Size tile_size(100, 100); | 4639 gfx::Size tile_size(100, 100); |
| 4639 gfx::Size layer_bounds(200, 200); | 4640 gfx::Size layer_bounds(200, 200); |
| 4640 gfx::Rect layer_rect(layer_bounds); | 4641 gfx::Rect layer_rect(layer_bounds); |
| 4641 | 4642 |
| 4642 FakeContentLayerClient client; | 4643 FakeContentLayerClient client; |
| 4643 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 4644 scoped_refptr<PictureLayer> layer = |
| 4645 PictureLayer::Create(layer_settings_, &client); |
| 4644 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | 4646 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
| 4645 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); | 4647 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); |
| 4646 host->SetRootLayer(layer); | 4648 host->SetRootLayer(layer); |
| 4647 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); | 4649 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); |
| 4648 | 4650 |
| 4649 int frame_number = 0; | 4651 int frame_number = 0; |
| 4650 | 4652 |
| 4651 client.set_fill_with_nonsolid_color(!test_for_solid); | 4653 client.set_fill_with_nonsolid_color(!test_for_solid); |
| 4652 | 4654 |
| 4653 Region invalidation(layer_rect); | 4655 Region invalidation(layer_rect); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4696 base::TimeTicks time_ticks; | 4698 base::TimeTicks time_ticks; |
| 4697 time_ticks += base::TimeDelta::FromMilliseconds(1); | 4699 time_ticks += base::TimeDelta::FromMilliseconds(1); |
| 4698 host_impl_.SetCurrentBeginFrameArgs( | 4700 host_impl_.SetCurrentBeginFrameArgs( |
| 4699 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 4701 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
| 4700 | 4702 |
| 4701 gfx::Size tile_size(100, 100); | 4703 gfx::Size tile_size(100, 100); |
| 4702 gfx::Size layer_bounds(200, 200); | 4704 gfx::Size layer_bounds(200, 200); |
| 4703 gfx::Rect layer_rect(layer_bounds); | 4705 gfx::Rect layer_rect(layer_bounds); |
| 4704 | 4706 |
| 4705 FakeContentLayerClient client; | 4707 FakeContentLayerClient client; |
| 4706 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 4708 scoped_refptr<PictureLayer> layer = |
| 4709 PictureLayer::Create(layer_settings_, &client); |
| 4707 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | 4710 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
| 4708 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); | 4711 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); |
| 4709 host->SetRootLayer(layer); | 4712 host->SetRootLayer(layer); |
| 4710 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); | 4713 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); |
| 4711 | 4714 |
| 4712 int frame_number = 0; | 4715 int frame_number = 0; |
| 4713 | 4716 |
| 4714 client.set_fill_with_nonsolid_color(true); | 4717 client.set_fill_with_nonsolid_color(true); |
| 4715 | 4718 |
| 4716 Region invalidation1(layer_rect); | 4719 Region invalidation1(layer_rect); |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5082 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 5085 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
| 5083 EXPECT_EQ(result.width(), 448); | 5086 EXPECT_EQ(result.width(), 448); |
| 5084 EXPECT_EQ(result.height(), 448); | 5087 EXPECT_EQ(result.height(), 448); |
| 5085 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 5088 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
| 5086 EXPECT_EQ(result.width(), 512); | 5089 EXPECT_EQ(result.width(), 512); |
| 5087 EXPECT_EQ(result.height(), 500 + 2); | 5090 EXPECT_EQ(result.height(), 500 + 2); |
| 5088 } | 5091 } |
| 5089 | 5092 |
| 5090 } // namespace | 5093 } // namespace |
| 5091 } // namespace cc | 5094 } // namespace cc |
| OLD | NEW |