| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/test/compositor/blimp_compositor_with_fake_host.h" | 5 #include "blimp/client/test/compositor/blimp_compositor_with_fake_host.h" |
| 6 | 6 |
| 7 #include "cc/animation/animation_host.h" | 7 #include "cc/animation/animation_host.h" |
| 8 #include "cc/proto/compositor_message.pb.h" | 8 #include "cc/proto/compositor_message.pb.h" |
| 9 #include "cc/test/fake_proxy.h" | 9 #include "cc/test/fake_proxy.h" |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 std::unique_ptr<cc::proto::CompositorMessage> | 32 std::unique_ptr<cc::proto::CompositorMessage> |
| 33 BlimpCompositorWithFakeHost::CreateFakeUpdate( | 33 BlimpCompositorWithFakeHost::CreateFakeUpdate( |
| 34 scoped_refptr<cc::Layer> root_layer) { | 34 scoped_refptr<cc::Layer> root_layer) { |
| 35 std::unique_ptr<cc::proto::CompositorMessage> message = | 35 std::unique_ptr<cc::proto::CompositorMessage> message = |
| 36 base::MakeUnique<cc::proto::CompositorMessage>(); | 36 base::MakeUnique<cc::proto::CompositorMessage>(); |
| 37 message->set_client_state_update_ack(false); | 37 message->set_client_state_update_ack(false); |
| 38 cc::LayerTree* layer_tree = host()->GetLayerTree(); | 38 cc::LayerTree* layer_tree = host()->GetLayerTree(); |
| 39 layer_tree->SetRootLayer(root_layer); | 39 layer_tree->SetRootLayer(root_layer); |
| 40 cc::proto::LayerTree* layer_tree_proto = | 40 cc::proto::LayerTree* layer_tree_proto = |
| 41 message->mutable_layer_tree_host()->mutable_layer_tree(); | 41 message->mutable_layer_tree_host()->mutable_layer_tree(); |
| 42 layer_tree->ToProtobuf(layer_tree_proto, true); | 42 layer_tree->ToProtobuf(layer_tree_proto); |
| 43 return message; | 43 return message; |
| 44 } | 44 } |
| 45 | 45 |
| 46 std::unique_ptr<cc::LayerTreeHostInProcess> | 46 std::unique_ptr<cc::LayerTreeHostInProcess> |
| 47 BlimpCompositorWithFakeHost::CreateLayerTreeHost() { | 47 BlimpCompositorWithFakeHost::CreateLayerTreeHost() { |
| 48 DCHECK(animation_host()); | 48 DCHECK(animation_host()); |
| 49 | 49 |
| 50 cc::LayerTreeSettings settings; | 50 cc::LayerTreeSettings settings; |
| 51 std::unique_ptr<cc::FakeLayerTreeHost> host = cc::FakeLayerTreeHost::Create( | 51 std::unique_ptr<cc::FakeLayerTreeHost> host = cc::FakeLayerTreeHost::Create( |
| 52 &fake_client_, &task_graph_runner_, animation_host(), settings, | 52 &fake_client_, &task_graph_runner_, animation_host(), settings, |
| 53 cc::CompositorMode::THREADED); | 53 cc::CompositorMode::THREADED); |
| 54 host->InitializeForTesting( | 54 host->InitializeForTesting( |
| 55 cc::TaskRunnerProvider::Create(base::ThreadTaskRunnerHandle::Get(), | 55 cc::TaskRunnerProvider::Create(base::ThreadTaskRunnerHandle::Get(), |
| 56 base::ThreadTaskRunnerHandle::Get()), | 56 base::ThreadTaskRunnerHandle::Get()), |
| 57 base::MakeUnique<cc::FakeProxy>()); | 57 base::MakeUnique<cc::FakeProxy>()); |
| 58 fake_host_ = host.get(); | 58 fake_host_ = host.get(); |
| 59 return std::move(host); | 59 return std::move(host); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace client | 62 } // namespace client |
| 63 } // namespace blimp | 63 } // namespace blimp |
| OLD | NEW |