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 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 int max_frames_pending = output_surface_->capabilities().max_frames_pending; |
2303 if (max_frames_pending <= 0) | 2303 DCHECK_EQ(1, max_frames_pending); |
sunnyps
2015/11/16 20:17:46
Why not remove the max_frames_pending capability c
brianderson
2015/11/16 20:56:58
I guess we could remove it from LTHI and cc::Sched
| |
2304 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | |
2305 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); | 2304 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); |
2306 client_->OnCanDrawStateChanged(CanDraw()); | 2305 client_->OnCanDrawStateChanged(CanDraw()); |
2307 | 2306 |
2308 // There will not be anything to draw here, so set high res | 2307 // There will not be anything to draw here, so set high res |
2309 // to avoid checkerboards, typically when we are recovering | 2308 // to avoid checkerboards, typically when we are recovering |
2310 // from lost context. | 2309 // from lost context. |
2311 // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. | 2310 // TODO(crbug.com/469175): Replace with RequiresHighResToDraw. |
2312 SetRequiresHighResToDraw(); | 2311 SetRequiresHighResToDraw(); |
2313 | 2312 |
2314 return true; | 2313 return true; |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3694 return task_runner_provider_->HasImplThread(); | 3693 return task_runner_provider_->HasImplThread(); |
3695 } | 3694 } |
3696 | 3695 |
3697 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3696 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3698 // In single threaded mode we skip the pending tree and commit directly to the | 3697 // In single threaded mode we skip the pending tree and commit directly to the |
3699 // active tree. | 3698 // active tree. |
3700 return !task_runner_provider_->HasImplThread(); | 3699 return !task_runner_provider_->HasImplThread(); |
3701 } | 3700 } |
3702 | 3701 |
3703 } // namespace cc | 3702 } // namespace cc |
OLD | NEW |