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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 if (!ShouldComposite() || (for_readback && !can_do_readback)) { | 513 if (!ShouldComposite() || (for_readback && !can_do_readback)) { |
514 UpdateBackgroundAnimateTicking(); | 514 UpdateBackgroundAnimateTicking(); |
515 return false; | 515 return false; |
516 } | 516 } |
517 | 517 |
518 layer_tree_host_impl_->Animate( | 518 layer_tree_host_impl_->Animate( |
519 layer_tree_host_impl_->CurrentFrameTimeTicks(), | 519 layer_tree_host_impl_->CurrentFrameTimeTicks(), |
520 layer_tree_host_impl_->CurrentFrameTime()); | 520 layer_tree_host_impl_->CurrentFrameTime()); |
521 UpdateBackgroundAnimateTicking(); | 521 UpdateBackgroundAnimateTicking(); |
522 | 522 |
523 layer_tree_host_impl_->PrepareToDraw(frame, device_viewport_damage_rect); | 523 if (!layer_tree_host_impl_->IsContextLost()) { |
524 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); | 524 layer_tree_host_impl_->PrepareToDraw(frame, device_viewport_damage_rect); |
525 layer_tree_host_impl_->DidDrawAllLayers(*frame); | 525 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); |
| 526 layer_tree_host_impl_->DidDrawAllLayers(*frame); |
| 527 } |
526 lost_output_surface = layer_tree_host_impl_->IsContextLost(); | 528 lost_output_surface = layer_tree_host_impl_->IsContextLost(); |
527 | 529 |
528 bool start_ready_animations = true; | 530 bool start_ready_animations = true; |
529 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); | 531 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); |
530 | 532 |
531 layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame(); | 533 layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame(); |
532 } | 534 } |
533 | 535 |
534 if (lost_output_surface) { | 536 if (lost_output_surface) { |
535 cc::ContextProvider* offscreen_contexts = | 537 cc::ContextProvider* offscreen_contexts = |
(...skipping 10 matching lines...) Expand all Loading... |
546 void SingleThreadProxy::DidSwapFrame() { | 548 void SingleThreadProxy::DidSwapFrame() { |
547 if (next_frame_is_newly_committed_frame_) { | 549 if (next_frame_is_newly_committed_frame_) { |
548 next_frame_is_newly_committed_frame_ = false; | 550 next_frame_is_newly_committed_frame_ = false; |
549 layer_tree_host_->DidCommitAndDrawFrame(); | 551 layer_tree_host_->DidCommitAndDrawFrame(); |
550 } | 552 } |
551 } | 553 } |
552 | 554 |
553 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 555 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
554 | 556 |
555 } // namespace cc | 557 } // namespace cc |
OLD | NEW |