Chromium Code Reviews| 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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1015 DCHECK(current_resource_update_controller_on_impl_thread_); | 1015 DCHECK(current_resource_update_controller_on_impl_thread_); |
| 1016 | 1016 |
| 1017 // Complete all remaining texture updates. | 1017 // Complete all remaining texture updates. |
| 1018 current_resource_update_controller_on_impl_thread_->Finalize(); | 1018 current_resource_update_controller_on_impl_thread_->Finalize(); |
| 1019 current_resource_update_controller_on_impl_thread_.reset(); | 1019 current_resource_update_controller_on_impl_thread_.reset(); |
| 1020 | 1020 |
| 1021 inside_commit_ = true; | 1021 inside_commit_ = true; |
| 1022 layer_tree_host_impl_->BeginCommit(); | 1022 layer_tree_host_impl_->BeginCommit(); |
| 1023 layer_tree_host()->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 1023 layer_tree_host()->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
| 1024 layer_tree_host()->FinishCommitOnImplThread(layer_tree_host_impl_.get()); | 1024 layer_tree_host()->FinishCommitOnImplThread(layer_tree_host_impl_.get()); |
| 1025 layer_tree_host_impl_->CommitComplete(); | |
| 1026 inside_commit_ = false; | 1025 inside_commit_ = false; |
|
enne (OOO)
2014/01/15 00:36:04
This variable is a little bit weird. It's only re
brianderson
2014/01/15 00:59:38
main_thread_inside_commit_?
enne (OOO)
2014/01/15 01:21:49
Done.
| |
| 1027 | 1026 |
| 1028 SetInputThrottledUntilCommitOnImplThread(false); | |
| 1029 | |
| 1030 UpdateBackgroundAnimateTicking(); | |
| 1031 | |
| 1032 next_frame_is_newly_committed_frame_on_impl_thread_ = true; | |
| 1033 | |
| 1034 if (layer_tree_host()->settings().impl_side_painting && | 1027 if (layer_tree_host()->settings().impl_side_painting && |
| 1035 commit_waits_for_activation_) { | 1028 commit_waits_for_activation_) { |
| 1036 // For some layer types in impl-side painting, the commit is held until | 1029 // For some layer types in impl-side painting, the commit is held until |
| 1037 // the pending tree is activated. It's also possible that the | 1030 // the pending tree is activated. It's also possible that the |
| 1038 // pending tree has already activated if there was no work to be done. | 1031 // pending tree has already activated if there was no work to be done. |
| 1039 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); | 1032 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); |
| 1040 completion_event_for_commit_held_on_tree_activation_ = | 1033 completion_event_for_commit_held_on_tree_activation_ = |
| 1041 commit_completion_event_on_impl_thread_; | 1034 commit_completion_event_on_impl_thread_; |
| 1042 commit_completion_event_on_impl_thread_ = NULL; | 1035 commit_completion_event_on_impl_thread_ = NULL; |
| 1043 } else { | 1036 } else { |
| 1044 commit_completion_event_on_impl_thread_->Signal(); | 1037 commit_completion_event_on_impl_thread_->Signal(); |
| 1045 commit_completion_event_on_impl_thread_ = NULL; | 1038 commit_completion_event_on_impl_thread_ = NULL; |
| 1046 } | 1039 } |
| 1047 | 1040 |
| 1041 // Delay this step until afer the main thread has been released as it's | |
| 1042 // often a good bit of work to update the tree and prepare the new frame. | |
| 1043 layer_tree_host_impl_->CommitComplete(); | |
| 1044 | |
| 1045 SetInputThrottledUntilCommitOnImplThread(false); | |
| 1046 | |
| 1047 UpdateBackgroundAnimateTicking(); | |
| 1048 | |
| 1049 next_frame_is_newly_committed_frame_on_impl_thread_ = true; | |
| 1048 commit_waits_for_activation_ = false; | 1050 commit_waits_for_activation_ = false; |
| 1049 | 1051 |
| 1050 commit_complete_time_ = base::TimeTicks::HighResNow(); | 1052 commit_complete_time_ = base::TimeTicks::HighResNow(); |
| 1051 begin_main_frame_to_commit_duration_history_.InsertSample( | 1053 begin_main_frame_to_commit_duration_history_.InsertSample( |
| 1052 commit_complete_time_ - begin_main_frame_sent_time_); | 1054 commit_complete_time_ - begin_main_frame_sent_time_); |
| 1053 | 1055 |
| 1054 // SetVisible kicks off the next scheduler action, so this must be last. | 1056 // SetVisible kicks off the next scheduler action, so this must be last. |
| 1055 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 1057 scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); |
| 1056 } | 1058 } |
| 1057 | 1059 |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1646 commit_to_activate_duration_history_.InsertSample( | 1648 commit_to_activate_duration_history_.InsertSample( |
| 1647 base::TimeTicks::HighResNow() - commit_complete_time_); | 1649 base::TimeTicks::HighResNow() - commit_complete_time_); |
| 1648 } | 1650 } |
| 1649 | 1651 |
| 1650 void ThreadProxy::DidManageTiles() { | 1652 void ThreadProxy::DidManageTiles() { |
| 1651 DCHECK(IsImplThread()); | 1653 DCHECK(IsImplThread()); |
| 1652 scheduler_on_impl_thread_->DidManageTiles(); | 1654 scheduler_on_impl_thread_->DidManageTiles(); |
| 1653 } | 1655 } |
| 1654 | 1656 |
| 1655 } // namespace cc | 1657 } // namespace cc |
| OLD | NEW |