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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 // Need to make sure a delayed task is posted when we have smoothness | 1309 // Need to make sure a delayed task is posted when we have smoothness |
1310 // takes priority expiration time in the future. | 1310 // takes priority expiration time in the future. |
1311 if (delay <= base::TimeDelta()) | 1311 if (delay <= base::TimeDelta()) |
1312 return; | 1312 return; |
1313 if (renew_tree_priority_on_impl_thread_pending_) | 1313 if (renew_tree_priority_on_impl_thread_pending_) |
1314 return; | 1314 return; |
1315 | 1315 |
1316 Proxy::ImplThread()->postDelayedTask( | 1316 Proxy::ImplThread()->postDelayedTask( |
1317 base::Bind(&ThreadProxy::RenewTreePriorityOnImplThread, | 1317 base::Bind(&ThreadProxy::RenewTreePriorityOnImplThread, |
1318 weak_factory_on_impl_thread_.GetWeakPtr()), | 1318 weak_factory_on_impl_thread_.GetWeakPtr()), |
1319 delay.InMilliseconds()); | 1319 delay); |
1320 | 1320 |
1321 renew_tree_priority_on_impl_thread_pending_ = true; | 1321 renew_tree_priority_on_impl_thread_pending_ = true; |
1322 } | 1322 } |
1323 | 1323 |
1324 void ThreadProxy::RenewTreePriorityOnImplThread() { | 1324 void ThreadProxy::RenewTreePriorityOnImplThread() { |
1325 DCHECK(renew_tree_priority_on_impl_thread_pending_); | 1325 DCHECK(renew_tree_priority_on_impl_thread_pending_); |
1326 renew_tree_priority_on_impl_thread_pending_ = false; | 1326 renew_tree_priority_on_impl_thread_pending_ = false; |
1327 | 1327 |
1328 RenewTreePriority(); | 1328 RenewTreePriority(); |
1329 } | 1329 } |
1330 | 1330 |
| 1331 void ThreadProxy::RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) { |
| 1332 Proxy::ImplThread()->postDelayedTask( |
| 1333 base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread, |
| 1334 impl_thread_weak_ptr_), |
| 1335 delay); |
| 1336 } |
| 1337 |
| 1338 void ThreadProxy::StartScrollbarAnimationOnImplThread() { |
| 1339 layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now()); |
| 1340 } |
| 1341 |
1331 } // namespace cc | 1342 } // namespace cc |
OLD | NEW |