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

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

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BrowserCompositorOutputSurface owns;scheduler decides Created 4 years, 9 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/animation/animation_events.h" 10 #include "cc/animation/animation_events.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 // TODO(brianderson): We should not be receiving 0 intervals. 482 // TODO(brianderson): We should not be receiving 0 intervals.
483 interval = BeginFrameArgs::DefaultInterval(); 483 interval = BeginFrameArgs::DefaultInterval();
484 } 484 }
485 485
486 last_vsync_timebase_ = timebase; 486 last_vsync_timebase_ = timebase;
487 487
488 if (synthetic_begin_frame_source_) 488 if (synthetic_begin_frame_source_)
489 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval); 489 synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval);
490 } 490 }
491 491
492 void SingleThreadProxy::SetBeginFrameSource(BeginFrameSource* source) {
493 // This should only happen when using the scheduler.
494 DCHECK(layer_tree_host_->settings().single_thread_proxy_scheduler);
495 // TODO(enne): this overrides any preexisting begin frame source. Those
no sievers 2016/03/25 18:55:08 Yea see other comment wrt Android. Since it curren
496 // other sources will eventually be removed and this will be the only path.
497 scheduler_on_impl_thread_->SetBeginFrameSource(source);
498 }
499
492 void SingleThreadProxy::SetEstimatedParentDrawTime(base::TimeDelta draw_time) { 500 void SingleThreadProxy::SetEstimatedParentDrawTime(base::TimeDelta draw_time) {
493 if (scheduler_on_impl_thread_) 501 if (scheduler_on_impl_thread_)
494 scheduler_on_impl_thread_->SetEstimatedParentDrawTime(draw_time); 502 scheduler_on_impl_thread_->SetEstimatedParentDrawTime(draw_time);
495 } 503 }
496 504
497 void SingleThreadProxy::DidSwapBuffersOnImplThread() { 505 void SingleThreadProxy::DidSwapBuffersOnImplThread() {
498 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersOnImplThread"); 506 TRACE_EVENT0("cc", "SingleThreadProxy::DidSwapBuffersOnImplThread");
499 if (scheduler_on_impl_thread_) 507 if (scheduler_on_impl_thread_)
500 scheduler_on_impl_thread_->DidSwapBuffers(); 508 scheduler_on_impl_thread_->DidSwapBuffers();
501 client_->DidPostSwapBuffers(); 509 client_->DidPostSwapBuffers();
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 << "DidFinishImplFrame called while not inside an impl frame!"; 905 << "DidFinishImplFrame called while not inside an impl frame!";
898 inside_impl_frame_ = false; 906 inside_impl_frame_ = false;
899 #endif 907 #endif
900 } 908 }
901 909
902 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 910 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
903 layer_tree_host_->SendBeginFramesToChildren(args); 911 layer_tree_host_->SendBeginFramesToChildren(args);
904 } 912 }
905 913
906 } // namespace cc 914 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698