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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 } | 459 } |
460 | 460 |
461 void ThreadProxy::SetNextCommitWaitsForActivation() { | 461 void ThreadProxy::SetNextCommitWaitsForActivation() { |
462 DCHECK(IsMainThread()); | 462 DCHECK(IsMainThread()); |
463 DCHECK(!blocked_main().main_thread_inside_commit); | 463 DCHECK(!blocked_main().main_thread_inside_commit); |
464 blocked_main().commit_waits_for_activation = true; | 464 blocked_main().commit_waits_for_activation = true; |
465 } | 465 } |
466 | 466 |
467 void ThreadProxy::SetDeferCommits(bool defer_commits) { | 467 void ThreadProxy::SetDeferCommits(bool defer_commits) { |
468 DCHECK(IsMainThread()); | 468 DCHECK(IsMainThread()); |
469 DCHECK_NE(main().defer_commits, defer_commits); | 469 if (main().defer_commits == defer_commits) |
| 470 return; |
| 471 |
470 main().defer_commits = defer_commits; | 472 main().defer_commits = defer_commits; |
471 | |
472 if (main().defer_commits) | 473 if (main().defer_commits) |
473 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); | 474 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); |
474 else | 475 else |
475 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); | 476 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); |
476 | 477 |
477 if (!main().defer_commits && main().pending_deferred_commit) { | 478 if (!main().defer_commits && main().pending_deferred_commit) { |
478 Proxy::MainThreadTaskRunner()->PostTask( | 479 Proxy::MainThreadTaskRunner()->PostTask( |
479 FROM_HERE, | 480 FROM_HERE, |
480 base::Bind(&ThreadProxy::BeginMainFrame, | 481 base::Bind(&ThreadProxy::BeginMainFrame, |
481 main_thread_weak_ptr_, | 482 main_thread_weak_ptr_, |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 | 1414 |
1414 impl().timing_history.DidActivateSyncTree(); | 1415 impl().timing_history.DidActivateSyncTree(); |
1415 } | 1416 } |
1416 | 1417 |
1417 void ThreadProxy::DidManageTiles() { | 1418 void ThreadProxy::DidManageTiles() { |
1418 DCHECK(IsImplThread()); | 1419 DCHECK(IsImplThread()); |
1419 impl().scheduler->DidManageTiles(); | 1420 impl().scheduler->DidManageTiles(); |
1420 } | 1421 } |
1421 | 1422 |
1422 } // namespace cc | 1423 } // namespace cc |
OLD | NEW |