Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index 65e8dd27a35de390d404d951d5b701fc56dc5224..0ec74adb21092f2a591496777519de7514013e6c 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -48,22 +48,27 @@ struct ThreadProxy::SchedulerStateRequest { |
scoped_ptr<Proxy> ThreadProxy::Create( |
LayerTreeHost* layer_tree_host, |
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
- scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) { |
- return make_scoped_ptr( |
- new ThreadProxy(layer_tree_host, main_task_runner, impl_task_runner)); |
+ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
+ scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
+ return make_scoped_ptr(new ThreadProxy(layer_tree_host, |
+ main_task_runner, |
+ impl_task_runner, |
+ external_begin_frame_source.Pass())); |
} |
ThreadProxy::ThreadProxy( |
LayerTreeHost* layer_tree_host, |
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
- scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner) |
+ scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
+ scoped_ptr<BeginFrameSource> external_begin_frame_source) |
: Proxy(main_task_runner, impl_task_runner), |
main_thread_only_vars_unsafe_(this, layer_tree_host->id()), |
main_thread_or_blocked_vars_unsafe_(layer_tree_host), |
compositor_thread_vars_unsafe_( |
this, |
layer_tree_host->id(), |
- layer_tree_host->rendering_stats_instrumentation()) { |
+ layer_tree_host->rendering_stats_instrumentation(), |
+ external_begin_frame_source.Pass()) { |
TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy"); |
DCHECK(IsMainThread()); |
DCHECK(this->layer_tree_host()); |
@@ -99,7 +104,8 @@ ThreadProxy::MainThreadOrBlockedMainThread::contents_texture_manager() { |
ThreadProxy::CompositorThreadOnly::CompositorThreadOnly( |
ThreadProxy* proxy, |
int layer_tree_host_id, |
- RenderingStatsInstrumentation* rendering_stats_instrumentation) |
+ RenderingStatsInstrumentation* rendering_stats_instrumentation, |
+ scoped_ptr<BeginFrameSource> external_begin_frame_source) |
: layer_tree_host_id(layer_tree_host_id), |
contents_texture_manager(NULL), |
commit_completion_event(NULL), |
@@ -113,6 +119,7 @@ ThreadProxy::CompositorThreadOnly::CompositorThreadOnly( |
base::TimeDelta::FromMilliseconds( |
kSmoothnessTakesPriorityExpirationDelay * 1000)), |
timing_history(rendering_stats_instrumentation), |
+ external_begin_frame_source(external_begin_frame_source.Pass()), |
weak_factory(proxy) { |
} |
@@ -336,10 +343,6 @@ void ThreadProxy::DidSwapBuffersCompleteOnImplThread() { |
base::Bind(&ThreadProxy::DidCompleteSwapBuffers, main_thread_weak_ptr_)); |
} |
-BeginFrameSource* ThreadProxy::ExternalBeginFrameSource() { |
- return impl().layer_tree_host_impl.get(); |
-} |
- |
void ThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) { |
impl().layer_tree_host_impl->WillBeginImplFrame(args); |
} |
@@ -1144,13 +1147,14 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { |
impl().layer_tree_host_impl = |
layer_tree_host()->CreateLayerTreeHostImpl(this); |
SchedulerSettings scheduler_settings(layer_tree_host()->settings()); |
- impl().scheduler = Scheduler::Create(this, |
- scheduler_settings, |
- impl().layer_tree_host_id, |
- ImplThreadTaskRunner(), |
- base::PowerMonitor::Get()); |
+ impl().scheduler = Scheduler::Create( |
+ this, |
+ scheduler_settings, |
+ impl().layer_tree_host_id, |
+ ImplThreadTaskRunner(), |
+ base::PowerMonitor::Get(), |
+ impl().external_begin_frame_source.Pass()); |
impl().scheduler->SetVisible(impl().layer_tree_host_impl->visible()); |
- |
impl_thread_weak_ptr_ = impl().weak_factory.GetWeakPtr(); |
completion->Signal(); |
} |
@@ -1208,7 +1212,6 @@ void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) { |
layer_tree_host()->DeleteContentsTexturesOnImplThread( |
impl().layer_tree_host_impl->resource_provider()); |
impl().current_resource_update_controller = nullptr; |
- impl().layer_tree_host_impl->SetNeedsBeginFrames(false); |
impl().scheduler = nullptr; |
impl().layer_tree_host_impl = nullptr; |
impl().weak_factory.InvalidateWeakPtrs(); |