| 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 // request completes, and we signal completion here. If CanDraw() is false, we | 581 // request completes, and we signal completion here. If CanDraw() is false, we |
| 582 // will indicate success=false to the caller, but we must still signal | 582 // will indicate success=false to the caller, but we must still signal |
| 583 // completion to avoid deadlock. | 583 // completion to avoid deadlock. |
| 584 | 584 |
| 585 // We guard PrepareToDraw() with CanDraw() because it always returns a valid | 585 // We guard PrepareToDraw() with CanDraw() because it always returns a valid |
| 586 // frame, so can only be used when such a frame is possible. Since | 586 // frame, so can only be used when such a frame is possible. Since |
| 587 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on | 587 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on |
| 588 // CanDraw() as well. | 588 // CanDraw() as well. |
| 589 | 589 |
| 590 LayerTreeHostImpl::FrameData frame; | 590 LayerTreeHostImpl::FrameData frame; |
| 591 frame.begin_frame_source_id = scheduler_->CurrentBeginFrameSourceId(); |
| 592 frame.begin_frame_sequence_number = |
| 593 scheduler_->CurrentBeginFrameSequenceNumber(); |
| 594 frame.latest_confirmed_begin_frame_sequence_number = |
| 595 scheduler_->LatestConfirmedBeginFrameSequenceNumberForActiveTree(); |
| 591 bool draw_frame = false; | 596 bool draw_frame = false; |
| 592 | 597 |
| 593 DrawResult result; | 598 DrawResult result; |
| 594 if (layer_tree_host_impl_->CanDraw()) { | 599 if (layer_tree_host_impl_->CanDraw()) { |
| 595 result = layer_tree_host_impl_->PrepareToDraw(&frame); | 600 result = layer_tree_host_impl_->PrepareToDraw(&frame); |
| 596 draw_frame = forced_draw || result == DRAW_SUCCESS; | 601 draw_frame = forced_draw || result == DRAW_SUCCESS; |
| 597 } else { | 602 } else { |
| 598 result = DRAW_ABORTED_CANT_DRAW; | 603 result = DRAW_ABORTED_CANT_DRAW; |
| 599 } | 604 } |
| 600 | 605 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 640 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
| 636 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 641 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
| 637 return main_thread_blocked_commit_vars_unsafe_; | 642 return main_thread_blocked_commit_vars_unsafe_; |
| 638 } | 643 } |
| 639 | 644 |
| 640 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { | 645 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { |
| 641 return task_runner_provider_->MainThreadTaskRunner(); | 646 return task_runner_provider_->MainThreadTaskRunner(); |
| 642 } | 647 } |
| 643 | 648 |
| 644 } // namespace cc | 649 } // namespace cc |
| OLD | NEW |