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 2105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2116 CreateAndSetTileManager(); | 2116 CreateAndSetTileManager(); |
2117 | 2117 |
2118 // Initialize vsync parameters to sane values. | 2118 // Initialize vsync parameters to sane values. |
2119 const base::TimeDelta display_refresh_interval = | 2119 const base::TimeDelta display_refresh_interval = |
2120 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 2120 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / |
2121 settings_.refresh_rate); | 2121 settings_.refresh_rate); |
2122 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); | 2122 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); |
2123 | 2123 |
2124 // TODO(brianderson): Don't use a hard-coded parent draw time. | 2124 // TODO(brianderson): Don't use a hard-coded parent draw time. |
2125 base::TimeDelta parent_draw_time = | 2125 base::TimeDelta parent_draw_time = |
2126 (!settings_.begin_frame_scheduling_enabled && | 2126 (!settings_.begin_frame_receiver && |
2127 output_surface_->capabilities().adjust_deadline_for_parent) | 2127 output_surface_->capabilities().adjust_deadline_for_parent) |
2128 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() | 2128 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() |
2129 : base::TimeDelta(); | 2129 : base::TimeDelta(); |
2130 client_->SetEstimatedParentDrawTime(parent_draw_time); | 2130 client_->SetEstimatedParentDrawTime(parent_draw_time); |
2131 | 2131 |
2132 int max_frames_pending = output_surface_->capabilities().max_frames_pending; | 2132 int max_frames_pending = output_surface_->capabilities().max_frames_pending; |
2133 if (max_frames_pending <= 0) | 2133 if (max_frames_pending <= 0) |
2134 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | 2134 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; |
2135 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); | 2135 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); |
2136 client_->OnCanDrawStateChanged(CanDraw()); | 2136 client_->OnCanDrawStateChanged(CanDraw()); |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3371 } | 3371 } |
3372 | 3372 |
3373 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3373 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3374 std::vector<PictureLayerImpl*>::iterator it = | 3374 std::vector<PictureLayerImpl*>::iterator it = |
3375 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3375 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3376 DCHECK(it != picture_layers_.end()); | 3376 DCHECK(it != picture_layers_.end()); |
3377 picture_layers_.erase(it); | 3377 picture_layers_.erase(it); |
3378 } | 3378 } |
3379 | 3379 |
3380 } // namespace cc | 3380 } // namespace cc |
OLD | NEW |