Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2822)

Unified Diff: android_webview/browser/render_thread_manager.cc

Issue 2418383002: sync compositor: Signal async frame on IO thread (Closed)
Patch Set: bad_message, and minor cleanups Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/render_thread_manager.cc
diff --git a/android_webview/browser/render_thread_manager.cc b/android_webview/browser/render_thread_manager.cc
index 08e115fee88c953172eb0aa6115065372ee06043..1413381ff6ac60efbfd3dfa72c2f14ccaed007fd 100644
--- a/android_webview/browser/render_thread_manager.cc
+++ b/android_webview/browser/render_thread_manager.cc
@@ -193,6 +193,8 @@ void RenderThreadManager::SetFrameOnUI(
std::unique_ptr<ChildFrame> RenderThreadManager::GetSynchronousCompositorFrame(
scoped_refptr<content::SynchronousCompositor::FrameFuture> frame_future,
std::unique_ptr<ChildFrame> child_frame) {
+ if (!frame_future)
+ return nullptr;
DCHECK(!child_frame->frame.get());
std::unique_ptr<content::SynchronousCompositor::Frame> frame =
frame_future->getFrame();
@@ -210,13 +212,15 @@ std::unique_ptr<ChildFrame> RenderThreadManager::PassFrameOnRT() {
base::AutoLock lock(lock_);
hardware_renderer_has_frame_ =
hardware_renderer_has_frame_ || child_frame_.get();
- if (async_on_draw_hardware_ && child_frame_.get()) {
- return GetSynchronousCompositorFrame(std::move(frame_future_),
- std::move(child_frame_));
- }
return std::move(child_frame_);
}
+scoped_refptr<content::SynchronousCompositor::FrameFuture>
+RenderThreadManager::PassFrameFutureOnRT() {
+ base::AutoLock lock(lock_);
+ return std::move(frame_future_);
+}
+
std::unique_ptr<ChildFrame> RenderThreadManager::PassUncommittedFrameOnUI() {
base::AutoLock lock(lock_);
if (async_on_draw_hardware_ && child_frame_.get()) {

Powered by Google App Engine
This is Rietveld 408576698