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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 } | 1094 } |
1095 | 1095 |
1096 base::TimeDelta ThreadProxy::DrawDurationEstimate() { | 1096 base::TimeDelta ThreadProxy::DrawDurationEstimate() { |
1097 base::TimeDelta historical_estimate = | 1097 base::TimeDelta historical_estimate = |
1098 draw_duration_history_.Percentile(kDrawDurationEstimationPercentile); | 1098 draw_duration_history_.Percentile(kDrawDurationEstimationPercentile); |
1099 base::TimeDelta padding = base::TimeDelta::FromMicroseconds( | 1099 base::TimeDelta padding = base::TimeDelta::FromMicroseconds( |
1100 kDrawDurationEstimatePaddingInMicroseconds); | 1100 kDrawDurationEstimatePaddingInMicroseconds); |
1101 return historical_estimate + padding; | 1101 return historical_estimate + padding; |
1102 } | 1102 } |
1103 | 1103 |
| 1104 void ThreadProxy::PostBeginFrameDeadline(const base::Closure &closure, |
| 1105 base::TimeTicks deadline) { |
| 1106 base::TimeDelta delta = deadline - base::TimeTicks::Now(); |
| 1107 if (delta <= base::TimeDelta()) { |
| 1108 closure.Run(); |
| 1109 return; |
| 1110 } |
| 1111 Proxy::ImplThreadTaskRunner()->PostDelayedTask(FROM_HERE, closure, delta); |
| 1112 } |
| 1113 |
1104 void ThreadProxy::ReadyToFinalizeTextureUpdates() { | 1114 void ThreadProxy::ReadyToFinalizeTextureUpdates() { |
1105 DCHECK(IsImplThread()); | 1115 DCHECK(IsImplThread()); |
1106 scheduler_on_impl_thread_->FinishCommit(); | 1116 scheduler_on_impl_thread_->FinishCommit(); |
1107 } | 1117 } |
1108 | 1118 |
1109 void ThreadProxy::DidCommitAndDrawFrame() { | 1119 void ThreadProxy::DidCommitAndDrawFrame() { |
1110 DCHECK(IsMainThread()); | 1120 DCHECK(IsMainThread()); |
1111 if (!layer_tree_host_) | 1121 if (!layer_tree_host_) |
1112 return; | 1122 return; |
1113 layer_tree_host_->DidCommitAndDrawFrame(); | 1123 layer_tree_host_->DidCommitAndDrawFrame(); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 !layer_tree_host_impl_->pending_tree()) { | 1447 !layer_tree_host_impl_->pending_tree()) { |
1438 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", | 1448 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", |
1439 TRACE_EVENT_SCOPE_THREAD); | 1449 TRACE_EVENT_SCOPE_THREAD); |
1440 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 1450 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
1441 completion_event_for_commit_held_on_tree_activation_->Signal(); | 1451 completion_event_for_commit_held_on_tree_activation_->Signal(); |
1442 completion_event_for_commit_held_on_tree_activation_ = NULL; | 1452 completion_event_for_commit_held_on_tree_activation_ = NULL; |
1443 } | 1453 } |
1444 } | 1454 } |
1445 | 1455 |
1446 } // namespace cc | 1456 } // namespace cc |
OLD | NEW |