| 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/thread_proxy.h" | 5 #include "cc/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/context_provider.h" | 10 #include "cc/context_provider.h" |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 // We guard prepareToDraw() with canDraw() because it always returns a valid | 909 // We guard prepareToDraw() with canDraw() because it always returns a valid |
| 910 // frame, so can only be used when such a frame is possible. Since | 910 // frame, so can only be used when such a frame is possible. Since |
| 911 // drawLayers() depends on the result of prepareToDraw(), it is guarded on | 911 // drawLayers() depends on the result of prepareToDraw(), it is guarded on |
| 912 // canDraw() as well. | 912 // canDraw() as well. |
| 913 | 913 |
| 914 LayerTreeHostImpl::FrameData frame; | 914 LayerTreeHostImpl::FrameData frame; |
| 915 bool draw_frame = | 915 bool draw_frame = |
| 916 layer_tree_host_impl_->CanDraw() && | 916 layer_tree_host_impl_->CanDraw() && |
| 917 (layer_tree_host_impl_->PrepareToDraw(&frame) || forced_draw); | 917 (layer_tree_host_impl_->PrepareToDraw(&frame) || forced_draw); |
| 918 if (draw_frame) { | 918 if (draw_frame) { |
| 919 layer_tree_host_impl_->DrawLayers(&frame); | 919 layer_tree_host_impl_->DrawLayers( |
| 920 &frame, |
| 921 scheduler_on_impl_thread_->lastVSyncTime()); |
| 920 result.didDraw = true; | 922 result.didDraw = true; |
| 921 } | 923 } |
| 922 layer_tree_host_impl_->DidDrawAllLayers(frame); | 924 layer_tree_host_impl_->DidDrawAllLayers(frame); |
| 923 | 925 |
| 924 // Check for tree activation. | 926 // Check for tree activation. |
| 925 if (completion_event_for_commit_held_on_tree_activation_ && | 927 if (completion_event_for_commit_held_on_tree_activation_ && |
| 926 !layer_tree_host_impl_->pending_tree()) { | 928 !layer_tree_host_impl_->pending_tree()) { |
| 927 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation"); | 929 TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation"); |
| 928 DCHECK(layer_tree_host_impl_->settings().implSidePainting); | 930 DCHECK(layer_tree_host_impl_->settings().implSidePainting); |
| 929 completion_event_for_commit_held_on_tree_activation_->signal(); | 931 completion_event_for_commit_held_on_tree_activation_->signal(); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 } | 1318 } |
| 1317 | 1319 |
| 1318 void ThreadProxy::RenewTreePriorityOnImplThread() { | 1320 void ThreadProxy::RenewTreePriorityOnImplThread() { |
| 1319 DCHECK(renew_tree_priority_on_impl_thread_pending_); | 1321 DCHECK(renew_tree_priority_on_impl_thread_pending_); |
| 1320 renew_tree_priority_on_impl_thread_pending_ = false; | 1322 renew_tree_priority_on_impl_thread_pending_ = false; |
| 1321 | 1323 |
| 1322 RenewTreePriority(); | 1324 RenewTreePriority(); |
| 1323 } | 1325 } |
| 1324 | 1326 |
| 1325 } // namespace cc | 1327 } // namespace cc |
| OLD | NEW |