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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // We guard PrepareToDraw() with CanDraw() because it always returns a valid | 420 // We guard PrepareToDraw() with CanDraw() because it always returns a valid |
421 // frame, so can only be used when such a frame is possible. Since | 421 // frame, so can only be used when such a frame is possible. Since |
422 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on | 422 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on |
423 // CanDraw() as well. | 423 // CanDraw() as well. |
424 if (!ShouldComposite()) { | 424 if (!ShouldComposite()) { |
425 UpdateBackgroundAnimateTicking(); | 425 UpdateBackgroundAnimateTicking(); |
426 return false; | 426 return false; |
427 } | 427 } |
428 | 428 |
429 layer_tree_host_impl_->Animate( | 429 layer_tree_host_impl_->Animate( |
430 layer_tree_host_impl_->CurrentFrameTimeTicks()); | 430 layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); |
431 UpdateBackgroundAnimateTicking(); | 431 UpdateBackgroundAnimateTicking(); |
432 | 432 |
433 if (!layer_tree_host_impl_->IsContextLost()) { | 433 if (!layer_tree_host_impl_->IsContextLost()) { |
434 layer_tree_host_impl_->PrepareToDraw(frame); | 434 layer_tree_host_impl_->PrepareToDraw(frame); |
435 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); | 435 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); |
436 layer_tree_host_impl_->DidDrawAllLayers(*frame); | 436 layer_tree_host_impl_->DidDrawAllLayers(*frame); |
437 } | 437 } |
438 lost_output_surface = layer_tree_host_impl_->IsContextLost(); | 438 lost_output_surface = layer_tree_host_impl_->IsContextLost(); |
439 | 439 |
440 bool start_ready_animations = true; | 440 bool start_ready_animations = true; |
(...skipping 13 matching lines...) Expand all Loading... |
454 void SingleThreadProxy::DidSwapFrame() { | 454 void SingleThreadProxy::DidSwapFrame() { |
455 if (next_frame_is_newly_committed_frame_) { | 455 if (next_frame_is_newly_committed_frame_) { |
456 next_frame_is_newly_committed_frame_ = false; | 456 next_frame_is_newly_committed_frame_ = false; |
457 layer_tree_host_->DidCommitAndDrawFrame(); | 457 layer_tree_host_->DidCommitAndDrawFrame(); |
458 } | 458 } |
459 } | 459 } |
460 | 460 |
461 bool SingleThreadProxy::CommitPendingForTesting() { return false; } | 461 bool SingleThreadProxy::CommitPendingForTesting() { return false; } |
462 | 462 |
463 } // namespace cc | 463 } // namespace cc |
OLD | NEW |