| 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/single_thread_proxy.h" | 5 #include "cc/trees/single_thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 // the DidCommitAndDrawFrame() must be post-tasked from the impl thread | 566 // the DidCommitAndDrawFrame() must be post-tasked from the impl thread |
| 567 // there as the main thread is not blocked, so any posted tasks inside | 567 // there as the main thread is not blocked, so any posted tasks inside |
| 568 // the swap buffers will execute first. | 568 // the swap buffers will execute first. |
| 569 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); | 569 DebugScopedSetMainThreadBlocked main_thread_blocked(task_runner_provider_); |
| 570 BlockingTaskRunner::CapturePostTasks blocked( | 570 BlockingTaskRunner::CapturePostTasks blocked( |
| 571 task_runner_provider_->blocking_main_thread_task_runner()); | 571 task_runner_provider_->blocking_main_thread_task_runner()); |
| 572 | 572 |
| 573 draw_result = layer_tree_host_impl_->PrepareToDraw(frame); | 573 draw_result = layer_tree_host_impl_->PrepareToDraw(frame); |
| 574 draw_frame = draw_result == DRAW_SUCCESS; | 574 draw_frame = draw_result == DRAW_SUCCESS; |
| 575 if (draw_frame) { | 575 if (draw_frame) { |
| 576 layer_tree_host_impl_->DrawLayers(frame); | 576 if (layer_tree_host_impl_->DrawLayers(frame)) { |
| 577 if (layer_tree_host_impl_->SwapBuffers(*frame)) { | |
| 578 if (scheduler_on_impl_thread_) | 577 if (scheduler_on_impl_thread_) |
| 579 scheduler_on_impl_thread_->DidSwapBuffers(); | 578 scheduler_on_impl_thread_->DidSwapBuffers(); |
| 580 client_->DidPostSwapBuffers(); | 579 client_->DidPostSwapBuffers(); |
| 581 } | 580 } |
| 582 } | 581 } |
| 583 layer_tree_host_impl_->DidDrawAllLayers(*frame); | 582 layer_tree_host_impl_->DidDrawAllLayers(*frame); |
| 584 | 583 |
| 585 bool start_ready_animations = draw_frame; | 584 bool start_ready_animations = draw_frame; |
| 586 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); | 585 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); |
| 587 } | 586 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 void SingleThreadProxy::DidFinishImplFrame() { | 766 void SingleThreadProxy::DidFinishImplFrame() { |
| 768 layer_tree_host_impl_->DidFinishImplFrame(); | 767 layer_tree_host_impl_->DidFinishImplFrame(); |
| 769 #if DCHECK_IS_ON() | 768 #if DCHECK_IS_ON() |
| 770 DCHECK(inside_impl_frame_) | 769 DCHECK(inside_impl_frame_) |
| 771 << "DidFinishImplFrame called while not inside an impl frame!"; | 770 << "DidFinishImplFrame called while not inside an impl frame!"; |
| 772 inside_impl_frame_ = false; | 771 inside_impl_frame_ = false; |
| 773 #endif | 772 #endif |
| 774 } | 773 } |
| 775 | 774 |
| 776 } // namespace cc | 775 } // namespace cc |
| OLD | NEW |