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 = m_layerTreeHostImpl->outputSurface()->Capabilitie
s().max_frames_pending; | 1030 int maxFramesPending = FrameRateController::kDefaultMaxFramesPending; |
1031 if (maxFramesPending <= 0) | |
1032 maxFramesPending = FrameRateController::kDefaultMaxFramesPending; | |
1033 if (m_layerTreeHostImpl->outputSurface()->Capabilities().has_parent_comp
ositor) | 1031 if (m_layerTreeHostImpl->outputSurface()->Capabilities().has_parent_comp
ositor) |
1034 maxFramesPending = 1; | 1032 maxFramesPending = 1; |
1035 m_schedulerOnImplThread->setMaxFramesPending(maxFramesPending); | 1033 m_schedulerOnImplThread->setMaxFramesPending(maxFramesPending); |
1036 } | 1034 } |
1037 | 1035 |
1038 completion->signal(); | 1036 completion->signal(); |
1039 } | 1037 } |
1040 | 1038 |
1041 void ThreadProxy::layerTreeHostClosedOnImplThread(CompletionEvent* completion) | 1039 void ThreadProxy::layerTreeHostClosedOnImplThread(CompletionEvent* completion) |
1042 { | 1040 { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 | 1189 |
1192 void ThreadProxy::renewTreePriorityOnImplThread() | 1190 void ThreadProxy::renewTreePriorityOnImplThread() |
1193 { | 1191 { |
1194 DCHECK(m_renewTreePriorityOnImplThreadPending); | 1192 DCHECK(m_renewTreePriorityOnImplThreadPending); |
1195 m_renewTreePriorityOnImplThreadPending = false; | 1193 m_renewTreePriorityOnImplThreadPending = false; |
1196 | 1194 |
1197 renewTreePriority(); | 1195 renewTreePriority(); |
1198 } | 1196 } |
1199 | 1197 |
1200 } // namespace cc | 1198 } // namespace cc |
OLD | NEW |