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 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 CreateAndSetTileManager(); | 2016 CreateAndSetTileManager(); |
2017 | 2017 |
2018 // Initialize vsync parameters to sane values. | 2018 // Initialize vsync parameters to sane values. |
2019 const base::TimeDelta display_refresh_interval = | 2019 const base::TimeDelta display_refresh_interval = |
2020 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 2020 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / |
2021 settings_.refresh_rate); | 2021 settings_.refresh_rate); |
2022 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); | 2022 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); |
2023 | 2023 |
2024 // TODO(brianderson): Don't use a hard-coded parent draw time. | 2024 // TODO(brianderson): Don't use a hard-coded parent draw time. |
2025 base::TimeDelta parent_draw_time = | 2025 base::TimeDelta parent_draw_time = |
2026 output_surface_->capabilities().adjust_deadline_for_parent | 2026 (!settings_.begin_frame_scheduling_enabled && |
| 2027 output_surface_->capabilities().adjust_deadline_for_parent) |
2027 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() | 2028 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() |
2028 : base::TimeDelta(); | 2029 : base::TimeDelta(); |
2029 client_->SetEstimatedParentDrawTime(parent_draw_time); | 2030 client_->SetEstimatedParentDrawTime(parent_draw_time); |
2030 | 2031 |
2031 int max_frames_pending = output_surface_->capabilities().max_frames_pending; | 2032 int max_frames_pending = output_surface_->capabilities().max_frames_pending; |
2032 if (max_frames_pending <= 0) | 2033 if (max_frames_pending <= 0) |
2033 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | 2034 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; |
2034 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); | 2035 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); |
2035 client_->OnCanDrawStateChanged(CanDraw()); | 2036 client_->OnCanDrawStateChanged(CanDraw()); |
2036 | 2037 |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3151 } | 3152 } |
3152 | 3153 |
3153 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3154 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3154 std::vector<PictureLayerImpl*>::iterator it = | 3155 std::vector<PictureLayerImpl*>::iterator it = |
3155 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3156 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3156 DCHECK(it != picture_layers_.end()); | 3157 DCHECK(it != picture_layers_.end()); |
3157 picture_layers_.erase(it); | 3158 picture_layers_.erase(it); |
3158 } | 3159 } |
3159 | 3160 |
3160 } // namespace cc | 3161 } // namespace cc |
OLD | NEW |