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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } | 458 } |
459 | 459 |
460 void ThreadProxy::SetNextCommitWaitsForActivation() { | 460 void ThreadProxy::SetNextCommitWaitsForActivation() { |
461 DCHECK(IsMainThread()); | 461 DCHECK(IsMainThread()); |
462 DCHECK(!blocked_main().main_thread_inside_commit); | 462 DCHECK(!blocked_main().main_thread_inside_commit); |
463 blocked_main().commit_waits_for_activation = true; | 463 blocked_main().commit_waits_for_activation = true; |
464 } | 464 } |
465 | 465 |
466 void ThreadProxy::SetDeferCommits(bool defer_commits) { | 466 void ThreadProxy::SetDeferCommits(bool defer_commits) { |
467 DCHECK(IsMainThread()); | 467 DCHECK(IsMainThread()); |
468 DCHECK_NE(main().defer_commits, defer_commits); | 468 if (main().defer_commits == defer_commits) |
| 469 return; |
| 470 |
469 main().defer_commits = defer_commits; | 471 main().defer_commits = defer_commits; |
470 | |
471 if (main().defer_commits) | 472 if (main().defer_commits) |
472 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); | 473 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); |
473 else | 474 else |
474 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); | 475 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); |
475 | 476 |
476 if (!main().defer_commits && main().pending_deferred_commit) { | 477 if (!main().defer_commits && main().pending_deferred_commit) { |
477 Proxy::MainThreadTaskRunner()->PostTask( | 478 Proxy::MainThreadTaskRunner()->PostTask( |
478 FROM_HERE, | 479 FROM_HERE, |
479 base::Bind(&ThreadProxy::BeginMainFrame, | 480 base::Bind(&ThreadProxy::BeginMainFrame, |
480 main_thread_weak_ptr_, | 481 main_thread_weak_ptr_, |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 | 1438 |
1438 impl().timing_history.DidActivateSyncTree(); | 1439 impl().timing_history.DidActivateSyncTree(); |
1439 } | 1440 } |
1440 | 1441 |
1441 void ThreadProxy::DidManageTiles() { | 1442 void ThreadProxy::DidManageTiles() { |
1442 DCHECK(IsImplThread()); | 1443 DCHECK(IsImplThread()); |
1443 impl().scheduler->DidManageTiles(); | 1444 impl().scheduler->DidManageTiles(); |
1444 } | 1445 } |
1445 | 1446 |
1446 } // namespace cc | 1447 } // namespace cc |
OLD | NEW |