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