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 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 CreateAndSetTileManager(); | 2096 CreateAndSetTileManager(); |
2097 | 2097 |
2098 // Initialize vsync parameters to sane values. | 2098 // Initialize vsync parameters to sane values. |
2099 const base::TimeDelta display_refresh_interval = | 2099 const base::TimeDelta display_refresh_interval = |
2100 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 2100 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / |
2101 settings_.refresh_rate); | 2101 settings_.refresh_rate); |
2102 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); | 2102 CommitVSyncParameters(base::TimeTicks(), display_refresh_interval); |
2103 | 2103 |
2104 // TODO(brianderson): Don't use a hard-coded parent draw time. | 2104 // TODO(brianderson): Don't use a hard-coded parent draw time. |
2105 base::TimeDelta parent_draw_time = | 2105 base::TimeDelta parent_draw_time = |
2106 (!settings_.begin_frame_scheduling_enabled && | 2106 (!settings_.begin_frame_receiver && |
2107 output_surface_->capabilities().adjust_deadline_for_parent) | 2107 output_surface_->capabilities().adjust_deadline_for_parent) |
2108 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() | 2108 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() |
2109 : base::TimeDelta(); | 2109 : base::TimeDelta(); |
2110 client_->SetEstimatedParentDrawTime(parent_draw_time); | 2110 client_->SetEstimatedParentDrawTime(parent_draw_time); |
2111 | 2111 |
2112 int max_frames_pending = output_surface_->capabilities().max_frames_pending; | 2112 int max_frames_pending = output_surface_->capabilities().max_frames_pending; |
2113 if (max_frames_pending <= 0) | 2113 if (max_frames_pending <= 0) |
2114 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | 2114 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; |
2115 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); | 2115 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); |
2116 client_->OnCanDrawStateChanged(CanDraw()); | 2116 client_->OnCanDrawStateChanged(CanDraw()); |
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3383 } | 3383 } |
3384 | 3384 |
3385 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3385 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3386 std::vector<PictureLayerImpl*>::iterator it = | 3386 std::vector<PictureLayerImpl*>::iterator it = |
3387 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3387 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3388 DCHECK(it != picture_layers_.end()); | 3388 DCHECK(it != picture_layers_.end()); |
3389 picture_layers_.erase(it); | 3389 picture_layers_.erase(it); |
3390 } | 3390 } |
3391 | 3391 |
3392 } // namespace cc | 3392 } // namespace cc |
OLD | NEW |