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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // We guard PrepareToDraw() with CanDraw() because it always returns a valid | 423 // We guard PrepareToDraw() with CanDraw() because it always returns a valid |
424 // frame, so can only be used when such a frame is possible. Since | 424 // frame, so can only be used when such a frame is possible. Since |
425 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on | 425 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on |
426 // CanDraw() as well. | 426 // CanDraw() as well. |
427 if (!ShouldComposite()) { | 427 if (!ShouldComposite()) { |
428 UpdateBackgroundAnimateTicking(); | 428 UpdateBackgroundAnimateTicking(); |
429 return false; | 429 return false; |
430 } | 430 } |
431 | 431 |
432 layer_tree_host_impl_->Animate( | 432 layer_tree_host_impl_->Animate( |
433 layer_tree_host_impl_->CurrentFrameTimeTicks()); | 433 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); |
434 UpdateBackgroundAnimateTicking(); | 434 UpdateBackgroundAnimateTicking(); |
435 | 435 |
436 if (!layer_tree_host_impl_->IsContextLost()) { | 436 if (!layer_tree_host_impl_->IsContextLost()) { |
437 layer_tree_host_impl_->PrepareToDraw(frame); | 437 layer_tree_host_impl_->PrepareToDraw(frame); |
438 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); | 438 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); |
439 layer_tree_host_impl_->DidDrawAllLayers(*frame); | 439 layer_tree_host_impl_->DidDrawAllLayers(*frame); |
440 } | 440 } |
441 lost_output_surface = layer_tree_host_impl_->IsContextLost(); | 441 lost_output_surface = layer_tree_host_impl_->IsContextLost(); |
442 | 442 |
443 bool start_ready_animations = true; | 443 bool start_ready_animations = true; |
444 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); | 444 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); |
445 | 445 |
446 layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame(); | 446 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); |
447 } | 447 } |
448 | 448 |
449 if (lost_output_surface) { | 449 if (lost_output_surface) { |
450 layer_tree_host_->DidLoseOutputSurface(); | 450 layer_tree_host_->DidLoseOutputSurface(); |
451 return false; | 451 return false; |
452 } | 452 } |
453 | 453 |
454 return true; | 454 return true; |
455 } | 455 } |
456 | 456 |
457 void SingleThreadProxy::DidSwapFrame() { | 457 void SingleThreadProxy::DidSwapFrame() { |
458 if (next_frame_is_newly_committed_frame_) { | 458 if (next_frame_is_newly_committed_frame_) { |
459 next_frame_is_newly_committed_frame_ = false; | 459 next_frame_is_newly_committed_frame_ = false; |
460 layer_tree_host_->DidCommitAndDrawFrame(); | 460 layer_tree_host_->DidCommitAndDrawFrame(); |
461 } | 461 } |
462 } | 462 } |
463 | 463 |
464 bool SingleThreadProxy::MainFrameWillHappenForTesting() { | 464 bool SingleThreadProxy::MainFrameWillHappenForTesting() { |
465 return false; | 465 return false; |
466 } | 466 } |
467 | 467 |
468 } // namespace cc | 468 } // namespace cc |
OLD | NEW |