| 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 f11911aa91d64b012cb488aa0d0d029fd91bbe50..0cf635f4dc4c55017286670d40d6aa46d6678c2c 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -1511,6 +1511,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) {
|
| @@ -1900,20 +1902,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;
|
| @@ -1929,6 +1929,11 @@ bool LayerTreeHostImpl::InitializeRenderer(
|
| return true;
|
| }
|
|
|
| +void LayerTreeHostImpl::CommitVSyncParameters(base::TimeTicks timebase,
|
| + base::TimeDelta interval) {
|
| + client_->CommitVSyncParameters(timebase, interval);
|
| +}
|
| +
|
| bool LayerTreeHostImpl::DeferredInitialize(
|
| scoped_refptr<ContextProvider> offscreen_context_provider) {
|
| DCHECK(output_surface_->capabilities().deferred_gl_initialization);
|
|
|