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

Side by Side Diff: cc/trees/thread_proxy.cc

Issue 14195025: Keep vsync enabled while there is a pending requestAnimationFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/trees/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/trees/thread_proxy.h" 5 #include "cc/trees/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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 261 }
262 262
263 void ThreadProxy::SetNeedsAnimate() { 263 void ThreadProxy::SetNeedsAnimate() {
264 DCHECK(IsMainThread()); 264 DCHECK(IsMainThread());
265 if (animate_requested_) 265 if (animate_requested_)
266 return; 266 return;
267 267
268 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsAnimate"); 268 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsAnimate");
269 animate_requested_ = true; 269 animate_requested_ = true;
270 270
271 Proxy::ImplThread()->PostTask(base::Bind(
272 &ThreadProxy::SetAnimateRequestedOnImplThread, impl_thread_weak_ptr_));
273
271 if (commit_request_sent_to_impl_thread_) 274 if (commit_request_sent_to_impl_thread_)
272 return; 275 return;
273 commit_request_sent_to_impl_thread_ = true; 276 commit_request_sent_to_impl_thread_ = true;
274 Proxy::ImplThread()->PostTask(base::Bind( 277 Proxy::ImplThread()->PostTask(base::Bind(
275 &ThreadProxy::SetNeedsCommitOnImplThread, impl_thread_weak_ptr_)); 278 &ThreadProxy::SetNeedsCommitOnImplThread, impl_thread_weak_ptr_));
276 } 279 }
277 280
278 void ThreadProxy::SetNeedsCommit() { 281 void ThreadProxy::SetNeedsCommit() {
279 DCHECK(IsMainThread()); 282 DCHECK(IsMainThread());
280 if (commit_requested_) 283 if (commit_requested_)
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 has_pending_tree); 363 has_pending_tree);
361 scheduler_on_impl_thread_->SetHasPendingTree(has_pending_tree); 364 scheduler_on_impl_thread_->SetHasPendingTree(has_pending_tree);
362 } 365 }
363 366
364 void ThreadProxy::SetNeedsCommitOnImplThread() { 367 void ThreadProxy::SetNeedsCommitOnImplThread() {
365 DCHECK(IsImplThread()); 368 DCHECK(IsImplThread());
366 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); 369 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread");
367 scheduler_on_impl_thread_->SetNeedsCommit(); 370 scheduler_on_impl_thread_->SetNeedsCommit();
368 } 371 }
369 372
373 void ThreadProxy::SetAnimateRequestedOnImplThread() {
374 DCHECK(IsImplThread());
375 TRACE_EVENT0("cc", "ThreadProxy::SetAnimateRequestedOnImplThread");
376 scheduler_on_impl_thread_->SetAnimateRequested();
377 }
378
370 void ThreadProxy::SetNeedsManageTilesOnImplThread() { 379 void ThreadProxy::SetNeedsManageTilesOnImplThread() {
371 if (manage_tiles_pending_) 380 if (manage_tiles_pending_)
372 return; 381 return;
373 Proxy::ImplThread()->PostTask( 382 Proxy::ImplThread()->PostTask(
374 base::Bind(&ThreadProxy::ManageTilesOnImplThread, impl_thread_weak_ptr_)); 383 base::Bind(&ThreadProxy::ManageTilesOnImplThread, impl_thread_weak_ptr_));
375 manage_tiles_pending_ = true; 384 manage_tiles_pending_ = true;
376 } 385 }
377 386
378 void ThreadProxy::ManageTilesOnImplThread() { 387 void ThreadProxy::ManageTilesOnImplThread() {
379 // TODO(nduca): If needed, move this into CCSchedulerStateMachine. 388 // TODO(nduca): If needed, move this into CCSchedulerStateMachine.
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread, 1349 base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread,
1341 impl_thread_weak_ptr_), 1350 impl_thread_weak_ptr_),
1342 delay); 1351 delay);
1343 } 1352 }
1344 1353
1345 void ThreadProxy::StartScrollbarAnimationOnImplThread() { 1354 void ThreadProxy::StartScrollbarAnimationOnImplThread() {
1346 layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now()); 1355 layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now());
1347 } 1356 }
1348 1357
1349 } // namespace cc 1358 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698