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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 void WebLayerTreeViewImpl::ApplyViewportDeltas( | 96 void WebLayerTreeViewImpl::ApplyViewportDeltas( |
97 const gfx::Vector2d& scroll_delta, | 97 const gfx::Vector2d& scroll_delta, |
98 float page_scale, | 98 float page_scale, |
99 float top_controls_delta) { | 99 float top_controls_delta) { |
100 widget_->applyViewportDeltas(scroll_delta, page_scale, top_controls_delta); | 100 widget_->applyViewportDeltas(scroll_delta, page_scale, top_controls_delta); |
101 } | 101 } |
102 | 102 |
103 void WebLayerTreeViewImpl::RequestNewOutputSurface() { | 103 void WebLayerTreeViewImpl::RequestNewOutputSurface() { |
104 layer_tree_host_->SetOutputSurface(output_surface_.Pass()); | 104 if (output_surface_.get()) |
| 105 layer_tree_host_->SetOutputSurface(output_surface_.Pass()); |
105 } | 106 } |
106 | 107 |
107 void WebLayerTreeViewImpl::DidFailToInitializeOutputSurface() { | 108 void WebLayerTreeViewImpl::DidFailToInitializeOutputSurface() { |
108 RequestNewOutputSurface(); | 109 RequestNewOutputSurface(); |
109 } | 110 } |
110 | 111 |
111 void WebLayerTreeViewImpl::DidInitializeOutputSurface() { | 112 void WebLayerTreeViewImpl::DidInitializeOutputSurface() { |
112 } | 113 } |
113 | 114 |
114 void WebLayerTreeViewImpl::WillCommit() { | 115 void WebLayerTreeViewImpl::WillCommit() { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, | 238 base::Bind(&WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread, |
238 main_thread_bound_weak_ptr_, | 239 main_thread_bound_weak_ptr_, |
239 id)); | 240 id)); |
240 } | 241 } |
241 | 242 |
242 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { | 243 void WebLayerTreeViewImpl::DidCreateSurfaceOnMainThread(cc::SurfaceId id) { |
243 view_->SetSurfaceId(mojo::SurfaceId::From(id)); | 244 view_->SetSurfaceId(mojo::SurfaceId::From(id)); |
244 } | 245 } |
245 | 246 |
246 } // namespace html_viewer | 247 } // namespace html_viewer |
OLD | NEW |