| 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 "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "cc/layers/content_layer_client.h" | 8 #include "cc/layers/content_layer_client.h" |
| 9 #include "cc/layers/picture_layer_impl.h" | 9 #include "cc/layers/picture_layer_impl.h" |
| 10 #include "cc/test/fake_layer_tree_host.h" | 10 #include "cc/test/fake_layer_tree_host.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 // PicturePile uses the source frame number as a unit for measuring invalidation | 120 // PicturePile uses the source frame number as a unit for measuring invalidation |
| 121 // frequency. When a pile moves between compositors, the frame number increases | 121 // frequency. When a pile moves between compositors, the frame number increases |
| 122 // non-monotonically. This executes that code path under this scenario allowing | 122 // non-monotonically. This executes that code path under this scenario allowing |
| 123 // for the code to verify correctness with DCHECKs. | 123 // for the code to verify correctness with DCHECKs. |
| 124 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { | 124 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { |
| 125 LayerTreeSettings settings; | 125 LayerTreeSettings settings; |
| 126 settings.single_thread_proxy_scheduler = false; | 126 settings.single_thread_proxy_scheduler = false; |
| 127 settings.use_zero_copy = true; | 127 settings.use_zero_copy = true; |
| 128 settings.use_one_copy = false; | |
| 129 | 128 |
| 130 FakeLayerTreeHostClient host_client1(FakeLayerTreeHostClient::DIRECT_3D); | 129 FakeLayerTreeHostClient host_client1(FakeLayerTreeHostClient::DIRECT_3D); |
| 131 FakeLayerTreeHostClient host_client2(FakeLayerTreeHostClient::DIRECT_3D); | 130 FakeLayerTreeHostClient host_client2(FakeLayerTreeHostClient::DIRECT_3D); |
| 132 TestSharedBitmapManager shared_bitmap_manager; | 131 TestSharedBitmapManager shared_bitmap_manager; |
| 133 TestTaskGraphRunner task_graph_runner; | 132 TestTaskGraphRunner task_graph_runner; |
| 134 | 133 |
| 135 MockContentLayerClient client; | 134 MockContentLayerClient client; |
| 136 scoped_refptr<FakePictureLayer> layer = | 135 scoped_refptr<FakePictureLayer> layer = |
| 137 FakePictureLayer::Create(LayerSettings(), &client); | 136 FakePictureLayer::Create(LayerSettings(), &client); |
| 138 | 137 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Do a main frame, record the picture layers. The frame number has changed | 172 // Do a main frame, record the picture layers. The frame number has changed |
| 174 // non-monotonically. | 173 // non-monotonically. |
| 175 layer->SetNeedsDisplay(); | 174 layer->SetNeedsDisplay(); |
| 176 host2->Composite(base::TimeTicks::Now()); | 175 host2->Composite(base::TimeTicks::Now()); |
| 177 EXPECT_EQ(3, layer->update_count()); | 176 EXPECT_EQ(3, layer->update_count()); |
| 178 EXPECT_EQ(1, host2->source_frame_number()); | 177 EXPECT_EQ(1, host2->source_frame_number()); |
| 179 } | 178 } |
| 180 | 179 |
| 181 } // namespace | 180 } // namespace |
| 182 } // namespace cc | 181 } // namespace cc |
| OLD | NEW |