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.h" | 5 #include "cc/layers/picture_layer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 | 455 |
456 // PicturePile uses the source frame number as a unit for measuring invalidation | 456 // PicturePile uses the source frame number as a unit for measuring invalidation |
457 // frequency. When a pile moves between compositors, the frame number increases | 457 // frequency. When a pile moves between compositors, the frame number increases |
458 // non-monotonically. This executes that code path under this scenario allowing | 458 // non-monotonically. This executes that code path under this scenario allowing |
459 // for the code to verify correctness with DCHECKs. | 459 // for the code to verify correctness with DCHECKs. |
460 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { | 460 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { |
461 LayerTreeSettings settings; | 461 LayerTreeSettings settings; |
462 settings.single_thread_proxy_scheduler = false; | 462 settings.single_thread_proxy_scheduler = false; |
463 settings.use_zero_copy = true; | 463 settings.use_zero_copy = true; |
464 settings.verify_clip_tree_calculations = true; | 464 settings.verify_clip_tree_calculations = true; |
| 465 settings.verify_transform_tree_calculations = true; |
465 | 466 |
466 FakeLayerTreeHostClient host_client1(FakeLayerTreeHostClient::DIRECT_3D); | 467 FakeLayerTreeHostClient host_client1(FakeLayerTreeHostClient::DIRECT_3D); |
467 FakeLayerTreeHostClient host_client2(FakeLayerTreeHostClient::DIRECT_3D); | 468 FakeLayerTreeHostClient host_client2(FakeLayerTreeHostClient::DIRECT_3D); |
468 TestSharedBitmapManager shared_bitmap_manager; | 469 TestSharedBitmapManager shared_bitmap_manager; |
469 TestTaskGraphRunner task_graph_runner; | 470 TestTaskGraphRunner task_graph_runner; |
470 | 471 |
471 ContentLayerClient* client = EmptyContentLayerClient::GetInstance(); | 472 ContentLayerClient* client = EmptyContentLayerClient::GetInstance(); |
472 scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(client); | 473 scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(client); |
473 | 474 |
474 LayerTreeHost::InitParams params; | 475 LayerTreeHost::InitParams params; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 // Do a main frame, record the picture layers. The frame number has changed | 521 // Do a main frame, record the picture layers. The frame number has changed |
521 // non-monotonically. | 522 // non-monotonically. |
522 layer->SetNeedsDisplay(); | 523 layer->SetNeedsDisplay(); |
523 host2->Composite(base::TimeTicks::Now()); | 524 host2->Composite(base::TimeTicks::Now()); |
524 EXPECT_EQ(3, layer->update_count()); | 525 EXPECT_EQ(3, layer->update_count()); |
525 EXPECT_EQ(1, host2->source_frame_number()); | 526 EXPECT_EQ(1, host2->source_frame_number()); |
526 } | 527 } |
527 | 528 |
528 } // namespace | 529 } // namespace |
529 } // namespace cc | 530 } // namespace cc |
OLD | NEW |