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

Unified Diff: cc/trees/single_thread_proxy.cc

Issue 2296353002: Revert of Remove default begin frame sources from the renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | content/renderer/gpu/compositor_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/single_thread_proxy.cc
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 1b28c6d7d8ec91baf0d9cf2a6949e0e05b36e0db..81f09c5a9957acbf9fbc56a8b5ff8194a5da930f 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -75,22 +75,28 @@
CompositorTimingHistory::BROWSER_UMA,
layer_tree_host_->rendering_stats_instrumentation()));
- // BFS must either be external or come from the output surface. If
- // external, it must be provided. If from the output surface, it must
- // not be provided.
- // TODO(enne): Make all BFS come from the output surface.
- DCHECK(layer_tree_host_->settings().use_external_begin_frame_source ^
- layer_tree_host_->settings().use_output_surface_begin_frame_source);
- DCHECK(!layer_tree_host_->settings().use_external_begin_frame_source ||
- external_begin_frame_source_);
- DCHECK(
- !layer_tree_host_->settings().use_output_surface_begin_frame_source ||
- !external_begin_frame_source_);
+ BeginFrameSource* frame_source = nullptr;
+ if (!layer_tree_host_->settings().use_output_surface_begin_frame_source) {
+ frame_source = external_begin_frame_source_.get();
+ if (!scheduler_settings.throttle_frame_production) {
+ // Unthrottled source takes precedence over external sources.
+ unthrottled_begin_frame_source_.reset(new BackToBackBeginFrameSource(
+ base::MakeUnique<DelayBasedTimeSource>(
+ task_runner_provider_->MainThreadTaskRunner())));
+ frame_source = unthrottled_begin_frame_source_.get();
+ }
+ if (!frame_source) {
+ synthetic_begin_frame_source_.reset(new DelayBasedBeginFrameSource(
+ base::MakeUnique<DelayBasedTimeSource>(
+ task_runner_provider_->MainThreadTaskRunner())));
+ frame_source = synthetic_begin_frame_source_.get();
+ }
+ }
+
scheduler_on_impl_thread_ =
Scheduler::Create(this, scheduler_settings, layer_tree_host_->id(),
task_runner_provider_->MainThreadTaskRunner(),
- external_begin_frame_source_.get(),
- std::move(compositor_timing_history));
+ frame_source, std::move(compositor_timing_history));
}
layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this);
@@ -454,6 +460,12 @@
if (scheduler_on_impl_thread_)
scheduler_on_impl_thread_->DidLoseOutputSurface();
output_surface_lost_ = true;
+}
+
+void SingleThreadProxy::CommitVSyncParameters(base::TimeTicks timebase,
+ base::TimeDelta interval) {
+ if (synthetic_begin_frame_source_)
+ synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval);
}
void SingleThreadProxy::SetBeginFrameSource(BeginFrameSource* source) {
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | content/renderer/gpu/compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698