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

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: Fix unit test compilation 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
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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 << "DidFinishImplFrame called while not inside an impl frame!"; 901 << "DidFinishImplFrame called while not inside an impl frame!";
894 inside_impl_frame_ = false; 902 inside_impl_frame_ = false;
895 #endif 903 #endif
896 } 904 }
897 905
898 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) { 906 void SingleThreadProxy::SendBeginFramesToChildren(const BeginFrameArgs& args) {
899 layer_tree_host_->SendBeginFramesToChildren(args); 907 layer_tree_host_->SendBeginFramesToChildren(args);
900 } 908 }
901 909
902 } // namespace cc 910 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698