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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/delay_based_time_source.h" | 10 #include "cc/delay_based_time_source.h" |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 { | 1020 { |
1021 TRACE_EVENT0("cc", "ThreadProxy::initializeRendererOnImplThread"); | 1021 TRACE_EVENT0("cc", "ThreadProxy::initializeRendererOnImplThread"); |
1022 DCHECK(isImplThread()); | 1022 DCHECK(isImplThread()); |
1023 DCHECK(m_outputSurfaceBeforeInitializationOnImplThread.get()); | 1023 DCHECK(m_outputSurfaceBeforeInitializationOnImplThread.get()); |
1024 *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_outputSurfa
ceBeforeInitializationOnImplThread.Pass()); | 1024 *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_outputSurfa
ceBeforeInitializationOnImplThread.Pass()); |
1025 if (*initializeSucceeded) { | 1025 if (*initializeSucceeded) { |
1026 *capabilities = m_layerTreeHostImpl->rendererCapabilities(); | 1026 *capabilities = m_layerTreeHostImpl->rendererCapabilities(); |
1027 m_schedulerOnImplThread->setSwapBuffersCompleteSupported( | 1027 m_schedulerOnImplThread->setSwapBuffersCompleteSupported( |
1028 capabilities->usingSwapCompleteCallback); | 1028 capabilities->usingSwapCompleteCallback); |
1029 | 1029 |
1030 int maxFramesPending = FrameRateController::kDefaultMaxFramesPending; | 1030 int maxFramesPending = m_layerTreeHostImpl->outputSurface()->Capabilitie
s().max_frames_pending; |
| 1031 if (maxFramesPending <= 0) |
| 1032 maxFramesPending = FrameRateController::kDefaultMaxFramesPending; |
1031 if (m_layerTreeHostImpl->outputSurface()->Capabilities().has_parent_comp
ositor) | 1033 if (m_layerTreeHostImpl->outputSurface()->Capabilities().has_parent_comp
ositor) |
1032 maxFramesPending = 1; | 1034 maxFramesPending = 1; |
1033 m_schedulerOnImplThread->setMaxFramesPending(maxFramesPending); | 1035 m_schedulerOnImplThread->setMaxFramesPending(maxFramesPending); |
1034 } | 1036 } |
1035 | 1037 |
1036 completion->signal(); | 1038 completion->signal(); |
1037 } | 1039 } |
1038 | 1040 |
1039 void ThreadProxy::layerTreeHostClosedOnImplThread(CompletionEvent* completion) | 1041 void ThreadProxy::layerTreeHostClosedOnImplThread(CompletionEvent* completion) |
1040 { | 1042 { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 | 1191 |
1190 void ThreadProxy::renewTreePriorityOnImplThread() | 1192 void ThreadProxy::renewTreePriorityOnImplThread() |
1191 { | 1193 { |
1192 DCHECK(m_renewTreePriorityOnImplThreadPending); | 1194 DCHECK(m_renewTreePriorityOnImplThreadPending); |
1193 m_renewTreePriorityOnImplThreadPending = false; | 1195 m_renewTreePriorityOnImplThreadPending = false; |
1194 | 1196 |
1195 renewTreePriority(); | 1197 renewTreePriority(); |
1196 } | 1198 } |
1197 | 1199 |
1198 } // namespace cc | 1200 } // namespace cc |
OLD | NEW |