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 "android_webview/browser/render_thread_manager.h" | 5 #include "android_webview/browser/render_thread_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/child_frame.h" | 9 #include "android_webview/browser/child_frame.h" |
10 #include "android_webview/browser/compositor_frame_producer.h" | 10 #include "android_webview/browser/compositor_frame_producer.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 std::unique_ptr<cc::CompositorFrame> compositor_frame = | 199 std::unique_ptr<cc::CompositorFrame> compositor_frame = |
200 std::move(frame->frame); | 200 std::move(frame->frame); |
201 return base::MakeUnique<ChildFrame>( | 201 return base::MakeUnique<ChildFrame>( |
202 frame->compositor_frame_sink_id, std::move(compositor_frame), | 202 frame->compositor_frame_sink_id, std::move(compositor_frame), |
203 child_frame->compositor_id, | 203 child_frame->compositor_id, |
204 child_frame->viewport_rect_for_tile_priority_empty, | 204 child_frame->viewport_rect_for_tile_priority_empty, |
205 child_frame->transform_for_tile_priority, | 205 child_frame->transform_for_tile_priority, |
206 child_frame->offscreen_pre_raster, child_frame->is_layer); | 206 child_frame->offscreen_pre_raster, child_frame->is_layer); |
207 } | 207 } |
208 | 208 |
| 209 void RenderThreadManager::SetFrameFutureOnUI( |
| 210 const scoped_refptr<content::SynchronousCompositor::FrameFuture>& |
| 211 frame_future) { |
| 212 frame_future_ = std::move(frame_future); |
| 213 } |
| 214 |
209 std::unique_ptr<ChildFrame> RenderThreadManager::PassFrameOnRT() { | 215 std::unique_ptr<ChildFrame> RenderThreadManager::PassFrameOnRT() { |
210 base::AutoLock lock(lock_); | 216 base::AutoLock lock(lock_); |
211 hardware_renderer_has_frame_ = | 217 hardware_renderer_has_frame_ = |
212 hardware_renderer_has_frame_ || child_frame_.get(); | 218 hardware_renderer_has_frame_ || child_frame_.get(); |
213 if (async_on_draw_hardware_ && child_frame_.get()) { | 219 if (async_on_draw_hardware_ && child_frame_.get()) { |
214 return GetSynchronousCompositorFrame(std::move(frame_future_), | 220 return GetSynchronousCompositorFrame(std::move(frame_future_), |
215 std::move(child_frame_)); | 221 std::move(child_frame_)); |
216 } | 222 } |
217 return std::move(child_frame_); | 223 return std::move(child_frame_); |
218 } | 224 } |
219 | 225 |
| 226 scoped_refptr<content::SynchronousCompositor::FrameFuture> |
| 227 RenderThreadManager::PassFrameFutureOnRT() { |
| 228 base::AutoLock lock(lock_); |
| 229 return std::move(frame_future_); |
| 230 } |
| 231 |
220 std::unique_ptr<ChildFrame> RenderThreadManager::PassUncommittedFrameOnUI() { | 232 std::unique_ptr<ChildFrame> RenderThreadManager::PassUncommittedFrameOnUI() { |
221 base::AutoLock lock(lock_); | 233 base::AutoLock lock(lock_); |
222 if (async_on_draw_hardware_ && child_frame_.get()) { | 234 if (async_on_draw_hardware_ && child_frame_.get()) { |
223 return GetSynchronousCompositorFrame(std::move(frame_future_), | 235 return GetSynchronousCompositorFrame(std::move(frame_future_), |
224 std::move(child_frame_)); | 236 std::move(child_frame_)); |
225 } | 237 } |
226 return std::move(child_frame_); | 238 return std::move(child_frame_); |
227 } | 239 } |
228 | 240 |
229 void RenderThreadManager::PostExternalDrawConstraintsToChildCompositorOnRT( | 241 void RenderThreadManager::PostExternalDrawConstraintsToChildCompositorOnRT( |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 : render_thread_manager_(render_thread_manager) { | 435 : render_thread_manager_(render_thread_manager) { |
424 DCHECK(!render_thread_manager_->IsInsideHardwareRelease()); | 436 DCHECK(!render_thread_manager_->IsInsideHardwareRelease()); |
425 render_thread_manager_->SetInsideHardwareRelease(true); | 437 render_thread_manager_->SetInsideHardwareRelease(true); |
426 } | 438 } |
427 | 439 |
428 RenderThreadManager::InsideHardwareReleaseReset::~InsideHardwareReleaseReset() { | 440 RenderThreadManager::InsideHardwareReleaseReset::~InsideHardwareReleaseReset() { |
429 render_thread_manager_->SetInsideHardwareRelease(false); | 441 render_thread_manager_->SetInsideHardwareRelease(false); |
430 } | 442 } |
431 | 443 |
432 } // namespace android_webview | 444 } // namespace android_webview |
OLD | NEW |