| 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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 void ThreadProxy::ScheduledActionCommit() { | 1008 void ThreadProxy::ScheduledActionCommit() { |
| 1009 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); | 1009 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); |
| 1010 DCHECK(IsImplThread()); | 1010 DCHECK(IsImplThread()); |
| 1011 DCHECK(commit_completion_event_on_impl_thread_); | 1011 DCHECK(commit_completion_event_on_impl_thread_); |
| 1012 DCHECK(current_resource_update_controller_on_impl_thread_); | 1012 DCHECK(current_resource_update_controller_on_impl_thread_); |
| 1013 | 1013 |
| 1014 // Complete all remaining texture updates. | 1014 // Complete all remaining texture updates. |
| 1015 current_resource_update_controller_on_impl_thread_->Finalize(); | 1015 current_resource_update_controller_on_impl_thread_->Finalize(); |
| 1016 current_resource_update_controller_on_impl_thread_.reset(); | 1016 current_resource_update_controller_on_impl_thread_.reset(); |
| 1017 | 1017 |
| 1018 layer_tree_host_impl_->BeginCommit(); |
| 1019 |
| 1018 inside_commit_ = true; | 1020 inside_commit_ = true; |
| 1019 layer_tree_host_impl_->BeginCommit(); | |
| 1020 layer_tree_host()->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 1021 layer_tree_host()->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
| 1021 layer_tree_host()->FinishCommitOnImplThread(layer_tree_host_impl_.get()); | 1022 layer_tree_host()->FinishCommitOnImplThread(layer_tree_host_impl_.get()); |
| 1022 layer_tree_host_impl_->CommitComplete(); | |
| 1023 inside_commit_ = false; | 1023 inside_commit_ = false; |
| 1024 | 1024 |
| 1025 SetInputThrottledUntilCommitOnImplThread(false); | 1025 // Unblock the main thread if possible. |
| 1026 | |
| 1027 UpdateBackgroundAnimateTicking(); | |
| 1028 | |
| 1029 next_frame_is_newly_committed_frame_on_impl_thread_ = true; | |
| 1030 | |
| 1031 if (layer_tree_host()->settings().impl_side_painting && | 1026 if (layer_tree_host()->settings().impl_side_painting && |
| 1032 commit_waits_for_activation_) { | 1027 commit_waits_for_activation_) { |
| 1033 // For some layer types in impl-side painting, the commit is held until | 1028 // For some layer types in impl-side painting, the commit is held until |
| 1034 // the pending tree is activated. It's also possible that the | 1029 // the pending tree is activated. It's also possible that the |
| 1035 // pending tree has already activated if there was no work to be done. | 1030 // pending tree has already activated if there was no work to be done. |
| 1036 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); | 1031 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); |
| 1037 completion_event_for_commit_held_on_tree_activation_ = | 1032 completion_event_for_commit_held_on_tree_activation_ = |
| 1038 commit_completion_event_on_impl_thread_; | 1033 commit_completion_event_on_impl_thread_; |
| 1039 commit_completion_event_on_impl_thread_ = NULL; | 1034 commit_completion_event_on_impl_thread_ = NULL; |
| 1040 } else { | 1035 } else { |
| 1041 commit_completion_event_on_impl_thread_->Signal(); | 1036 commit_completion_event_on_impl_thread_->Signal(); |
| 1042 commit_completion_event_on_impl_thread_ = NULL; | 1037 commit_completion_event_on_impl_thread_ = NULL; |
| 1043 } | 1038 } |
| 1039 commit_waits_for_activation_ = false; |
| 1044 | 1040 |
| 1045 commit_waits_for_activation_ = false; | 1041 layer_tree_host_impl_->CommitComplete(); |
| 1042 |
| 1043 SetInputThrottledUntilCommitOnImplThread(false); |
| 1044 |
| 1045 UpdateBackgroundAnimateTicking(); |
| 1046 |
| 1047 next_frame_is_newly_committed_frame_on_impl_thread_ = true; |
| 1046 | 1048 |
| 1047 commit_complete_time_ = base::TimeTicks::HighResNow(); | 1049 commit_complete_time_ = base::TimeTicks::HighResNow(); |
| 1048 begin_main_frame_to_commit_duration_history_.InsertSample( | 1050 begin_main_frame_to_commit_duration_history_.InsertSample( |
| 1049 commit_complete_time_ - begin_main_frame_sent_time_); | 1051 commit_complete_time_ - begin_main_frame_sent_time_); |
| 1050 | 1052 |
| 1051 // SetVisible kicks off the next scheduler action, so this must be last. | 1053 // SetVisible kicks off the next scheduler action, so this must be last. |
| 1052 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 1054 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
| 1053 } | 1055 } |
| 1054 | 1056 |
| 1055 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { | 1057 void ThreadProxy::ScheduledActionUpdateVisibleTiles() { |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 commit_to_activate_duration_history_.InsertSample( | 1644 commit_to_activate_duration_history_.InsertSample( |
| 1643 base::TimeTicks::HighResNow() - commit_complete_time_); | 1645 base::TimeTicks::HighResNow() - commit_complete_time_); |
| 1644 } | 1646 } |
| 1645 | 1647 |
| 1646 void ThreadProxy::DidManageTiles() { | 1648 void ThreadProxy::DidManageTiles() { |
| 1647 DCHECK(IsImplThread()); | 1649 DCHECK(IsImplThread()); |
| 1648 scheduler_on_impl_thread_->DidManageTiles(); | 1650 scheduler_on_impl_thread_->DidManageTiles(); |
| 1649 } | 1651 } |
| 1650 | 1652 |
| 1651 } // namespace cc | 1653 } // namespace cc |
| OLD | NEW |