| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 | 403 |
| 404 void ThreadProxy::OnCanDrawStateChanged(bool can_draw) { | 404 void ThreadProxy::OnCanDrawStateChanged(bool can_draw) { |
| 405 DCHECK(IsImplThread()); | 405 DCHECK(IsImplThread()); |
| 406 TRACE_EVENT1( | 406 TRACE_EVENT1( |
| 407 "cc", "ThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); | 407 "cc", "ThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); |
| 408 scheduler_on_impl_thread_->SetCanDraw(can_draw); | 408 scheduler_on_impl_thread_->SetCanDraw(can_draw); |
| 409 layer_tree_host_impl_->UpdateBackgroundAnimateTicking( | 409 layer_tree_host_impl_->UpdateBackgroundAnimateTicking( |
| 410 !scheduler_on_impl_thread_->WillDrawIfNeeded()); | 410 !scheduler_on_impl_thread_->WillDrawIfNeeded()); |
| 411 } | 411 } |
| 412 | 412 |
| 413 void ThreadProxy::NotifyReadyToActivate() { |
| 414 TRACE_EVENT0("cc", "ThreadProxy::NotifyReadyToActivate"); |
| 415 scheduler_on_impl_thread_->NotifyReadyToActivate(); |
| 416 } |
| 417 |
| 413 void ThreadProxy::OnHasPendingTreeStateChanged(bool has_pending_tree) { | 418 void ThreadProxy::OnHasPendingTreeStateChanged(bool has_pending_tree) { |
| 414 DCHECK(IsImplThread()); | 419 DCHECK(IsImplThread()); |
| 415 TRACE_EVENT1("cc", "ThreadProxy::OnHasPendingTreeStateChanged", | 420 TRACE_EVENT1("cc", "ThreadProxy::OnHasPendingTreeStateChanged", |
| 416 "has_pending_tree", has_pending_tree); | 421 "has_pending_tree", has_pending_tree); |
| 417 scheduler_on_impl_thread_->SetHasPendingTree(has_pending_tree); | 422 scheduler_on_impl_thread_->SetHasPendingTree(has_pending_tree); |
| 418 } | 423 } |
| 419 | 424 |
| 420 void ThreadProxy::SetNeedsCommitOnImplThread() { | 425 void ThreadProxy::SetNeedsCommitOnImplThread() { |
| 421 DCHECK(IsImplThread()); | 426 DCHECK(IsImplThread()); |
| 422 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); | 427 TRACE_EVENT0("cc", "ThreadProxy::SetNeedsCommitOnImplThread"); |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 // SetVisible kicks off the next scheduler action, so this must be last. | 964 // SetVisible kicks off the next scheduler action, so this must be last. |
| 960 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 965 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
| 961 } | 966 } |
| 962 | 967 |
| 963 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { | 968 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { |
| 964 DCHECK(IsImplThread()); | 969 DCHECK(IsImplThread()); |
| 965 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); | 970 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionUpdateVisibleTiles"); |
| 966 layer_tree_host_impl_->UpdateVisibleTiles(); | 971 layer_tree_host_impl_->UpdateVisibleTiles(); |
| 967 } | 972 } |
| 968 | 973 |
| 969 void ThreadProxy::ScheduledActionActivatePendingTreeIfNeeded() { | 974 void ThreadProxy::ScheduledActionActivatePendingTree() { |
| 970 DCHECK(IsImplThread()); | 975 DCHECK(IsImplThread()); |
| 971 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivatePendingTreeIfNeeded"); | 976 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionActivatePendingTree"); |
| 972 layer_tree_host_impl_->ActivatePendingTreeIfNeeded(); | 977 layer_tree_host_impl_->ActivatePendingTree(); |
| 973 } | 978 } |
| 974 | 979 |
| 975 void ThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { | 980 void ThreadProxy::ScheduledActionBeginOutputSurfaceCreation() { |
| 976 DCHECK(IsImplThread()); | 981 DCHECK(IsImplThread()); |
| 977 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionBeginOutputSurfaceCreation"); | 982 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionBeginOutputSurfaceCreation"); |
| 978 Proxy::MainThreadTaskRunner()->PostTask( | 983 Proxy::MainThreadTaskRunner()->PostTask( |
| 979 FROM_HERE, | 984 FROM_HERE, |
| 980 base::Bind(&ThreadProxy::CreateAndInitializeOutputSurface, | 985 base::Bind(&ThreadProxy::CreateAndInitializeOutputSurface, |
| 981 main_thread_weak_ptr_)); | 986 main_thread_weak_ptr_)); |
| 982 } | 987 } |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 1522 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
| 1518 completion_event_for_commit_held_on_tree_activation_->Signal(); | 1523 completion_event_for_commit_held_on_tree_activation_->Signal(); |
| 1519 completion_event_for_commit_held_on_tree_activation_ = NULL; | 1524 completion_event_for_commit_held_on_tree_activation_ = NULL; |
| 1520 } | 1525 } |
| 1521 | 1526 |
| 1522 commit_to_activate_duration_history_.InsertSample( | 1527 commit_to_activate_duration_history_.InsertSample( |
| 1523 base::TimeTicks::HighResNow() - commit_complete_time_); | 1528 base::TimeTicks::HighResNow() - commit_complete_time_); |
| 1524 } | 1529 } |
| 1525 | 1530 |
| 1526 } // namespace cc | 1531 } // namespace cc |
| OLD | NEW |