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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 221833009: cc: Move scheduling logic out of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@swapAck2Sched11
Patch Set: rebase; add comment about race Created 6 years, 8 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/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 679e0e76a083e0fb2b4a9034928d589b80717ce8..36c71cee823e9594244303d25a7fad1048859003 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1503,6 +1503,8 @@ bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
void LayerTreeHostImpl::SetNeedsBeginFrame(bool enable) {
if (output_surface_)
output_surface_->SetNeedsBeginFrame(enable);
+ else
+ DCHECK(!enable);
}
void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) {
@@ -1886,20 +1888,18 @@ bool LayerTreeHostImpl::InitializeRenderer(
GetRendererCapabilities().allow_rasterize_on_demand);
}
- if (!settings_.throttle_frame_production) {
- // Disable VSync
- output_surface->SetThrottleFrameProduction(false);
- } else if (!settings_.begin_impl_frame_scheduling_enabled) {
- // Setup BeginFrameEmulation if it's not supported natively
- const base::TimeDelta display_refresh_interval =
- base::TimeDelta::FromMicroseconds(
- base::Time::kMicrosecondsPerSecond /
- settings_.refresh_rate);
+ // Initialize vsync parameters to sane values.
+ const base::TimeDelta display_refresh_interval =
+ base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond /
+ settings_.refresh_rate);
+ CommitVSyncParameters(base::TimeTicks(), display_refresh_interval);
- output_surface->InitializeBeginFrameEmulation(
- proxy_->ImplThreadTaskRunner(),
- display_refresh_interval);
- }
+ // TODO(brianderson): Don't use a hard-coded parent draw time.
+ base::TimeDelta parent_draw_time =
+ output_surface->capabilities().adjust_deadline_for_parent
+ ? BeginFrameArgs::DefaultDeadlineAdjustment()
+ : base::TimeDelta();
+ client_->SetEstimatedParentDrawTime(parent_draw_time);
int max_frames_pending =
output_surface->capabilities().max_frames_pending;
@@ -1915,6 +1915,11 @@ bool LayerTreeHostImpl::InitializeRenderer(
return true;
}
+void LayerTreeHostImpl::CommitVSyncParameters(base::TimeTicks timebase,
+ base::TimeDelta interval) {
+ client_->CommitVSyncParameters(timebase, interval);
+}
+
void LayerTreeHostImpl::DeferredInitialize() {
DCHECK(output_surface_->capabilities().deferred_gl_initialization);
DCHECK(settings_.impl_side_painting);
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698