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 "components/html_viewer/web_layer_tree_view_impl.h" | 5 #include "components/html_viewer/web_layer_tree_view_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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 settings, | 46 settings, |
47 base::MessageLoopProxy::current(), | 47 base::MessageLoopProxy::current(), |
48 compositor_message_loop_proxy, | 48 compositor_message_loop_proxy, |
49 nullptr); | 49 nullptr); |
50 DCHECK(layer_tree_host_); | 50 DCHECK(layer_tree_host_); |
51 | 51 |
52 if (surface && gpu_service) { | 52 if (surface && gpu_service) { |
53 mojo::CommandBufferPtr cb; | 53 mojo::CommandBufferPtr cb; |
54 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb)); | 54 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb)); |
55 scoped_refptr<cc::ContextProvider> context_provider( | 55 scoped_refptr<cc::ContextProvider> context_provider( |
56 new mojo::ContextProviderMojo(cb.PassMessagePipe())); | 56 new mojo::ContextProviderMojo(cb.PassInterface().PassHandle())); |
57 output_surface_.reset( | 57 output_surface_.reset( |
58 new mojo::OutputSurfaceMojo(this, context_provider, surface.Pass())); | 58 new mojo::OutputSurfaceMojo(this, context_provider, surface.Pass())); |
59 } | 59 } |
60 layer_tree_host_->SetLayerTreeHostClientReady(); | 60 layer_tree_host_->SetLayerTreeHostClientReady(); |
61 } | 61 } |
62 | 62 |
63 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { | 63 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { |
64 } | 64 } |
65 | 65 |
66 void WebLayerTreeViewImpl::WillBeginMainFrame() { | 66 void WebLayerTreeViewImpl::WillBeginMainFrame() { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, | 245 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, |
246 main_thread_bound_weak_ptr_, | 246 main_thread_bound_weak_ptr_, |
247 id)); | 247 id)); |
248 } | 248 } |
249 | 249 |
250 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { | 250 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { |
251 view_->SetSurfaceId(mojo::SurfaceId::From(id)); | 251 view_->SetSurfaceId(mojo::SurfaceId::From(id)); |
252 } | 252 } |
253 | 253 |
254 } // namespace html_viewer | 254 } // namespace html_viewer |
OLD | NEW |