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/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 view_ = view; | 63 view_ = view; |
64 widget_ = widget; | 64 widget_ = widget; |
65 if (gpu_service) { | 65 if (gpu_service) { |
66 mojo::CommandBufferPtr cb; | 66 mojo::CommandBufferPtr cb; |
67 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb)); | 67 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb)); |
68 scoped_refptr<cc::ContextProvider> context_provider( | 68 scoped_refptr<cc::ContextProvider> context_provider( |
69 new mus::ContextProvider(cb.PassInterface().PassHandle())); | 69 new mus::ContextProvider(cb.PassInterface().PassHandle())); |
70 output_surface_.reset( | 70 output_surface_.reset( |
71 new mus::OutputSurface(context_provider, view_->RequestSurface())); | 71 new mus::OutputSurface(context_provider, view_->RequestSurface())); |
72 } | 72 } |
73 layer_tree_host_->SetLayerTreeHostClientReady(); | 73 layer_tree_host_->SetVisible(view_->visible()); |
74 } | 74 } |
75 | 75 |
76 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { | 76 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { |
77 // Destroy the LayerTreeHost before anything else as doing so ensures we're | 77 // Destroy the LayerTreeHost before anything else as doing so ensures we're |
78 // not accessed on the compositor thread (we are the LayerTreeHostClient). | 78 // not accessed on the compositor thread (we are the LayerTreeHostClient). |
79 layer_tree_host_.reset(); | 79 layer_tree_host_.reset(); |
80 } | 80 } |
81 | 81 |
82 void WebLayerTreeViewImpl::WillBeginMainFrame() { | 82 void WebLayerTreeViewImpl::WillBeginMainFrame() { |
83 } | 83 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 use_anchor, | 232 use_anchor, |
233 new_page_scale, | 233 new_page_scale, |
234 duration); | 234 duration); |
235 } | 235 } |
236 | 236 |
237 void WebLayerTreeViewImpl::setNeedsAnimate() { | 237 void WebLayerTreeViewImpl::setNeedsAnimate() { |
238 layer_tree_host_->SetNeedsAnimate(); | 238 layer_tree_host_->SetNeedsAnimate(); |
239 } | 239 } |
240 | 240 |
241 } // namespace html_viewer | 241 } // namespace html_viewer |
OLD | NEW |