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/context_provider.h" | 10 #include "cc/context_provider.h" |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 TRACE_EVENT0("cc", "ThreadProxy::InitializeRendererOnImplThread"); | 1114 TRACE_EVENT0("cc", "ThreadProxy::InitializeRendererOnImplThread"); |
1115 DCHECK(IsImplThread()); | 1115 DCHECK(IsImplThread()); |
1116 DCHECK(output_surface_before_initialization_on_impl_thread_.get()); | 1116 DCHECK(output_surface_before_initialization_on_impl_thread_.get()); |
1117 *initialize_succeeded = layer_tree_host_impl_->InitializeRenderer( | 1117 *initialize_succeeded = layer_tree_host_impl_->InitializeRenderer( |
1118 output_surface_before_initialization_on_impl_thread_.Pass()); | 1118 output_surface_before_initialization_on_impl_thread_.Pass()); |
1119 if (*initialize_succeeded) { | 1119 if (*initialize_succeeded) { |
1120 *capabilities = layer_tree_host_impl_->GetRendererCapabilities(); | 1120 *capabilities = layer_tree_host_impl_->GetRendererCapabilities(); |
1121 scheduler_on_impl_thread_->setSwapBuffersCompleteSupported( | 1121 scheduler_on_impl_thread_->setSwapBuffersCompleteSupported( |
1122 capabilities->using_swap_complete_callback); | 1122 capabilities->using_swap_complete_callback); |
1123 | 1123 |
1124 int maxFramesPending = FrameRateController::kDefaultMaxFramesPending; | 1124 int maxFramesPending = layer_tree_host_impl_->output_surface()-> |
| 1125 capabilities().max_frames_pending; |
| 1126 if (maxFramesPending <= 0) |
| 1127 maxFramesPending = FrameRateController::kDefaultMaxFramesPending; |
1125 if (layer_tree_host_impl_->output_surface()->capabilities(). | 1128 if (layer_tree_host_impl_->output_surface()->capabilities(). |
1126 has_parent_compositor) | 1129 has_parent_compositor) |
1127 maxFramesPending = 1; | 1130 maxFramesPending = 1; |
1128 scheduler_on_impl_thread_->setMaxFramesPending(maxFramesPending); | 1131 scheduler_on_impl_thread_->setMaxFramesPending(maxFramesPending); |
1129 } | 1132 } |
1130 | 1133 |
1131 completion->signal(); | 1134 completion->signal(); |
1132 } | 1135 } |
1133 | 1136 |
1134 void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) { | 1137 void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 } | 1316 } |
1314 | 1317 |
1315 void ThreadProxy::RenewTreePriorityOnImplThread() { | 1318 void ThreadProxy::RenewTreePriorityOnImplThread() { |
1316 DCHECK(renew_tree_priority_on_impl_thread_pending_); | 1319 DCHECK(renew_tree_priority_on_impl_thread_pending_); |
1317 renew_tree_priority_on_impl_thread_pending_ = false; | 1320 renew_tree_priority_on_impl_thread_pending_ = false; |
1318 | 1321 |
1319 RenewTreePriority(); | 1322 RenewTreePriority(); |
1320 } | 1323 } |
1321 | 1324 |
1322 } // namespace cc | 1325 } // namespace cc |
OLD | NEW |