| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 &completion, | 227 &completion, |
| 228 visible)); | 228 visible)); |
| 229 completion.Wait(); | 229 completion.Wait(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void ThreadProxy::SetVisibleOnImplThread(CompletionEvent* completion, | 232 void ThreadProxy::SetVisibleOnImplThread(CompletionEvent* completion, |
| 233 bool visible) { | 233 bool visible) { |
| 234 TRACE_EVENT0("cc", "ThreadProxy::SetVisibleOnImplThread"); | 234 TRACE_EVENT0("cc", "ThreadProxy::SetVisibleOnImplThread"); |
| 235 layer_tree_host_impl_->SetVisible(visible); | 235 layer_tree_host_impl_->SetVisible(visible); |
| 236 scheduler_on_impl_thread_->SetVisible(visible); | 236 scheduler_on_impl_thread_->SetVisible(visible); |
| 237 layer_tree_host_impl_->UpdateBackgroundAnimateTicking( |
| 238 !scheduler_on_impl_thread_->WillDrawIfNeeded()); |
| 237 completion->Signal(); | 239 completion->Signal(); |
| 238 } | 240 } |
| 239 | 241 |
| 240 void ThreadProxy::DoCreateAndInitializeOutputSurface() { | 242 void ThreadProxy::DoCreateAndInitializeOutputSurface() { |
| 241 TRACE_EVENT0("cc", "ThreadProxy::DoCreateAndInitializeOutputSurface"); | 243 TRACE_EVENT0("cc", "ThreadProxy::DoCreateAndInitializeOutputSurface"); |
| 242 DCHECK(IsMainThread()); | 244 DCHECK(IsMainThread()); |
| 243 | 245 |
| 244 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass(); | 246 scoped_ptr<OutputSurface> output_surface = first_output_surface_.Pass(); |
| 245 if (!output_surface) | 247 if (!output_surface) |
| 246 output_surface = layer_tree_host_->CreateOutputSurface(); | 248 output_surface = layer_tree_host_->CreateOutputSurface(); |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 DCHECK(IsImplThread()); | 892 DCHECK(IsImplThread()); |
| 891 DCHECK(scheduler_on_impl_thread_); | 893 DCHECK(scheduler_on_impl_thread_); |
| 892 DCHECK(scheduler_on_impl_thread_->CommitPending()); | 894 DCHECK(scheduler_on_impl_thread_->CommitPending()); |
| 893 DCHECK(!layer_tree_host_impl_->pending_tree()); | 895 DCHECK(!layer_tree_host_impl_->pending_tree()); |
| 894 | 896 |
| 895 // If the begin frame data was handled, then scroll and scale set was applied | 897 // If the begin frame data was handled, then scroll and scale set was applied |
| 896 // by the main thread, so the active tree needs to be updated as if these sent | 898 // by the main thread, so the active tree needs to be updated as if these sent |
| 897 // values were applied and committed. | 899 // values were applied and committed. |
| 898 if (did_handle) { | 900 if (did_handle) { |
| 899 layer_tree_host_impl_->active_tree()->ApplySentScrollAndScaleDeltas(); | 901 layer_tree_host_impl_->active_tree()->ApplySentScrollAndScaleDeltas(); |
| 902 layer_tree_host_impl_->active_tree()->ResetContentsTexturesPurged(); |
| 900 SetInputThrottledUntilCommitOnImplThread(false); | 903 SetInputThrottledUntilCommitOnImplThread(false); |
| 901 } | 904 } |
| 902 scheduler_on_impl_thread_->BeginFrameAbortedByMainThread(did_handle); | 905 scheduler_on_impl_thread_->BeginFrameAbortedByMainThread(did_handle); |
| 903 } | 906 } |
| 904 | 907 |
| 905 void ThreadProxy::ScheduledActionCommit() { | 908 void ThreadProxy::ScheduledActionCommit() { |
| 906 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); | 909 TRACE_EVENT0("cc", "ThreadProxy::ScheduledActionCommit"); |
| 907 DCHECK(IsImplThread()); | 910 DCHECK(IsImplThread()); |
| 908 DCHECK(commit_completion_event_on_impl_thread_); | 911 DCHECK(commit_completion_event_on_impl_thread_); |
| 909 DCHECK(current_resource_update_controller_on_impl_thread_); | 912 DCHECK(current_resource_update_controller_on_impl_thread_); |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1503 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 1506 DCHECK(layer_tree_host_impl_->settings().impl_side_painting); |
| 1504 completion_event_for_commit_held_on_tree_activation_->Signal(); | 1507 completion_event_for_commit_held_on_tree_activation_->Signal(); |
| 1505 completion_event_for_commit_held_on_tree_activation_ = NULL; | 1508 completion_event_for_commit_held_on_tree_activation_ = NULL; |
| 1506 } | 1509 } |
| 1507 | 1510 |
| 1508 commit_to_activate_duration_history_.InsertSample( | 1511 commit_to_activate_duration_history_.InsertSample( |
| 1509 base::TimeTicks::HighResNow() - commit_complete_time_); | 1512 base::TimeTicks::HighResNow() - commit_complete_time_); |
| 1510 } | 1513 } |
| 1511 | 1514 |
| 1512 } // namespace cc | 1515 } // namespace cc |
| OLD | NEW |