| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 layer_tree_host_->SetRootLayer(nullptr); | 44 layer_tree_host_->SetRootLayer(nullptr); |
| 45 layer_tree_host_ = nullptr; | 45 layer_tree_host_ = nullptr; |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 FakeLayerTreeHostClient fake_client_; | 49 FakeLayerTreeHostClient fake_client_; |
| 50 TestTaskGraphRunner task_graph_runner_; | 50 TestTaskGraphRunner task_graph_runner_; |
| 51 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_; | 51 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 void SatisfyCallback(SurfaceSequence* out, SurfaceSequence in) { | 54 void SatisfyCallback(SurfaceSequence* out, const SurfaceSequence& in) { |
| 55 *out = in; | 55 *out = in; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void RequireCallback(SurfaceId* out_id, | 58 void RequireCallback(SurfaceId* out_id, |
| 59 std::set<SurfaceSequence>* out, | 59 std::set<SurfaceSequence>* out, |
| 60 SurfaceId in_id, | 60 const SurfaceId& in_id, |
| 61 SurfaceSequence in) { | 61 const SurfaceSequence& in) { |
| 62 *out_id = in_id; | 62 *out_id = in_id; |
| 63 out->insert(in); | 63 out->insert(in); |
| 64 } | 64 } |
| 65 | 65 |
| 66 // Check that one surface can be referenced by multiple LayerTreeHosts, and | 66 // Check that one surface can be referenced by multiple LayerTreeHosts, and |
| 67 // each will create its own SurfaceSequence that's satisfied on destruction. | 67 // each will create its own SurfaceSequence that's satisfied on destruction. |
| 68 TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) { | 68 TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) { |
| 69 SurfaceSequence blank_change; // Receives sequence if commit doesn't happen. | 69 SurfaceSequence blank_change; // Receives sequence if commit doesn't happen. |
| 70 | 70 |
| 71 SurfaceId required_id; | 71 SurfaceId required_id; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 EXPECT_EQ(1u, required_set_.size()); | 253 EXPECT_EQ(1u, required_set_.size()); |
| 254 // Sequence should have been satisfied with the callback. | 254 // Sequence should have been satisfied with the callback. |
| 255 EXPECT_TRUE(satisfied_sequence_ == SurfaceSequence(1u, 1u)); | 255 EXPECT_TRUE(satisfied_sequence_ == SurfaceSequence(1u, 1u)); |
| 256 } | 256 } |
| 257 }; | 257 }; |
| 258 | 258 |
| 259 MULTI_THREAD_TEST_F(SurfaceLayerSwapPromiseWithoutDraw); | 259 MULTI_THREAD_TEST_F(SurfaceLayerSwapPromiseWithoutDraw); |
| 260 | 260 |
| 261 } // namespace | 261 } // namespace |
| 262 } // namespace cc | 262 } // namespace cc |
| OLD | NEW |