OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/thread_proxy.h" | 5 #include "cc/thread_proxy.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/delay_based_time_source.h" | 9 #include "cc/delay_based_time_source.h" |
10 #include "cc/draw_quad.h" | 10 #include "cc/draw_quad.h" |
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 return commitPendingRequest.commitPending; | 1012 return commitPendingRequest.commitPending; |
1013 } | 1013 } |
1014 | 1014 |
1015 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ
est) | 1015 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ
est) |
1016 { | 1016 { |
1017 DCHECK(isImplThread()); | 1017 DCHECK(isImplThread()); |
1018 request->commitPending = m_schedulerOnImplThread->commitPending(); | 1018 request->commitPending = m_schedulerOnImplThread->commitPending(); |
1019 request->completion.signal(); | 1019 request->completion.signal(); |
1020 } | 1020 } |
1021 | 1021 |
| 1022 skia::RefPtr<SkPicture> ThreadProxy::capturePicture() |
| 1023 { |
| 1024 DCHECK(isMainThread()); |
| 1025 CompletionEvent completion; |
| 1026 skia::RefPtr<SkPicture> picture; |
| 1027 { |
| 1028 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
| 1029 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::capturePictureOnI
mplThread, |
| 1030 m_implThreadWeakPtr, |
| 1031 &completion, |
| 1032 &picture)); |
| 1033 completion.wait(); |
| 1034 } |
| 1035 return picture; |
| 1036 } |
| 1037 |
| 1038 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) |
| 1039 { |
| 1040 DCHECK(isImplThread()); |
| 1041 *picture = m_layerTreeHostImpl->capturePicture(); |
| 1042 completion->signal(); |
| 1043 } |
| 1044 |
1022 } // namespace cc | 1045 } // namespace cc |
OLD | NEW |