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 "mojo/examples/compositor_app/compositor_host.h" | 5 #include "mojo/examples/compositor_app/compositor_host.h" |
6 | 6 |
7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
8 #include "cc/layers/solid_color_layer.h" | 8 #include "cc/layers/solid_color_layer.h" |
9 #include "cc/output/begin_frame_args.h" | 9 #include "cc/output/begin_frame_args.h" |
10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
11 #include "cc/output/output_surface.h" | 11 #include "cc/output/output_surface.h" |
12 #include "cc/trees/layer_tree_host.h" | 12 #include "cc/trees/layer_tree_host.h" |
13 #include "mojo/cc/context_provider_mojo.h" | 13 #include "mojo/cc/context_provider_mojo.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 namespace examples { | 16 namespace examples { |
17 | 17 |
18 CompositorHost::CompositorHost(ScopedMessagePipeHandle command_buffer_handle) | 18 CompositorHost::CompositorHost(ScopedMessagePipeHandle command_buffer_handle) |
19 : command_buffer_handle_(command_buffer_handle.Pass()), | 19 : command_buffer_handle_(command_buffer_handle.Pass()), |
20 compositor_thread_("compositor") { | 20 compositor_thread_("compositor") { |
21 DCHECK(command_buffer_handle_.is_valid()); | 21 DCHECK(command_buffer_handle_.is_valid()); |
22 bool started = compositor_thread_.Start(); | 22 bool started = compositor_thread_.Start(); |
23 DCHECK(started); | 23 DCHECK(started); |
24 | 24 |
25 cc::LayerTreeSettings settings; | 25 cc::LayerTreeSettings settings; |
26 tree_ = cc::LayerTreeHost::CreateThreaded( | 26 tree_ = cc::LayerTreeHost::CreateThreaded( |
27 this, | 27 this, |
28 NULL, | 28 NULL, |
| 29 NULL, |
29 settings, | 30 settings, |
30 base::MessageLoopProxy::current(), | 31 base::MessageLoopProxy::current(), |
31 compositor_thread_.message_loop_proxy()); | 32 compositor_thread_.message_loop_proxy()); |
32 SetupScene(); | 33 SetupScene(); |
33 } | 34 } |
34 | 35 |
35 CompositorHost::~CompositorHost() {} | 36 CompositorHost::~CompositorHost() {} |
36 | 37 |
37 void CompositorHost::SetSize(const gfx::Size& viewport_size) { | 38 void CompositorHost::SetSize(const gfx::Size& viewport_size) { |
38 tree_->SetViewportSize(viewport_size); | 39 tree_->SetViewportSize(viewport_size); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void CompositorHost::DidInitializeOutputSurface() { | 89 void CompositorHost::DidInitializeOutputSurface() { |
89 } | 90 } |
90 | 91 |
91 void CompositorHost::WillCommit() {} | 92 void CompositorHost::WillCommit() {} |
92 void CompositorHost::DidCommit() {} | 93 void CompositorHost::DidCommit() {} |
93 void CompositorHost::DidCommitAndDrawFrame() {} | 94 void CompositorHost::DidCommitAndDrawFrame() {} |
94 void CompositorHost::DidCompleteSwapBuffers() {} | 95 void CompositorHost::DidCompleteSwapBuffers() {} |
95 | 96 |
96 } // namespace examples | 97 } // namespace examples |
97 } // namespace mojo | 98 } // namespace mojo |
OLD | NEW |