Index: cc/thread_proxy.cc |
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc |
index 68bb89078cebdc692867927743c202bb88f4076b..6979a1528265c5a517b49a9d0f9e22005c0dbe15 100644 |
--- a/cc/thread_proxy.cc |
+++ b/cc/thread_proxy.cc |
@@ -1017,4 +1017,27 @@ void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ |
request->completion.signal(); |
} |
+skia::RefPtr<SkPicture> ThreadProxy::capturePicture() |
+{ |
+ DCHECK(isMainThread()); |
+ CompletionEvent completion; |
+ skia::RefPtr<SkPicture> picture; |
+ { |
+ DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
+ Proxy::implThread()->postTask(base::Bind(&ThreadProxy::capturePictureOnImplThread, |
+ m_implThreadWeakPtr, |
+ &completion, |
+ &picture)); |
+ completion.wait(); |
+ } |
+ return picture; |
+} |
+ |
+void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::RefPtr<SkPicture>* picture) |
+{ |
+ DCHECK(isImplThread()); |
+ *picture = m_layerTreeHostImpl->capturePicture(); |
+ completion->signal(); |
+} |
+ |
} // namespace cc |