| 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 // request completes, and we signal completion here. If CanDraw() is false, we | 574 // request completes, and we signal completion here. If CanDraw() is false, we |
| 575 // will indicate success=false to the caller, but we must still signal | 575 // will indicate success=false to the caller, but we must still signal |
| 576 // completion to avoid deadlock. | 576 // completion to avoid deadlock. |
| 577 | 577 |
| 578 // We guard PrepareToDraw() with CanDraw() because it always returns a valid | 578 // We guard PrepareToDraw() with CanDraw() because it always returns a valid |
| 579 // frame, so can only be used when such a frame is possible. Since | 579 // frame, so can only be used when such a frame is possible. Since |
| 580 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on | 580 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on |
| 581 // CanDraw() as well. | 581 // CanDraw() as well. |
| 582 | 582 |
| 583 LayerTreeHostImpl::FrameData frame; | 583 LayerTreeHostImpl::FrameData frame; |
| 584 frame.begin_frame_source_id = scheduler_->CurrentBeginFrameSourceId(); |
| 585 frame.begin_frame_number = scheduler_->CurrentBeginFrameNumber(); |
| 586 frame.latest_confirmed_frame = |
| 587 scheduler_->LatestConfirmedFrameForActiveTree(); |
| 584 bool draw_frame = false; | 588 bool draw_frame = false; |
| 585 | 589 |
| 586 DrawResult result; | 590 DrawResult result; |
| 587 if (layer_tree_host_impl_->CanDraw()) { | 591 if (layer_tree_host_impl_->CanDraw()) { |
| 588 result = layer_tree_host_impl_->PrepareToDraw(&frame); | 592 result = layer_tree_host_impl_->PrepareToDraw(&frame); |
| 589 draw_frame = forced_draw || result == DRAW_SUCCESS; | 593 draw_frame = forced_draw || result == DRAW_SUCCESS; |
| 590 } else { | 594 } else { |
| 591 result = DRAW_ABORTED_CANT_DRAW; | 595 result = DRAW_ABORTED_CANT_DRAW; |
| 592 } | 596 } |
| 593 | 597 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { | 632 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { |
| 629 DCHECK(IsMainThreadBlocked() && commit_completion_event_); | 633 DCHECK(IsMainThreadBlocked() && commit_completion_event_); |
| 630 return main_thread_blocked_commit_vars_unsafe_; | 634 return main_thread_blocked_commit_vars_unsafe_; |
| 631 } | 635 } |
| 632 | 636 |
| 633 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { | 637 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { |
| 634 return task_runner_provider_->MainThreadTaskRunner(); | 638 return task_runner_provider_->MainThreadTaskRunner(); |
| 635 } | 639 } |
| 636 | 640 |
| 637 } // namespace cc | 641 } // namespace cc |
| OLD | NEW |