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/trees/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 } | 1100 } |
1101 | 1101 |
1102 base::TimeDelta ThreadProxy::CommitToActivateDurationEstimate() { | 1102 base::TimeDelta ThreadProxy::CommitToActivateDurationEstimate() { |
1103 return impl().timing_history.CommitToActivateDurationEstimate(); | 1103 return impl().timing_history.CommitToActivateDurationEstimate(); |
1104 } | 1104 } |
1105 | 1105 |
1106 void ThreadProxy::DidBeginImplFrameDeadline() { | 1106 void ThreadProxy::DidBeginImplFrameDeadline() { |
1107 impl().layer_tree_host_impl->ResetCurrentBeginFrameArgsForNextFrame(); | 1107 impl().layer_tree_host_impl->ResetCurrentBeginFrameArgsForNextFrame(); |
1108 } | 1108 } |
1109 | 1109 |
1110 void ThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { | |
1111 NOTREACHED() << "Only used by SingleThreadProxy"; | |
1112 } | |
1113 | |
1114 void ThreadProxy::ReadyToFinalizeTextureUpdates() { | 1110 void ThreadProxy::ReadyToFinalizeTextureUpdates() { |
1115 DCHECK(IsImplThread()); | 1111 DCHECK(IsImplThread()); |
1116 impl().scheduler->NotifyReadyToCommit(); | 1112 impl().scheduler->NotifyReadyToCommit(); |
1117 } | 1113 } |
1118 | 1114 |
1119 void ThreadProxy::DidCommitAndDrawFrame() { | 1115 void ThreadProxy::DidCommitAndDrawFrame() { |
1120 DCHECK(IsMainThread()); | 1116 DCHECK(IsMainThread()); |
1121 layer_tree_host()->DidCommitAndDrawFrame(); | 1117 layer_tree_host()->DidCommitAndDrawFrame(); |
1122 } | 1118 } |
1123 | 1119 |
(...skipping 13 matching lines...) Expand all Loading... |
1137 DCHECK(IsImplThread()); | 1133 DCHECK(IsImplThread()); |
1138 impl().layer_tree_host_impl = | 1134 impl().layer_tree_host_impl = |
1139 layer_tree_host()->CreateLayerTreeHostImpl(this); | 1135 layer_tree_host()->CreateLayerTreeHostImpl(this); |
1140 SchedulerSettings scheduler_settings(layer_tree_host()->settings()); | 1136 SchedulerSettings scheduler_settings(layer_tree_host()->settings()); |
1141 impl().scheduler = Scheduler::Create( | 1137 impl().scheduler = Scheduler::Create( |
1142 this, | 1138 this, |
1143 scheduler_settings, | 1139 scheduler_settings, |
1144 impl().layer_tree_host_id, | 1140 impl().layer_tree_host_id, |
1145 ImplThreadTaskRunner(), | 1141 ImplThreadTaskRunner(), |
1146 base::PowerMonitor::Get(), | 1142 base::PowerMonitor::Get(), |
1147 impl().external_begin_frame_source.Pass()); | 1143 impl().external_begin_frame_source.Pass(), |
| 1144 NULL); |
1148 impl().scheduler->SetVisible(impl().layer_tree_host_impl->visible()); | 1145 impl().scheduler->SetVisible(impl().layer_tree_host_impl->visible()); |
1149 impl_thread_weak_ptr_ = impl().weak_factory.GetWeakPtr(); | 1146 impl_thread_weak_ptr_ = impl().weak_factory.GetWeakPtr(); |
1150 completion->Signal(); | 1147 completion->Signal(); |
1151 } | 1148 } |
1152 | 1149 |
1153 void ThreadProxy::DeleteContentsTexturesOnImplThread( | 1150 void ThreadProxy::DeleteContentsTexturesOnImplThread( |
1154 CompletionEvent* completion) { | 1151 CompletionEvent* completion) { |
1155 TRACE_EVENT0("cc", "ThreadProxy::DeleteContentsTexturesOnImplThread"); | 1152 TRACE_EVENT0("cc", "ThreadProxy::DeleteContentsTexturesOnImplThread"); |
1156 DCHECK(IsImplThread()); | 1153 DCHECK(IsImplThread()); |
1157 DCHECK(IsMainThreadBlocked()); | 1154 DCHECK(IsMainThreadBlocked()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 FROM_HERE, | 1256 FROM_HERE, |
1260 base::Bind(&ThreadProxy::MainFrameWillHappenOnImplThreadForTesting, | 1257 base::Bind(&ThreadProxy::MainFrameWillHappenOnImplThreadForTesting, |
1261 impl_thread_weak_ptr_, | 1258 impl_thread_weak_ptr_, |
1262 &completion, | 1259 &completion, |
1263 &main_frame_will_happen)); | 1260 &main_frame_will_happen)); |
1264 completion.Wait(); | 1261 completion.Wait(); |
1265 } | 1262 } |
1266 return main_frame_will_happen; | 1263 return main_frame_will_happen; |
1267 } | 1264 } |
1268 | 1265 |
1269 void ThreadProxy::SetChildrenNeedBeginFrames(bool children_need_begin_frames) { | |
1270 NOTREACHED() << "Only used by SingleThreadProxy"; | |
1271 } | |
1272 | |
1273 void ThreadProxy::MainFrameWillHappenOnImplThreadForTesting( | 1266 void ThreadProxy::MainFrameWillHappenOnImplThreadForTesting( |
1274 CompletionEvent* completion, | 1267 CompletionEvent* completion, |
1275 bool* main_frame_will_happen) { | 1268 bool* main_frame_will_happen) { |
1276 DCHECK(IsImplThread()); | 1269 DCHECK(IsImplThread()); |
1277 if (impl().layer_tree_host_impl->output_surface()) { | 1270 if (impl().layer_tree_host_impl->output_surface()) { |
1278 *main_frame_will_happen = impl().scheduler->MainFrameForTestingWillHappen(); | 1271 *main_frame_will_happen = impl().scheduler->MainFrameForTestingWillHappen(); |
1279 } else { | 1272 } else { |
1280 *main_frame_will_happen = false; | 1273 *main_frame_will_happen = false; |
1281 } | 1274 } |
1282 completion->Signal(); | 1275 completion->Signal(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1360 } | 1353 } |
1361 | 1354 |
1362 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { | 1355 void ThreadProxy::DidCompletePageScaleAnimationOnImplThread() { |
1363 DCHECK(IsImplThread()); | 1356 DCHECK(IsImplThread()); |
1364 Proxy::MainThreadTaskRunner()->PostTask( | 1357 Proxy::MainThreadTaskRunner()->PostTask( |
1365 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, | 1358 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, |
1366 main_thread_weak_ptr_)); | 1359 main_thread_weak_ptr_)); |
1367 } | 1360 } |
1368 | 1361 |
1369 } // namespace cc | 1362 } // namespace cc |
OLD | NEW |