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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); | 1006 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
1007 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::commitPendingOnIm
plThreadForTesting, m_implThreadWeakPtr, &commitPendingRequest)); | 1007 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::commitPendingOnIm
plThreadForTesting, m_implThreadWeakPtr, &commitPendingRequest)); |
1008 commitPendingRequest.completion.wait(); | 1008 commitPendingRequest.completion.wait(); |
1009 } | 1009 } |
1010 return commitPendingRequest.commitPending; | 1010 return commitPendingRequest.commitPending; |
1011 } | 1011 } |
1012 | 1012 |
1013 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ
est) | 1013 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ
est) |
1014 { | 1014 { |
1015 DCHECK(isImplThread()); | 1015 DCHECK(isImplThread()); |
1016 if (m_layerTreeHostImpl->outputSurface()) | 1016 request->commitPending = m_schedulerOnImplThread->commitPending(); |
1017 request->commitPending = m_schedulerOnImplThread->commitPending(); | |
1018 request->completion.signal(); | 1017 request->completion.signal(); |
1019 } | 1018 } |
1020 | 1019 |
1021 skia::RefPtr<SkPicture> ThreadProxy::capturePicture() | 1020 skia::RefPtr<SkPicture> ThreadProxy::capturePicture() |
1022 { | 1021 { |
1023 DCHECK(isMainThread()); | 1022 DCHECK(isMainThread()); |
1024 CompletionEvent completion; | 1023 CompletionEvent completion; |
1025 skia::RefPtr<SkPicture> picture; | 1024 skia::RefPtr<SkPicture> picture; |
1026 { | 1025 { |
1027 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); | 1026 DebugScopedSetMainThreadBlocked mainThreadBlocked(this); |
1028 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::capturePictureOnI
mplThread, | 1027 Proxy::implThread()->postTask(base::Bind(&ThreadProxy::capturePictureOnI
mplThread, |
1029 m_implThreadWeakPtr, | 1028 m_implThreadWeakPtr, |
1030 &completion, | 1029 &completion, |
1031 &picture)); | 1030 &picture)); |
1032 completion.wait(); | 1031 completion.wait(); |
1033 } | 1032 } |
1034 return picture; | 1033 return picture; |
1035 } | 1034 } |
1036 | 1035 |
1037 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) | 1036 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) |
1038 { | 1037 { |
1039 DCHECK(isImplThread()); | 1038 DCHECK(isImplThread()); |
1040 *picture = m_layerTreeHostImpl->capturePicture(); | 1039 *picture = m_layerTreeHostImpl->capturePicture(); |
1041 completion->signal(); | 1040 completion->signal(); |
1042 } | 1041 } |
1043 | 1042 |
1044 } // namespace cc | 1043 } // namespace cc |
OLD | NEW |