| 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 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 base::TimeDelta ThreadProxy::DrawDurationEstimate() { | 1080 base::TimeDelta ThreadProxy::DrawDurationEstimate() { |
| 1081 base::TimeDelta historical_estimate = | 1081 base::TimeDelta historical_estimate = |
| 1082 draw_duration_history_.Percentile(kDrawDurationEstimationPercentile); | 1082 draw_duration_history_.Percentile(kDrawDurationEstimationPercentile); |
| 1083 base::TimeDelta padding = base::TimeDelta::FromMicroseconds( | 1083 base::TimeDelta padding = base::TimeDelta::FromMicroseconds( |
| 1084 kDrawDurationEstimatePaddingInMicroseconds); | 1084 kDrawDurationEstimatePaddingInMicroseconds); |
| 1085 return historical_estimate + padding; | 1085 return historical_estimate + padding; |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 void ThreadProxy::PostBeginFrameDeadline(const base::Closure &closure, |
| 1089 base::TimeTicks deadline) { |
| 1090 base::TimeDelta delta = deadline - base::TimeTicks::Now(); |
| 1091 if (delta <= base::TimeDelta()) { |
| 1092 closure.Run(); |
| 1093 return; |
| 1094 } |
| 1095 Proxy::ImplThread()->PostDelayedTask(closure, delta); |
| 1096 } |
| 1097 |
| 1088 void ThreadProxy::ReadyToFinalizeTextureUpdates() { | 1098 void ThreadProxy::ReadyToFinalizeTextureUpdates() { |
| 1089 DCHECK(IsImplThread()); | 1099 DCHECK(IsImplThread()); |
| 1090 scheduler_on_impl_thread_->FinishCommit(); | 1100 scheduler_on_impl_thread_->FinishCommit(); |
| 1091 } | 1101 } |
| 1092 | 1102 |
| 1093 void ThreadProxy::DidCommitAndDrawFrame() { | 1103 void ThreadProxy::DidCommitAndDrawFrame() { |
| 1094 DCHECK(IsMainThread()); | 1104 DCHECK(IsMainThread()); |
| 1095 if (!layer_tree_host_) | 1105 if (!layer_tree_host_) |
| 1096 return; | 1106 return; |
| 1097 layer_tree_host_->DidCommitAndDrawFrame(); | 1107 layer_tree_host_->DidCommitAndDrawFrame(); |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 !layer_tree_host_impl_->pending_tree()) { | 1425 !layer_tree_host_impl_->pending_tree()) { |
| 1416 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", | 1426 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", |
| 1417 TRACE_EVENT_SCOPE_THREAD); | 1427 TRACE_EVENT_SCOPE_THREAD); |
| 1418 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 1428 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
| 1419 completion_event_for_commit_held_on_tree_activation_->Signal(); | 1429 completion_event_for_commit_held_on_tree_activation_->Signal(); |
| 1420 completion_event_for_commit_held_on_tree_activation_ = NULL; | 1430 completion_event_for_commit_held_on_tree_activation_ = NULL; |
| 1421 } | 1431 } |
| 1422 } | 1432 } |
| 1423 | 1433 |
| 1424 } // namespace cc | 1434 } // namespace cc |
| OLD | NEW |