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

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

Issue 1111743002: cc: Adding DidFinishImplFrame to LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto master after landing other patch. Created 5 years, 7 months 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/profiler/scoped_tracker.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/debug/benchmark_instrumentation.h" 10 #include "cc/debug/benchmark_instrumentation.h"
(...skipping 27 matching lines...) Expand all
38 SingleThreadProxy::SingleThreadProxy( 38 SingleThreadProxy::SingleThreadProxy(
39 LayerTreeHost* layer_tree_host, 39 LayerTreeHost* layer_tree_host,
40 LayerTreeHostSingleThreadClient* client, 40 LayerTreeHostSingleThreadClient* client,
41 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 41 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
42 scoped_ptr<BeginFrameSource> external_begin_frame_source) 42 scoped_ptr<BeginFrameSource> external_begin_frame_source)
43 : Proxy(main_task_runner, NULL), 43 : Proxy(main_task_runner, NULL),
44 layer_tree_host_(layer_tree_host), 44 layer_tree_host_(layer_tree_host),
45 client_(client), 45 client_(client),
46 timing_history_(layer_tree_host->rendering_stats_instrumentation()), 46 timing_history_(layer_tree_host->rendering_stats_instrumentation()),
47 next_frame_is_newly_committed_frame_(false), 47 next_frame_is_newly_committed_frame_(false),
48 inside_impl_frame_(false), 48 inside_impl_frame_(false),
danakj 2015/05/04 17:43:00 We could make this variable only exist when DCHECK
mithro-old 2015/05/05 04:13:13 I attempted this, but because of the number of pla
danakj 2015/05/05 18:42:00 Well, there's like 4 places? There's no need to gr
mithro-old 2015/05/06 02:14:11 Added it back in. BTW It's actually 8 places. Eve
49 inside_draw_(false), 49 inside_draw_(false),
50 defer_commits_(false), 50 defer_commits_(false),
51 animate_requested_(false), 51 animate_requested_(false),
52 commit_requested_(false), 52 commit_requested_(false),
53 inside_synchronous_composite_(false), 53 inside_synchronous_composite_(false),
54 output_surface_creation_requested_(false), 54 output_surface_creation_requested_(false),
55 weak_factory_(this) { 55 weak_factory_(this) {
56 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); 56 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
57 DCHECK(Proxy::IsMainThread()); 57 DCHECK(Proxy::IsMainThread());
58 DCHECK(layer_tree_host); 58 DCHECK(layer_tree_host);
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 "461509 SingleThreadProxy::DoComposite4")); 710 "461509 SingleThreadProxy::DoComposite4"));
711 layer_tree_host_impl_->DidDrawAllLayers(*frame); 711 layer_tree_host_impl_->DidDrawAllLayers(*frame);
712 712
713 bool start_ready_animations = draw_frame; 713 bool start_ready_animations = draw_frame;
714 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509 714 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
715 // is fixed. 715 // is fixed.
716 tracked_objects::ScopedTracker tracking_profile5( 716 tracked_objects::ScopedTracker tracking_profile5(
717 FROM_HERE_WITH_EXPLICIT_FUNCTION( 717 FROM_HERE_WITH_EXPLICIT_FUNCTION(
718 "461509 SingleThreadProxy::DoComposite5")); 718 "461509 SingleThreadProxy::DoComposite5"));
719 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); 719 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
720 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
721 // is fixed.
722 tracked_objects::ScopedTracker tracking_profile6(
723 FROM_HERE_WITH_EXPLICIT_FUNCTION(
724 "461509 SingleThreadProxy::DoComposite6"));
725 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
726 720
727 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509 721 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
728 // is fixed. 722 // is fixed.
729 tracked_objects::ScopedTracker tracking_profile7( 723 tracked_objects::ScopedTracker tracking_profile7(
730 FROM_HERE_WITH_EXPLICIT_FUNCTION( 724 FROM_HERE_WITH_EXPLICIT_FUNCTION(
731 "461509 SingleThreadProxy::DoComposite7")); 725 "461509 SingleThreadProxy::DoComposite7"));
732 timing_history_.DidFinishDrawing(); 726 timing_history_.DidFinishDrawing();
733 } 727 }
734 728
735 if (draw_frame) { 729 if (draw_frame) {
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 } 960 }
967 961
968 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() { 962 base::TimeDelta SingleThreadProxy::BeginMainFrameToCommitDurationEstimate() {
969 return timing_history_.BeginMainFrameToCommitDurationEstimate(); 963 return timing_history_.BeginMainFrameToCommitDurationEstimate();
970 } 964 }
971 965
972 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { 966 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() {
973 return timing_history_.CommitToActivateDurationEstimate(); 967 return timing_history_.CommitToActivateDurationEstimate();
974 } 968 }
975 969
976 void SingleThreadProxy::DidBeginImplFrameDeadline() { 970 void SingleThreadProxy::DidFinishImplFrame() {
977 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); 971 layer_tree_host_impl_->DidFinishImplFrame();
978 DCHECK(inside_impl_frame_) 972 DCHECK(inside_impl_frame_)
979 << "DidBeginImplFrameDeadline called while not inside an impl frame!"; 973 << "DidBeginImplFrameDeadline called while not inside an impl frame!";
980 inside_impl_frame_ = false; 974 inside_impl_frame_ = false;
981 } 975 }
982 976
983 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 977 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
984 layer_tree_host_->SendBeginFramesToChildren(args); 978 layer_tree_host_->SendBeginFramesToChildren(args);
985 } 979 }
986 980
987 } // namespace cc 981 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698