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 <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 blink::WebWidget* widget) { | 69 blink::WebWidget* widget) { |
70 window_ = window; | 70 window_ = window; |
71 widget_ = widget; | 71 widget_ = widget; |
72 if (gpu_service) { | 72 if (gpu_service) { |
73 mus::mojom::CommandBufferPtr cb; | 73 mus::mojom::CommandBufferPtr cb; |
74 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb)); | 74 gpu_service->CreateOffscreenGLES2Context(GetProxy(&cb)); |
75 scoped_refptr<cc::ContextProvider> context_provider( | 75 scoped_refptr<cc::ContextProvider> context_provider( |
76 new mus::ContextProvider(cb.PassInterface().PassHandle())); | 76 new mus::ContextProvider(cb.PassInterface().PassHandle())); |
77 output_surface_.reset(new mus::OutputSurface( | 77 output_surface_.reset(new mus::OutputSurface( |
78 context_provider, | 78 context_provider, |
79 window_->RequestSurface(mus::mojom::SURFACE_TYPE_DEFAULT))); | 79 window_->RequestSurface(mus::mojom::SurfaceType::DEFAULT))); |
80 } | 80 } |
81 layer_tree_host_->SetVisible(window_->visible()); | 81 layer_tree_host_->SetVisible(window_->visible()); |
82 } | 82 } |
83 | 83 |
84 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { | 84 WebLayerTreeViewImpl::~WebLayerTreeViewImpl() { |
85 // Destroy the LayerTreeHost before anything else as doing so ensures we're | 85 // Destroy the LayerTreeHost before anything else as doing so ensures we're |
86 // not accessed on the compositor thread (we are the LayerTreeHostClient). | 86 // not accessed on the compositor thread (we are the LayerTreeHostClient). |
87 layer_tree_host_.reset(); | 87 layer_tree_host_.reset(); |
88 } | 88 } |
89 | 89 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 use_anchor, | 237 use_anchor, |
238 new_page_scale, | 238 new_page_scale, |
239 duration); | 239 duration); |
240 } | 240 } |
241 | 241 |
242 void WebLayerTreeViewImpl::setNeedsAnimate() { | 242 void WebLayerTreeViewImpl::setNeedsAnimate() { |
243 layer_tree_host_->SetNeedsAnimate(); | 243 layer_tree_host_->SetNeedsAnimate(); |
244 } | 244 } |
245 | 245 |
246 } // namespace html_viewer | 246 } // namespace html_viewer |
OLD | NEW |