| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" | 
| 8 #include "base/bind.h" | 8 #include "base/bind.h" | 
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" | 
| 10 #include "cc/base/thread.h" | 10 #include "cc/base/thread.h" | 
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 817   layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 817   layer_tree_host_->BeginCommitOnImplThread(layer_tree_host_impl_.get()); | 
| 818   layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); | 818   layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); | 
| 819   layer_tree_host_impl_->CommitComplete(); | 819   layer_tree_host_impl_->CommitComplete(); | 
| 820 | 820 | 
| 821   next_frame_is_newly_committed_frame_on_impl_thread_ = true; | 821   next_frame_is_newly_committed_frame_on_impl_thread_ = true; | 
| 822 | 822 | 
| 823   if (layer_tree_host_->settings().impl_side_painting && | 823   if (layer_tree_host_->settings().impl_side_painting && | 
| 824       layer_tree_host_->BlocksPendingCommit()) { | 824       layer_tree_host_->BlocksPendingCommit()) { | 
| 825     // For some layer types in impl-side painting, the commit is held until | 825     // For some layer types in impl-side painting, the commit is held until | 
| 826     // the pending tree is activated. | 826     // the pending tree is activated. | 
| 827     TRACE_EVENT_INSTANT0("cc", "HoldCommit"); | 827     TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD); | 
| 828     completion_event_for_commit_held_on_tree_activation_ = | 828     completion_event_for_commit_held_on_tree_activation_ = | 
| 829         commit_completion_event_on_impl_thread_; | 829         commit_completion_event_on_impl_thread_; | 
| 830     commit_completion_event_on_impl_thread_ = NULL; | 830     commit_completion_event_on_impl_thread_ = NULL; | 
| 831   } else { | 831   } else { | 
| 832     commit_completion_event_on_impl_thread_->Signal(); | 832     commit_completion_event_on_impl_thread_->Signal(); | 
| 833     commit_completion_event_on_impl_thread_ = NULL; | 833     commit_completion_event_on_impl_thread_ = NULL; | 
| 834   } | 834   } | 
| 835 | 835 | 
| 836   // SetVisible kicks off the next scheduler action, so this must be last. | 836   // SetVisible kicks off the next scheduler action, so this must be last. | 
| 837   scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 837   scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 903     layer_tree_host_impl_->DrawLayers( | 903     layer_tree_host_impl_->DrawLayers( | 
| 904         &frame, | 904         &frame, | 
| 905         scheduler_on_impl_thread_->LastVSyncTime()); | 905         scheduler_on_impl_thread_->LastVSyncTime()); | 
| 906     result.did_draw= true; | 906     result.did_draw= true; | 
| 907   } | 907   } | 
| 908   layer_tree_host_impl_->DidDrawAllLayers(frame); | 908   layer_tree_host_impl_->DidDrawAllLayers(frame); | 
| 909 | 909 | 
| 910   // Check for tree activation. | 910   // Check for tree activation. | 
| 911   if (completion_event_for_commit_held_on_tree_activation_ && | 911   if (completion_event_for_commit_held_on_tree_activation_ && | 
| 912       !layer_tree_host_impl_->pending_tree()) { | 912       !layer_tree_host_impl_->pending_tree()) { | 
| 913     TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation"); | 913     TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation", | 
|  | 914                          TRACE_EVENT_SCOPE_THREAD); | 
| 914     DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 915     DCHECK(layer_tree_host_impl_->settings().impl_side_painting); | 
| 915     completion_event_for_commit_held_on_tree_activation_->Signal(); | 916     completion_event_for_commit_held_on_tree_activation_->Signal(); | 
| 916     completion_event_for_commit_held_on_tree_activation_ = NULL; | 917     completion_event_for_commit_held_on_tree_activation_ = NULL; | 
| 917   } | 918   } | 
| 918 | 919 | 
| 919   // Check for a pending CompositeAndReadback. | 920   // Check for a pending CompositeAndReadback. | 
| 920   if (readback_request_on_impl_thread_) { | 921   if (readback_request_on_impl_thread_) { | 
| 921     readback_request_on_impl_thread_->success = false; | 922     readback_request_on_impl_thread_->success = false; | 
| 922     if (draw_frame) { | 923     if (draw_frame) { | 
| 923       layer_tree_host_impl_->Readback(readback_request_on_impl_thread_->pixels, | 924       layer_tree_host_impl_->Readback(readback_request_on_impl_thread_->pixels, | 
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1311       base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread, | 1312       base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread, | 
| 1312                  impl_thread_weak_ptr_), | 1313                  impl_thread_weak_ptr_), | 
| 1313       delay); | 1314       delay); | 
| 1314 } | 1315 } | 
| 1315 | 1316 | 
| 1316 void ThreadProxy::StartScrollbarAnimationOnImplThread() { | 1317 void ThreadProxy::StartScrollbarAnimationOnImplThread() { | 
| 1317   layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now()); | 1318   layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now()); | 
| 1318 } | 1319 } | 
| 1319 | 1320 | 
| 1320 }  // namespace cc | 1321 }  // namespace cc | 
| OLD | NEW | 
|---|