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

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: Add more test expectations 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
« cc/test/layer_tree_test_common.cc ('K') | « 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/context_provider.h" 10 #include "cc/context_provider.h"
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« cc/test/layer_tree_test_common.cc ('K') | « cc/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698