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 4215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4226 time_ticks += base::TimeDelta::FromMilliseconds(1); | 4226 time_ticks += base::TimeDelta::FromMilliseconds(1); |
4227 host_impl_.SetCurrentBeginFrameArgs( | 4227 host_impl_.SetCurrentBeginFrameArgs( |
4228 CreateBeginFrameArgsForTesting(time_ticks)); | 4228 CreateBeginFrameArgsForTesting(time_ticks)); |
4229 | 4229 |
4230 gfx::Size tile_size(100, 100); | 4230 gfx::Size tile_size(100, 100); |
4231 gfx::Size layer_bounds(200, 200); | 4231 gfx::Size layer_bounds(200, 200); |
4232 gfx::Rect layer_rect(layer_bounds); | 4232 gfx::Rect layer_rect(layer_bounds); |
4233 | 4233 |
4234 FakeContentLayerClient client; | 4234 FakeContentLayerClient client; |
4235 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 4235 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); |
4236 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4236 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
| 4237 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); |
4237 host->SetRootLayer(layer); | 4238 host->SetRootLayer(layer); |
4238 PicturePile* pile = layer->GetPicturePileForTesting(); | 4239 PicturePile* pile = layer->GetPicturePileForTesting(); |
4239 | 4240 |
4240 host_impl_.SetViewportSize(layer_bounds); | 4241 host_impl_.SetViewportSize(layer_bounds); |
4241 | 4242 |
4242 int frame_number = 0; | 4243 int frame_number = 0; |
4243 FakeRenderingStatsInstrumentation stats_instrumentation; | 4244 FakeRenderingStatsInstrumentation stats_instrumentation; |
4244 | 4245 |
4245 client.set_fill_with_nonsolid_color(!test_for_solid); | 4246 client.set_fill_with_nonsolid_color(!test_for_solid); |
4246 | 4247 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4301 time_ticks += base::TimeDelta::FromMilliseconds(1); | 4302 time_ticks += base::TimeDelta::FromMilliseconds(1); |
4302 host_impl_.SetCurrentBeginFrameArgs( | 4303 host_impl_.SetCurrentBeginFrameArgs( |
4303 CreateBeginFrameArgsForTesting(time_ticks)); | 4304 CreateBeginFrameArgsForTesting(time_ticks)); |
4304 | 4305 |
4305 gfx::Size tile_size(100, 100); | 4306 gfx::Size tile_size(100, 100); |
4306 gfx::Size layer_bounds(200, 200); | 4307 gfx::Size layer_bounds(200, 200); |
4307 gfx::Rect layer_rect(layer_bounds); | 4308 gfx::Rect layer_rect(layer_bounds); |
4308 | 4309 |
4309 FakeContentLayerClient client; | 4310 FakeContentLayerClient client; |
4310 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 4311 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); |
4311 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4312 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
| 4313 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); |
4312 host->SetRootLayer(layer); | 4314 host->SetRootLayer(layer); |
4313 PicturePile* pile = layer->GetPicturePileForTesting(); | 4315 PicturePile* pile = layer->GetPicturePileForTesting(); |
4314 | 4316 |
4315 host_impl_.SetViewportSize(layer_bounds); | 4317 host_impl_.SetViewportSize(layer_bounds); |
4316 | 4318 |
4317 int frame_number = 0; | 4319 int frame_number = 0; |
4318 FakeRenderingStatsInstrumentation stats_instrumentation; | 4320 FakeRenderingStatsInstrumentation stats_instrumentation; |
4319 | 4321 |
4320 client.set_fill_with_nonsolid_color(true); | 4322 client.set_fill_with_nonsolid_color(true); |
4321 | 4323 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4362 SetupPendingTree(pending_pile2); | 4364 SetupPendingTree(pending_pile2); |
4363 ActivateTree(); | 4365 ActivateTree(); |
4364 | 4366 |
4365 // We've switched to a solid color, so we should end up with no tilings. | 4367 // We've switched to a solid color, so we should end up with no tilings. |
4366 ASSERT_TRUE(active_layer_->tilings()); | 4368 ASSERT_TRUE(active_layer_->tilings()); |
4367 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); | 4369 EXPECT_EQ(0u, active_layer_->tilings()->num_tilings()); |
4368 } | 4370 } |
4369 | 4371 |
4370 } // namespace | 4372 } // namespace |
4371 } // namespace cc | 4373 } // namespace cc |
OLD | NEW |