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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 449 } |
450 | 450 |
451 void ThreadProxy::SetNextCommitWaitsForActivation() { | 451 void ThreadProxy::SetNextCommitWaitsForActivation() { |
452 DCHECK(IsMainThread()); | 452 DCHECK(IsMainThread()); |
453 DCHECK(!blocked_main().main_thread_inside_commit); | 453 DCHECK(!blocked_main().main_thread_inside_commit); |
454 blocked_main().commit_waits_for_activation = true; | 454 blocked_main().commit_waits_for_activation = true; |
455 } | 455 } |
456 | 456 |
457 void ThreadProxy::SetDeferCommits(bool defer_commits) { | 457 void ThreadProxy::SetDeferCommits(bool defer_commits) { |
458 DCHECK(IsMainThread()); | 458 DCHECK(IsMainThread()); |
459 DCHECK_NE(main().defer_commits, defer_commits); | 459 if (main().defer_commits == defer_commits) |
| 460 return; |
| 461 |
460 main().defer_commits = defer_commits; | 462 main().defer_commits = defer_commits; |
461 | |
462 if (main().defer_commits) | 463 if (main().defer_commits) |
463 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); | 464 TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); |
464 else | 465 else |
465 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); | 466 TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::SetDeferCommits", this); |
466 | 467 |
467 if (!main().defer_commits && main().pending_deferred_commit) | 468 if (!main().defer_commits && main().pending_deferred_commit) |
468 Proxy::MainThreadTaskRunner()->PostTask( | 469 Proxy::MainThreadTaskRunner()->PostTask( |
469 FROM_HERE, | 470 FROM_HERE, |
470 base::Bind(&ThreadProxy::BeginMainFrame, | 471 base::Bind(&ThreadProxy::BeginMainFrame, |
471 main_thread_weak_ptr_, | 472 main_thread_weak_ptr_, |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 | 1447 |
1447 impl().timing_history.DidActivateSyncTree(); | 1448 impl().timing_history.DidActivateSyncTree(); |
1448 } | 1449 } |
1449 | 1450 |
1450 void ThreadProxy::DidManageTiles() { | 1451 void ThreadProxy::DidManageTiles() { |
1451 DCHECK(IsImplThread()); | 1452 DCHECK(IsImplThread()); |
1452 impl().scheduler->DidManageTiles(); | 1453 impl().scheduler->DidManageTiles(); |
1453 } | 1454 } |
1454 | 1455 |
1455 } // namespace cc | 1456 } // namespace cc |
OLD | NEW |