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

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

Issue 1201573002: cc: Remove BeginFrameSourcesConstructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove refptr changes Created 5 years, 6 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
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23 matching lines...) Expand all
34 } 34 }
35 35
36 SingleThreadProxy::SingleThreadProxy( 36 SingleThreadProxy::SingleThreadProxy(
37 LayerTreeHost* layer_tree_host, 37 LayerTreeHost* layer_tree_host,
38 LayerTreeHostSingleThreadClient* client, 38 LayerTreeHostSingleThreadClient* client,
39 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 39 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
40 scoped_ptr<BeginFrameSource> external_begin_frame_source) 40 scoped_ptr<BeginFrameSource> external_begin_frame_source)
41 : Proxy(main_task_runner, NULL), 41 : Proxy(main_task_runner, NULL),
42 layer_tree_host_(layer_tree_host), 42 layer_tree_host_(layer_tree_host),
43 client_(client), 43 client_(client),
44 external_begin_frame_source_(external_begin_frame_source.Pass()),
44 timing_history_(layer_tree_host->rendering_stats_instrumentation()), 45 timing_history_(layer_tree_host->rendering_stats_instrumentation()),
45 next_frame_is_newly_committed_frame_(false), 46 next_frame_is_newly_committed_frame_(false),
46 #if DCHECK_IS_ON() 47 #if DCHECK_IS_ON()
47 inside_impl_frame_(false), 48 inside_impl_frame_(false),
48 #endif 49 #endif
49 inside_draw_(false), 50 inside_draw_(false),
50 defer_commits_(false), 51 defer_commits_(false),
51 animate_requested_(false), 52 animate_requested_(false),
52 commit_requested_(false), 53 commit_requested_(false),
53 inside_synchronous_composite_(false), 54 inside_synchronous_composite_(false),
54 output_surface_creation_requested_(false), 55 output_surface_creation_requested_(false),
55 weak_factory_(this) { 56 weak_factory_(this) {
56 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); 57 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
57 DCHECK(Proxy::IsMainThread()); 58 DCHECK(Proxy::IsMainThread());
58 DCHECK(layer_tree_host); 59 DCHECK(layer_tree_host);
59 60
60 if (layer_tree_host->settings().single_thread_proxy_scheduler && 61 if (layer_tree_host->settings().single_thread_proxy_scheduler &&
61 !scheduler_on_impl_thread_) { 62 !scheduler_on_impl_thread_) {
62 SchedulerSettings scheduler_settings( 63 SchedulerSettings scheduler_settings(
63 layer_tree_host->settings().ToSchedulerSettings()); 64 layer_tree_host->settings().ToSchedulerSettings());
64 scheduler_settings.commit_to_active_tree = CommitToActiveTree(); 65 scheduler_settings.commit_to_active_tree = CommitToActiveTree();
65 scheduler_on_impl_thread_ = Scheduler::Create( 66 scheduler_on_impl_thread_ = Scheduler::Create(
66 this, scheduler_settings, layer_tree_host_->id(), 67 this, scheduler_settings, layer_tree_host_->id(),
67 MainThreadTaskRunner(), external_begin_frame_source.Pass()); 68 MainThreadTaskRunner(), external_begin_frame_source_.get());
68 } 69 }
69 } 70 }
70 71
71 void SingleThreadProxy::Start() { 72 void SingleThreadProxy::Start() {
72 DebugScopedSetImplThread impl(this); 73 DebugScopedSetImplThread impl(this);
73 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); 74 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this);
74 } 75 }
75 76
76 SingleThreadProxy::~SingleThreadProxy() { 77 SingleThreadProxy::~SingleThreadProxy() {
77 TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy"); 78 TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy");
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 << "DidFinishImplFrame called while not inside an impl frame!"; 914 << "DidFinishImplFrame called while not inside an impl frame!";
914 inside_impl_frame_ = false; 915 inside_impl_frame_ = false;
915 #endif 916 #endif
916 } 917 }
917 918
918 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 919 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
919 layer_tree_host_->SendBeginFramesToChildren(args); 920 layer_tree_host_->SendBeginFramesToChildren(args);
920 } 921 }
921 922
922 } // namespace cc 923 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698