Chromium Code Reviews| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1038 return ScheduledActionDrawAndSwapInternal(true); | 1038 return ScheduledActionDrawAndSwapInternal(true); |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 void ThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { | 1041 void ThreadProxy::DidAnticipatedDrawTimeChange(base::TimeTicks time) { |
| 1042 if (current_resource_update_controller_on_impl_thread_) | 1042 if (current_resource_update_controller_on_impl_thread_) |
| 1043 current_resource_update_controller_on_impl_thread_ | 1043 current_resource_update_controller_on_impl_thread_ |
| 1044 ->PerformMoreUpdates(time); | 1044 ->PerformMoreUpdates(time); |
| 1045 layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame(); | 1045 layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame(); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 | |
| 1049 void ThreadProxy::PostBeginFrameDeadlineTask(base::TimeTicks deadline) { | |
| 1050 base::TimeDelta delta = deadline - base::TimeTicks::Now(); | |
|
ajuma
2013/06/14 15:22:32
To get a sufficiently precise delta on Windows, we
brianderson
2013/06/14 18:42:36
Ok. We'll have to be very careful about comparing
| |
| 1051 if (delta <= base::TimeDelta()) { | |
| 1052 scheduler_on_impl_thread_->OnBeginFrameDeadline(); | |
| 1053 return; | |
| 1054 } | |
| 1055 | |
| 1056 Proxy::ImplThread()->PostDelayedTask( | |
|
Sami
2013/06/14 15:59:20
Can/should we cancel this task if we drew before t
brianderson
2013/06/14 18:42:36
It's kind of "canceled" manually based on the begi
| |
| 1057 base::Bind(&ThreadProxy::OnBeginFrameDeadline, | |
| 1058 weak_factory_on_impl_thread_.GetWeakPtr()), | |
| 1059 deadline - base::TimeTicks::Now()); | |
|
ajuma
2013/06/14 15:22:32
We can reuse |delta| here.
brianderson
2013/06/14 18:42:36
oops!
| |
| 1060 } | |
| 1061 | |
| 1062 void ThreadProxy::OnBeginFrameDeadline() { | |
| 1063 DCHECK(IsImplThread()); | |
| 1064 scheduler_on_impl_thread_->OnBeginFrameDeadline(); | |
| 1065 } | |
| 1066 | |
| 1048 void ThreadProxy::ReadyToFinalizeTextureUpdates() { | 1067 void ThreadProxy::ReadyToFinalizeTextureUpdates() { |
| 1049 DCHECK(IsImplThread()); | 1068 DCHECK(IsImplThread()); |
| 1050 scheduler_on_impl_thread_->FinishCommit(); | 1069 scheduler_on_impl_thread_->FinishCommit(); |
| 1051 } | 1070 } |
| 1052 | 1071 |
| 1053 void ThreadProxy::DidCommitAndDrawFrame() { | 1072 void ThreadProxy::DidCommitAndDrawFrame() { |
| 1054 DCHECK(IsMainThread()); | 1073 DCHECK(IsMainThread()); |
| 1055 if (!layer_tree_host_) | 1074 if (!layer_tree_host_) |
| 1056 return; | 1075 return; |
| 1057 layer_tree_host_->DidCommitAndDrawFrame(); | 1076 layer_tree_host_->DidCommitAndDrawFrame(); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1376 !layer_tree_host_impl_->pending_tree()) { | 1395 !layer_tree_host_impl_->pending_tree()) { |
| 1377 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", | 1396 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", |
| 1378 TRACE_EVENT_SCOPE_THREAD); | 1397 TRACE_EVENT_SCOPE_THREAD); |
| 1379 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 1398 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
| 1380 completion_event_for_commit_held_on_tree_activation_->Signal(); | 1399 completion_event_for_commit_held_on_tree_activation_->Signal(); |
| 1381 completion_event_for_commit_held_on_tree_activation_ = NULL; | 1400 completion_event_for_commit_held_on_tree_activation_ = NULL; |
| 1382 } | 1401 } |
| 1383 } | 1402 } |
| 1384 | 1403 |
| 1385 } // namespace cc | 1404 } // namespace cc |
| OLD | NEW |