Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: cc/thread_proxy.cc

Issue 12408028: cc: Delay start of scrollbar animation setNeedsRedraw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to 188682 Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/thread_proxy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/thread.h" 10 #include "cc/base/thread.h"
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 // Need to make sure a delayed task is posted when we have smoothness 1308 // Need to make sure a delayed task is posted when we have smoothness
1309 // takes priority expiration time in the future. 1309 // takes priority expiration time in the future.
1310 if (delay <= base::TimeDelta()) 1310 if (delay <= base::TimeDelta())
1311 return; 1311 return;
1312 if (renew_tree_priority_on_impl_thread_pending_) 1312 if (renew_tree_priority_on_impl_thread_pending_)
1313 return; 1313 return;
1314 1314
1315 Proxy::ImplThread()->PostDelayedTask( 1315 Proxy::ImplThread()->PostDelayedTask(
1316 base::Bind(&ThreadProxy::RenewTreePriorityOnImplThread, 1316 base::Bind(&ThreadProxy::RenewTreePriorityOnImplThread,
1317 weak_factory_on_impl_thread_.GetWeakPtr()), 1317 weak_factory_on_impl_thread_.GetWeakPtr()),
1318 delay.InMilliseconds()); 1318 delay);
1319 1319
1320 renew_tree_priority_on_impl_thread_pending_ = true; 1320 renew_tree_priority_on_impl_thread_pending_ = true;
1321 } 1321 }
1322 1322
1323 void ThreadProxy::RenewTreePriorityOnImplThread() { 1323 void ThreadProxy::RenewTreePriorityOnImplThread() {
1324 DCHECK(renew_tree_priority_on_impl_thread_pending_); 1324 DCHECK(renew_tree_priority_on_impl_thread_pending_);
1325 renew_tree_priority_on_impl_thread_pending_ = false; 1325 renew_tree_priority_on_impl_thread_pending_ = false;
1326 1326
1327 RenewTreePriority(); 1327 RenewTreePriority();
1328 } 1328 }
1329 1329
1330 void ThreadProxy::RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) {
1331 Proxy::ImplThread()->PostDelayedTask(
1332 base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread,
1333 impl_thread_weak_ptr_),
1334 delay);
1335 }
1336
1337 void ThreadProxy::StartScrollbarAnimationOnImplThread() {
1338 layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now());
1339 }
1340
1330 } // namespace cc 1341 } // namespace cc
OLDNEW
« no previous file with comments | « cc/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698