| 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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 DCHECK(IsImplThread()); | 916 DCHECK(IsImplThread()); |
| 917 DCHECK(commit_completion_event_on_impl_thread_); | 917 DCHECK(commit_completion_event_on_impl_thread_); |
| 918 DCHECK(current_resource_update_controller_on_impl_thread_); | 918 DCHECK(current_resource_update_controller_on_impl_thread_); |
| 919 | 919 |
| 920 // Complete all remaining texture updates. | 920 // Complete all remaining texture updates. |
| 921 current_resource_update_controller_on_impl_thread_->Finalize(); | 921 current_resource_update_controller_on_impl_thread_->Finalize(); |
| 922 current_resource_update_controller_on_impl_thread_.reset(); | 922 current_resource_update_controller_on_impl_thread_.reset(); |
| 923 | 923 |
| 924 layer_tree_host_impl_->BeginCommit(); | 924 layer_tree_host_impl_->BeginCommit(); |
| 925 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 925 layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
| 926 bool commit_waits_for_activation = |
| 927 layer_tree_host_->CommitWaitsForActivation(); |
| 926 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); | 928 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); |
| 927 layer_tree_host_impl_->CommitComplete(); | 929 layer_tree_host_impl_->CommitComplete(); |
| 928 | 930 |
| 929 SetInputThrottledUntilCommitOnImplThread(false); | 931 SetInputThrottledUntilCommitOnImplThread(false); |
| 930 | 932 |
| 931 layer_tree_host_impl_->UpdateBackgroundAnimateTicking( | 933 layer_tree_host_impl_->UpdateBackgroundAnimateTicking( |
| 932 !scheduler_on_impl_thread_->WillDrawIfNeeded()); | 934 !scheduler_on_impl_thread_->WillDrawIfNeeded()); |
| 933 | 935 |
| 934 next_frame_is_newly_committed_frame_on_impl_thread_ = true; | 936 next_frame_is_newly_committed_frame_on_impl_thread_ = true; |
| 935 | 937 |
| 936 if (layer_tree_host_->settings().impl_side_painting && | 938 if (layer_tree_host_->settings().impl_side_painting && |
| 937 layer_tree_host_->BlocksPendingCommit() && | 939 commit_waits_for_activation) { |
| 938 layer_tree_host_impl_->pending_tree()) { | |
| 939 // For some layer types in impl-side painting, the commit is held until | 940 // For some layer types in impl-side painting, the commit is held until |
| 940 // the pending tree is activated. It's also possible that the | 941 // the pending tree is activated. It's also possible that the |
| 941 // pending tree has already activated if there was no work to be done. | 942 // pending tree has already activated if there was no work to be done. |
| 942 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); | 943 TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); |
| 943 completion_event_for_commit_held_on_tree_activation_ = | 944 completion_event_for_commit_held_on_tree_activation_ = |
| 944 commit_completion_event_on_impl_thread_; | 945 commit_completion_event_on_impl_thread_; |
| 945 commit_completion_event_on_impl_thread_ = NULL; | 946 commit_completion_event_on_impl_thread_ = NULL; |
| 946 } else { | 947 } else { |
| 947 commit_completion_event_on_impl_thread_->Signal(); | 948 commit_completion_event_on_impl_thread_->Signal(); |
| 948 commit_completion_event_on_impl_thread_ = NULL; | 949 commit_completion_event_on_impl_thread_ = NULL; |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 1511 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
| 1511 completion_event_for_commit_held_on_tree_activation_->Signal(); | 1512 completion_event_for_commit_held_on_tree_activation_->Signal(); |
| 1512 completion_event_for_commit_held_on_tree_activation_ = NULL; | 1513 completion_event_for_commit_held_on_tree_activation_ = NULL; |
| 1513 } | 1514 } |
| 1514 | 1515 |
| 1515 commit_to_activate_duration_history_.InsertSample( | 1516 commit_to_activate_duration_history_.InsertSample( |
| 1516 base::TimeTicks::HighResNow() - commit_complete_time_); | 1517 base::TimeTicks::HighResNow() - commit_complete_time_); |
| 1517 } | 1518 } |
| 1518 | 1519 |
| 1519 } // namespace cc | 1520 } // namespace cc |
| OLD | NEW |