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 4491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4502 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 4502 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
4503 | 4503 |
4504 gfx::Size tile_size(100, 100); | 4504 gfx::Size tile_size(100, 100); |
4505 gfx::Size layer_bounds(200, 200); | 4505 gfx::Size layer_bounds(200, 200); |
4506 gfx::Rect layer_rect(layer_bounds); | 4506 gfx::Rect layer_rect(layer_bounds); |
4507 | 4507 |
4508 FakeContentLayerClient client; | 4508 FakeContentLayerClient client; |
4509 scoped_refptr<PictureLayer> layer = | 4509 scoped_refptr<PictureLayer> layer = |
4510 PictureLayer::Create(layer_settings_, &client); | 4510 PictureLayer::Create(layer_settings_, &client); |
4511 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | 4511 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
4512 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); | 4512 TestTaskGraphRunner task_graph_runner; |
| 4513 scoped_ptr<FakeLayerTreeHost> host = |
| 4514 FakeLayerTreeHost::Create(&host_client, &task_graph_runner); |
4513 host->SetRootLayer(layer); | 4515 host->SetRootLayer(layer); |
4514 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); | 4516 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); |
4515 | 4517 |
4516 int frame_number = 0; | 4518 int frame_number = 0; |
4517 | 4519 |
4518 client.set_fill_with_nonsolid_color(!test_for_solid); | 4520 client.set_fill_with_nonsolid_color(!test_for_solid); |
4519 | 4521 |
4520 Region invalidation(layer_rect); | 4522 Region invalidation(layer_rect); |
4521 recording_source->UpdateAndExpandInvalidation( | 4523 recording_source->UpdateAndExpandInvalidation( |
4522 &client, &invalidation, layer_bounds, layer_rect, frame_number++, | 4524 &client, &invalidation, layer_bounds, layer_rect, frame_number++, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4563 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); | 4565 host_impl_.AdvanceToNextFrame(base::TimeDelta::FromMilliseconds(1)); |
4564 | 4566 |
4565 gfx::Size tile_size(100, 100); | 4567 gfx::Size tile_size(100, 100); |
4566 gfx::Size layer_bounds(200, 200); | 4568 gfx::Size layer_bounds(200, 200); |
4567 gfx::Rect layer_rect(layer_bounds); | 4569 gfx::Rect layer_rect(layer_bounds); |
4568 | 4570 |
4569 FakeContentLayerClient client; | 4571 FakeContentLayerClient client; |
4570 scoped_refptr<PictureLayer> layer = | 4572 scoped_refptr<PictureLayer> layer = |
4571 PictureLayer::Create(layer_settings_, &client); | 4573 PictureLayer::Create(layer_settings_, &client); |
4572 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); | 4574 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
4573 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); | 4575 TestTaskGraphRunner task_graph_runner; |
| 4576 scoped_ptr<FakeLayerTreeHost> host = |
| 4577 FakeLayerTreeHost::Create(&host_client, &task_graph_runner); |
4574 host->SetRootLayer(layer); | 4578 host->SetRootLayer(layer); |
4575 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); | 4579 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); |
4576 | 4580 |
4577 int frame_number = 0; | 4581 int frame_number = 0; |
4578 | 4582 |
4579 client.set_fill_with_nonsolid_color(true); | 4583 client.set_fill_with_nonsolid_color(true); |
4580 | 4584 |
4581 Region invalidation1(layer_rect); | 4585 Region invalidation1(layer_rect); |
4582 recording_source->UpdateAndExpandInvalidation( | 4586 recording_source->UpdateAndExpandInvalidation( |
4583 &client, &invalidation1, layer_bounds, layer_rect, frame_number++, | 4587 &client, &invalidation1, layer_bounds, layer_rect, frame_number++, |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4979 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 4983 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
4980 EXPECT_EQ(result.width(), 448); | 4984 EXPECT_EQ(result.width(), 448); |
4981 EXPECT_EQ(result.height(), 448); | 4985 EXPECT_EQ(result.height(), 448); |
4982 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 4986 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
4983 EXPECT_EQ(result.width(), 512); | 4987 EXPECT_EQ(result.width(), 512); |
4984 EXPECT_EQ(result.height(), 500 + 2); | 4988 EXPECT_EQ(result.height(), 500 + 2); |
4985 } | 4989 } |
4986 | 4990 |
4987 } // namespace | 4991 } // namespace |
4988 } // namespace cc | 4992 } // namespace cc |
OLD | NEW |