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

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

Issue 311263016: cc: Fix negative EstimatedParentDrawTimes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix flaky LayerTreeHostAnimationTestAddAnimationAfterAnimating Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 1999
2000 // Initialize vsync parameters to sane values. 2000 // Initialize vsync parameters to sane values.
2001 const base::TimeDelta display_refresh_interval = 2001 const base::TimeDelta display_refresh_interval =
2002 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / 2002 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond /
2003 settings_.refresh_rate); 2003 settings_.refresh_rate);
2004 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); 2004 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval);
2005 2005
2006 // TODO(brianderson): Don't use a hard-coded parent draw time. 2006 // TODO(brianderson): Don't use a hard-coded parent draw time.
2007 base::TimeDelta parent_draw_time = 2007 base::TimeDelta parent_draw_time =
2008 output_surface_->capabilities().adjust_deadline_for_parent 2008 output_surface_->capabilities().adjust_deadline_for_parent
2009 ? BeginFrameArgs::DefaultDeadlineAdjustment() 2009 ? BeginFrameArgs::DefaultEstimatedParentDrawTime()
2010 : base::TimeDelta(); 2010 : base::TimeDelta();
2011 client_->SetEstimatedParentDrawTime(parent_draw_time); 2011 client_->SetEstimatedParentDrawTime(parent_draw_time);
2012 2012
2013 int max_frames_pending = output_surface_->capabilities().max_frames_pending; 2013 int max_frames_pending = output_surface_->capabilities().max_frames_pending;
2014 if (max_frames_pending <= 0) 2014 if (max_frames_pending <= 0)
2015 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; 2015 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
2016 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); 2016 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending);
2017 client_->OnCanDrawStateChanged(CanDraw()); 2017 client_->OnCanDrawStateChanged(CanDraw());
2018 2018
2019 return true; 2019 return true;
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3129 swap_promise_monitor_.erase(monitor); 3129 swap_promise_monitor_.erase(monitor);
3130 } 3130 }
3131 3131
3132 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3132 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3133 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3133 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3134 for (; it != swap_promise_monitor_.end(); it++) 3134 for (; it != swap_promise_monitor_.end(); it++)
3135 (*it)->OnSetNeedsRedrawOnImpl(); 3135 (*it)->OnSetNeedsRedrawOnImpl();
3136 } 3136 }
3137 3137
3138 } // namespace cc 3138 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698