| 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 } | 447 } |
| 448 | 448 |
| 449 void ThreadProxy::SetNextCommitWaitsForActivation() { | 449 void ThreadProxy::SetNextCommitWaitsForActivation() { |
| 450 DCHECK(IsMainThread()); | 450 DCHECK(IsMainThread()); |
| 451 DCHECK(!blocked_main().main_thread_inside_commit); | 451 DCHECK(!blocked_main().main_thread_inside_commit); |
| 452 blocked_main().commit_waits_for_activation = true; | 452 blocked_main().commit_waits_for_activation = true; |
| 453 } | 453 } |
| 454 | 454 |
| 455 void ThreadProxy::SetDeferCommits(bool defer_commits) { | 455 void ThreadProxy::SetDeferCommits(bool defer_commits) { |
| 456 DCHECK(IsMainThread()); | 456 DCHECK(IsMainThread()); |
| 457 DCHECK_NE(main().defer_commits, defer_commits); | 457 if (main().defer_commits == defer_commits) |
| 458 return; |
| 459 |
| 458 main().defer_commits = defer_commits; | 460 main().defer_commits = defer_commits; |
| 459 | |
| 460 if (main().defer_commits) | 461 if (main().defer_commits) |
| 461 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); | 462 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); |
| 462 else | 463 else |
| 463 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); | 464 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); |
| 464 | 465 |
| 465 if (!main().defer_commits && main().pending_deferred_commit) | 466 if (!main().defer_commits && main().pending_deferred_commit) |
| 466 Proxy::MainThreadTaskRunner()->PostTask( | 467 Proxy::MainThreadTaskRunner()->PostTask( |
| 467 FROM_HERE, | 468 FROM_HERE, |
| 468 base::Bind(&ThreadProxy::BeginMainFrame, | 469 base::Bind(&ThreadProxy::BeginMainFrame, |
| 469 main_thread_weak_ptr_, | 470 main_thread_weak_ptr_, |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 | 1437 |
| 1437 impl().timing_history.DidActivatePendingTree(); | 1438 impl().timing_history.DidActivatePendingTree(); |
| 1438 } | 1439 } |
| 1439 | 1440 |
| 1440 void ThreadProxy::DidManageTiles() { | 1441 void ThreadProxy::DidManageTiles() { |
| 1441 DCHECK(IsImplThread()); | 1442 DCHECK(IsImplThread()); |
| 1442 impl().scheduler->DidManageTiles(); | 1443 impl().scheduler->DidManageTiles(); |
| 1443 } | 1444 } |
| 1444 | 1445 |
| 1445 } // namespace cc | 1446 } // namespace cc |
| OLD | NEW |