| 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 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 CreateAndSetTileManager(); | 2079 CreateAndSetTileManager(); |
| 2080 | 2080 |
| 2081 // Initialize vsync parameters to sane values. | 2081 // Initialize vsync parameters to sane values. |
| 2082 const base::TimeDelta display_refresh_interval = | 2082 const base::TimeDelta display_refresh_interval = |
| 2083 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 2083 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / |
| 2084 settings_.refresh_rate); | 2084 settings_.refresh_rate); |
| 2085 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); | 2085 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); |
| 2086 | 2086 |
| 2087 // TODO(brianderson): Don't use a hard-coded parent draw time. | 2087 // TODO(brianderson): Don't use a hard-coded parent draw time. |
| 2088 base::TimeDelta parent_draw_time = | 2088 base::TimeDelta parent_draw_time = |
| 2089 (!settings_.begin_frame_scheduling_enabled && | 2089 (!settings_.begin_frame_receiver && |
| 2090 output_surface_->capabilities().adjust_deadline_for_parent) | 2090 output_surface_->capabilities().adjust_deadline_for_parent) |
| 2091 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() | 2091 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() |
| 2092 : base::TimeDelta(); | 2092 : base::TimeDelta(); |
| 2093 client_->SetEstimatedParentDrawTime(parent_draw_time); | 2093 client_->SetEstimatedParentDrawTime(parent_draw_time); |
| 2094 | 2094 |
| 2095 int max_frames_pending = output_surface_->capabilities().max_frames_pending; | 2095 int max_frames_pending = output_surface_->capabilities().max_frames_pending; |
| 2096 if (max_frames_pending <= 0) | 2096 if (max_frames_pending <= 0) |
| 2097 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | 2097 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; |
| 2098 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); | 2098 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); |
| 2099 client_->OnCanDrawStateChanged(CanDraw()); | 2099 client_->OnCanDrawStateChanged(CanDraw()); |
| (...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3358 } | 3358 } |
| 3359 | 3359 |
| 3360 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3360 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3361 std::vector<PictureLayerImpl*>::iterator it = | 3361 std::vector<PictureLayerImpl*>::iterator it = |
| 3362 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3362 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3363 DCHECK(it != picture_layers_.end()); | 3363 DCHECK(it != picture_layers_.end()); |
| 3364 picture_layers_.erase(it); | 3364 picture_layers_.erase(it); |
| 3365 } | 3365 } |
| 3366 | 3366 |
| 3367 } // namespace cc | 3367 } // namespace cc |
| OLD | NEW |