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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
10 #include "cc/output/context_provider.h" | 10 #include "cc/output/context_provider.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 // We guard PrepareToDraw() with CanDraw() because it always returns a valid | 526 // We guard PrepareToDraw() with CanDraw() because it always returns a valid |
527 // frame, so can only be used when such a frame is possible. Since | 527 // frame, so can only be used when such a frame is possible. Since |
528 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on | 528 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on |
529 // CanDraw() as well. | 529 // CanDraw() as well. |
530 if (!ShouldComposite() || (for_readback && !can_do_readback)) { | 530 if (!ShouldComposite() || (for_readback && !can_do_readback)) { |
531 UpdateBackgroundAnimateTicking(); | 531 UpdateBackgroundAnimateTicking(); |
532 return false; | 532 return false; |
533 } | 533 } |
534 | 534 |
535 layer_tree_host_impl_->Animate( | 535 layer_tree_host_impl_->Animate( |
536 layer_tree_host_impl_->CurrentFrameTimeTicks(), | 536 layer_tree_host_impl_->CurrentFrameTimeTicks()); |
537 layer_tree_host_impl_->CurrentFrameTime()); | |
538 UpdateBackgroundAnimateTicking(); | 537 UpdateBackgroundAnimateTicking(); |
539 | 538 |
540 if (!layer_tree_host_impl_->IsContextLost()) { | 539 if (!layer_tree_host_impl_->IsContextLost()) { |
541 layer_tree_host_impl_->PrepareToDraw(frame, device_viewport_damage_rect); | 540 layer_tree_host_impl_->PrepareToDraw(frame, device_viewport_damage_rect); |
542 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); | 541 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); |
543 layer_tree_host_impl_->DidDrawAllLayers(*frame); | 542 layer_tree_host_impl_->DidDrawAllLayers(*frame); |
544 } | 543 } |
545 lost_output_surface = layer_tree_host_impl_->IsContextLost(); | 544 lost_output_surface = layer_tree_host_impl_->IsContextLost(); |
546 | 545 |
547 bool start_ready_animations = true; | 546 bool start_ready_animations = true; |
(...skipping 17 matching lines...) Expand all Loading... |
565 void SingleThreadProxy::DidSwapFrame() { | 564 void SingleThreadProxy::DidSwapFrame() { |
566 if (next_frame_is_newly_committed_frame_) { | 565 if (next_frame_is_newly_committed_frame_) { |
567 next_frame_is_newly_committed_frame_ = false; | 566 next_frame_is_newly_committed_frame_ = false; |
568 layer_tree_host_->DidCommitAndDrawFrame(); | 567 layer_tree_host_->DidCommitAndDrawFrame(); |
569 } | 568 } |
570 } | 569 } |
571 | 570 |
572 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 571 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
573 | 572 |
574 } // namespace cc | 573 } // namespace cc |
OLD | NEW |