Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: cc/trees/single_thread_proxy.cc

Issue 787763006: cc: Adding BeginFrameTracker object and removing Now() from LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing gn bots. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 // RequestNewOutputSurface could have synchronously created an output 487 // RequestNewOutputSurface could have synchronously created an output
488 // surface, so check again before returning. 488 // surface, so check again before returning.
489 if (layer_tree_host_->output_surface_lost()) 489 if (layer_tree_host_->output_surface_lost())
490 return; 490 return;
491 } 491 }
492 492
493 { 493 {
494 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( 494 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create(
495 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(), 495 BEGINFRAME_FROM_HERE, frame_begin_time, base::TimeTicks(),
496 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::SYNCHRONOUS)); 496 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::SYNCHRONOUS));
497 layer_tree_host_impl_->UpdateCurrentBeginFrameArgs(begin_frame_args);
497 DoBeginMainFrame(begin_frame_args); 498 DoBeginMainFrame(begin_frame_args);
498 DoCommit(); 499 DoCommit();
499 500
500 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises()) 501 DCHECK_EQ(0u, layer_tree_host_->num_queued_swap_promises())
501 << "Commit should always succeed and transfer promises."; 502 << "Commit should always succeed and transfer promises.";
502 } 503 }
503 504
504 { 505 {
505 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); 506 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this));
506 if (layer_tree_host_impl_->settings().impl_side_painting) { 507 if (layer_tree_host_impl_->settings().impl_side_painting) {
507 layer_tree_host_impl_->ActivateSyncTree(); 508 layer_tree_host_impl_->ActivateSyncTree();
508 layer_tree_host_impl_->active_tree()->UpdateDrawProperties(); 509 layer_tree_host_impl_->active_tree()->UpdateDrawProperties();
509 layer_tree_host_impl_->PrepareTiles(); 510 layer_tree_host_impl_->PrepareTiles();
510 layer_tree_host_impl_->SynchronouslyInitializeAllTiles(); 511 layer_tree_host_impl_->SynchronouslyInitializeAllTiles();
511 } 512 }
512 513
513 DoAnimate(); 514 DoAnimate();
514 515
515 LayerTreeHostImpl::FrameData frame; 516 LayerTreeHostImpl::FrameData frame;
516 DoComposite(frame_begin_time, &frame); 517 DoComposite(frame_begin_time, &frame);
517 518
518 // DoComposite could abort, but because this is a synchronous composite 519 // DoComposite could abort, but because this is a synchronous composite
519 // another draw will never be scheduled, so break remaining promises. 520 // another draw will never be scheduled, so break remaining promises.
520 layer_tree_host_impl_->active_tree()->BreakSwapPromises( 521 layer_tree_host_impl_->active_tree()->BreakSwapPromises(
521 SwapPromise::SWAP_FAILS); 522 SwapPromise::SWAP_FAILS);
523
524 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
522 } 525 }
523 } 526 }
524 527
525 void SingleThreadProxy::AsValueInto(base::debug::TracedValue* state) const { 528 void SingleThreadProxy::AsValueInto(base::debug::TracedValue* state) const {
526 // The following line casts away const modifiers because it is just 529 // The following line casts away const modifiers because it is just
527 // setting debug state. We still want the AsValue() function and its 530 // setting debug state. We still want the AsValue() function and its
528 // call chain to be const throughout. 531 // call chain to be const throughout.
529 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); 532 DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this));
530 533
531 state->BeginDictionary("layer_tree_host_impl"); 534 state->BeginDictionary("layer_tree_host_impl");
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 timing_history_.DidStartDrawing(); 589 timing_history_.DidStartDrawing();
587 590
588 draw_result = layer_tree_host_impl_->PrepareToDraw(frame); 591 draw_result = layer_tree_host_impl_->PrepareToDraw(frame);
589 draw_frame = draw_result == DRAW_SUCCESS; 592 draw_frame = draw_result == DRAW_SUCCESS;
590 if (draw_frame) 593 if (draw_frame)
591 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time); 594 layer_tree_host_impl_->DrawLayers(frame, frame_begin_time);
592 layer_tree_host_impl_->DidDrawAllLayers(*frame); 595 layer_tree_host_impl_->DidDrawAllLayers(*frame);
593 596
594 bool start_ready_animations = draw_frame; 597 bool start_ready_animations = draw_frame;
595 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); 598 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
596 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
brianderson 2014/12/18 02:01:38 Why does this need to move?
mithro-old 2014/12/18 17:22:41 Because it's currently in the wrong place as code
597 599
598 timing_history_.DidFinishDrawing(); 600 timing_history_.DidFinishDrawing();
599 } 601 }
600 602
601 if (draw_frame) { 603 if (draw_frame) {
602 DebugScopedSetImplThread impl(this); 604 DebugScopedSetImplThread impl(this);
603 605
604 // This CapturePostTasks should be destroyed before 606 // This CapturePostTasks should be destroyed before
605 // DidCommitAndDrawFrame() is called since that goes out to the 607 // DidCommitAndDrawFrame() is called since that goes out to the
606 // embedder, 608 // embedder,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 796
795 void SingleThreadProxy::DidBeginImplFrameDeadline() { 797 void SingleThreadProxy::DidBeginImplFrameDeadline() {
796 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); 798 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
797 } 799 }
798 800
799 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 801 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
800 layer_tree_host_->SendBeginFramesToChildren(args); 802 layer_tree_host_->SendBeginFramesToChildren(args);
801 } 803 }
802 804
803 } // namespace cc 805 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_unittest_context.cc ('K') | « cc/trees/layer_tree_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698