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 "mojo/services/html_viewer/weblayertreeview_impl.h" | 5 #include "mojo/services/html_viewer/weblayertreeview_impl.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "cc/blink/web_layer_impl.h" | 8 #include "cc/blink/web_layer_impl.h" |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/output/begin_frame_args.h" | 10 #include "cc/output/begin_frame_args.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return layer_tree_host_->CommitRequested(); | 213 return layer_tree_host_->CommitRequested(); |
214 } | 214 } |
215 | 215 |
216 void WebLayerTreeViewImpl::finishAllRendering() { | 216 void WebLayerTreeViewImpl::finishAllRendering() { |
217 layer_tree_host_->FinishAllRendering(); | 217 layer_tree_host_->FinishAllRendering(); |
218 } | 218 } |
219 | 219 |
220 void WebLayerTreeViewImpl::OnSurfaceConnectionCreated(SurfacePtr surface, | 220 void WebLayerTreeViewImpl::OnSurfaceConnectionCreated(SurfacePtr surface, |
221 uint32_t id_namespace) { | 221 uint32_t id_namespace) { |
222 CommandBufferPtr cb; | 222 CommandBufferPtr cb; |
223 gpu_service_->CreateOffscreenGLES2Context(Get(&cb)); | 223 gpu_service_->CreateOffscreenGLES2Context(GetProxy(&cb)); |
224 scoped_refptr<cc::ContextProvider> context_provider( | 224 scoped_refptr<cc::ContextProvider> context_provider( |
225 new ContextProviderMojo(cb.PassMessagePipe())); | 225 new ContextProviderMojo(cb.PassMessagePipe())); |
226 output_surface_.reset(new OutputSurfaceMojo( | 226 output_surface_.reset(new OutputSurfaceMojo( |
227 this, context_provider, surface.Pass(), id_namespace)); | 227 this, context_provider, surface.Pass(), id_namespace)); |
228 layer_tree_host_->SetLayerTreeHostClientReady(); | 228 layer_tree_host_->SetLayerTreeHostClientReady(); |
229 } | 229 } |
230 | 230 |
231 void WebLayerTreeViewImpl::DidCreateSurface(cc::SurfaceId id) { | 231 void WebLayerTreeViewImpl::DidCreateSurface(cc::SurfaceId id) { |
232 main_thread_compositor_task_runner_->PostTask( | 232 main_thread_compositor_task_runner_->PostTask( |
233 FROM_HERE, | 233 FROM_HERE, |
234 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, | 234 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, |
235 main_thread_bound_weak_ptr_, | 235 main_thread_bound_weak_ptr_, |
236 id)); | 236 id)); |
237 } | 237 } |
238 | 238 |
239 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { | 239 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { |
240 view_->SetSurfaceId(SurfaceId::From(id)); | 240 view_->SetSurfaceId(SurfaceId::From(id)); |
241 } | 241 } |
242 | 242 |
243 } // namespace mojo | 243 } // namespace mojo |
OLD | NEW |