OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/proxy_impl.h" | 5 #include "cc/trees/proxy_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 } else { | 611 } else { |
612 result = DRAW_ABORTED_CANT_DRAW; | 612 result = DRAW_ABORTED_CANT_DRAW; |
613 } | 613 } |
614 | 614 |
615 if (draw_frame) { | 615 if (draw_frame) { |
616 layer_tree_host_impl_->DrawLayers(&frame); | 616 layer_tree_host_impl_->DrawLayers(&frame); |
617 result = DRAW_SUCCESS; | 617 result = DRAW_SUCCESS; |
618 } else { | 618 } else { |
619 DCHECK_NE(DRAW_SUCCESS, result); | 619 DCHECK_NE(DRAW_SUCCESS, result); |
620 } | 620 } |
621 layer_tree_host_impl_->DidDrawAllLayers(frame); | |
622 | |
623 bool start_ready_animations = draw_frame; | |
624 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); | |
625 | 621 |
626 if (draw_frame) { | 622 if (draw_frame) { |
627 if (layer_tree_host_impl_->SwapBuffers(frame)) | 623 if (layer_tree_host_impl_->SwapBuffers(frame)) |
628 scheduler_->DidSwapBuffers(); | 624 scheduler_->DidSwapBuffers(); |
629 } | 625 } |
630 | 626 |
| 627 layer_tree_host_impl_->DidDrawAllLayers(frame); |
| 628 |
| 629 bool start_ready_animations = draw_frame; |
| 630 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); |
| 631 |
631 // Tell the main thread that the the newly-commited frame was drawn. | 632 // Tell the main thread that the the newly-commited frame was drawn. |
632 if (next_frame_is_newly_committed_frame_) { | 633 if (next_frame_is_newly_committed_frame_) { |
633 next_frame_is_newly_committed_frame_ = false; | 634 next_frame_is_newly_committed_frame_ = false; |
634 channel_impl_->DidCommitAndDrawFrame(); | 635 channel_impl_->DidCommitAndDrawFrame(); |
635 } | 636 } |
636 | 637 |
637 DCHECK_NE(INVALID_RESULT, result); | 638 DCHECK_NE(INVALID_RESULT, result); |
638 return result; | 639 return result; |
639 } | 640 } |
640 | 641 |
641 bool ProxyImpl::IsImplThread() const { | 642 bool ProxyImpl::IsImplThread() const { |
642 return task_runner_provider_->IsImplThread(); | 643 return task_runner_provider_->IsImplThread(); |
643 } | 644 } |
644 | 645 |
645 bool ProxyImpl::IsMainThreadBlocked() const { | 646 bool ProxyImpl::IsMainThreadBlocked() const { |
646 return task_runner_provider_->IsMainThreadBlocked(); | 647 return task_runner_provider_->IsMainThreadBlocked(); |
647 } | 648 } |
648 | 649 |
649 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 650 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
650 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 651 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
651 return main_thread_blocked_commit_vars_unsafe_; | 652 return main_thread_blocked_commit_vars_unsafe_; |
652 } | 653 } |
653 | 654 |
654 } // namespace cc | 655 } // namespace cc |
OLD | NEW |