Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: blimp/client/test/compositor/blimp_compositor_with_fake_host.cc

Issue 2445093002: cc/blimp: Add synchronization for scroll/scale state. (Closed)
Patch Set: test compile Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « blimp/client/test/compositor/blimp_compositor_with_fake_host.h ('k') | blimp/engine/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "blimp/client/test/compositor/blimp_compositor_with_fake_host.h"
6
7 #include "cc/proto/compositor_message.pb.h"
8 #include "cc/test/fake_proxy.h"
9
10 namespace blimp {
11 namespace client {
12
13 // static
14 std::unique_ptr<BlimpCompositorWithFakeHost>
15 BlimpCompositorWithFakeHost::Create(
16 BlimpCompositorDependencies* compositor_dependencies,
17 BlimpCompositorClient* client) {
18 std::unique_ptr<BlimpCompositorWithFakeHost> compositor = base::WrapUnique(
19 new BlimpCompositorWithFakeHost(compositor_dependencies, client));
20 compositor->Initialize();
21 return compositor;
22 }
23
24 BlimpCompositorWithFakeHost::BlimpCompositorWithFakeHost(
25 BlimpCompositorDependencies* compositor_dependencies,
26 BlimpCompositorClient* client)
27 : BlimpCompositor(compositor_dependencies, client, true) {}
28
29 BlimpCompositorWithFakeHost::~BlimpCompositorWithFakeHost() = default;
30
31 std::unique_ptr<cc::proto::CompositorMessage>
32 BlimpCompositorWithFakeHost::CreateFakeUpdate(
33 scoped_refptr<cc::Layer> root_layer) {
34 std::unique_ptr<cc::proto::CompositorMessage> message =
35 base::MakeUnique<cc::proto::CompositorMessage>();
36 message->set_client_state_update_ack(false);
37 cc::LayerTree* layer_tree = host()->GetLayerTree();
38 layer_tree->SetRootLayer(root_layer);
39 cc::proto::LayerTree* layer_tree_proto =
40 message->mutable_layer_tree_host()->mutable_layer_tree();
41 layer_tree->ToProtobuf(layer_tree_proto, true);
42 return message;
43 }
44
45 std::unique_ptr<cc::LayerTreeHostInProcess>
46 BlimpCompositorWithFakeHost::CreateLayerTreeHost() {
47 cc::LayerTreeSettings settings;
48 std::unique_ptr<cc::FakeLayerTreeHost> host =
49 cc::FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_,
50 settings, cc::CompositorMode::THREADED);
51 host->InitializeForTesting(
52 cc::TaskRunnerProvider::Create(base::ThreadTaskRunnerHandle::Get(),
53 base::ThreadTaskRunnerHandle::Get()),
54 base::MakeUnique<cc::FakeProxy>());
55 fake_host_ = host.get();
56 return std::move(host);
57 }
58
59 } // namespace client
60 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/test/compositor/blimp_compositor_with_fake_host.h ('k') | blimp/engine/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698