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 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); | 2292 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); |
2293 | 2293 |
2294 // TODO(brianderson): Don't use a hard-coded parent draw time. | 2294 // TODO(brianderson): Don't use a hard-coded parent draw time. |
2295 base::TimeDelta parent_draw_time = | 2295 base::TimeDelta parent_draw_time = |
2296 (!settings_.use_external_begin_frame_source && | 2296 (!settings_.use_external_begin_frame_source && |
2297 output_surface_->capabilities().adjust_deadline_for_parent) | 2297 output_surface_->capabilities().adjust_deadline_for_parent) |
2298 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() | 2298 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() |
2299 : base::TimeDelta(); | 2299 : base::TimeDelta(); |
2300 client_->SetEstimatedParentDrawTime(parent_draw_time); | 2300 client_->SetEstimatedParentDrawTime(parent_draw_time); |
2301 | 2301 |
2302 int max_frames_pending = output_surface_->capabilities().max_frames_pending; | 2302 DCHECK_EQ(1, output_surface_->capabilities().max_frames_pending); |
2303 if (max_frames_pending <= 0) | |
2304 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | |
2305 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); | |
2306 client_->OnCanDrawStateChanged(CanDraw()); | 2303 client_->OnCanDrawStateChanged(CanDraw()); |
2307 | 2304 |
2308 // There will not be anything to draw here, so set high res | 2305 // There will not be anything to draw here, so set high res |
2309 // to avoid checkerboards, typically when we are recovering | 2306 // to avoid checkerboards, typically when we are recovering |
2310 // from lost context. | 2307 // from lost context. |
2311 // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. | 2308 // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. |
2312 SetRequiresHighResToDraw(); | 2309 SetRequiresHighResToDraw(); |
2313 | 2310 |
2314 return true; | 2311 return true; |
2315 } | 2312 } |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3694 return task_runner_provider_->HasImplThread(); | 3691 return task_runner_provider_->HasImplThread(); |
3695 } | 3692 } |
3696 | 3693 |
3697 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3694 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3698 // In single threaded mode we skip the pending tree and commit directly to the | 3695 // In single threaded mode we skip the pending tree and commit directly to the |
3699 // active tree. | 3696 // active tree. |
3700 return !task_runner_provider_->HasImplThread(); | 3697 return !task_runner_provider_->HasImplThread(); |
3701 } | 3698 } |
3702 | 3699 |
3703 } // namespace cc | 3700 } // namespace cc |
OLD | NEW |