OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |