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

Unified Diff: cc/trees/thread_proxy.cc

Issue 619843002: cc: Make separate interface for BeginFrame ipc from OutputSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 1c75993681150191623db568a75e03e34ec3830b..cb3ab4d2f847e355eb2614e71f47eac0d43eb0a2 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<ExternalBeginFrameSource> 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<ExternalBeginFrameSource> 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_(external_begin_frame_source.Pass()) {
TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy");
DCHECK(IsMainThread());
DCHECK(this->layer_tree_host());
@@ -348,10 +353,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);
}
@@ -1175,7 +1176,8 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
impl().scheduler = Scheduler::Create(this,
scheduler_settings,
impl().layer_tree_host_id,
- ImplThreadTaskRunner());
+ ImplThreadTaskRunner(),
+ external_begin_frame_source_.Pass());
impl().scheduler->SetVisible(impl().layer_tree_host_impl->visible());
impl_thread_weak_ptr_ = impl().weak_factory.GetWeakPtr();
@@ -1235,7 +1237,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();

Powered by Google App Engine
This is Rietveld 408576698