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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 // tiles ready to draw. If we happen to miss a required for draw tile here, | 1210 // tiles ready to draw. If we happen to miss a required for draw tile here, |
1211 // then we will miss telling the scheduler each frame that we intend to draw | 1211 // then we will miss telling the scheduler each frame that we intend to draw |
1212 // so it may make worse scheduling decisions. | 1212 // so it may make worse scheduling decisions. |
1213 required_for_draw_tile_is_top_of_raster_queue_ = | 1213 required_for_draw_tile_is_top_of_raster_queue_ = |
1214 queue->Top()->required_for_draw(); | 1214 queue->Top()->required_for_draw(); |
1215 } else { | 1215 } else { |
1216 required_for_draw_tile_is_top_of_raster_queue_ = false; | 1216 required_for_draw_tile_is_top_of_raster_queue_ = false; |
1217 } | 1217 } |
1218 } | 1218 } |
1219 | 1219 |
1220 void LayerTreeHostImpl::BuildEvictionQueue(EvictionTilePriorityQueue* queue, | 1220 scoped_ptr<EvictionTilePriorityQueue> LayerTreeHostImpl::BuildEvictionQueue( |
1221 TreePriority tree_priority) { | 1221 TreePriority tree_priority) { |
1222 TRACE_EVENT0("cc", "LayerTreeHostImpl::BuildEvictionQueue"); | 1222 TRACE_EVENT0("cc", "LayerTreeHostImpl::BuildEvictionQueue"); |
| 1223 scoped_ptr<EvictionTilePriorityQueue> queue(new EvictionTilePriorityQueue); |
1223 picture_layer_pairs_.clear(); | 1224 picture_layer_pairs_.clear(); |
1224 GetPictureLayerImplPairs(&picture_layer_pairs_, false); | 1225 GetPictureLayerImplPairs(&picture_layer_pairs_, false); |
1225 queue->Build(picture_layer_pairs_, tree_priority); | 1226 queue->Build(picture_layer_pairs_, tree_priority); |
| 1227 return queue; |
1226 } | 1228 } |
1227 | 1229 |
1228 const std::vector<PictureLayerImpl*>& LayerTreeHostImpl::GetPictureLayers() | 1230 const std::vector<PictureLayerImpl*>& LayerTreeHostImpl::GetPictureLayers() |
1229 const { | 1231 const { |
1230 return picture_layers_; | 1232 return picture_layers_; |
1231 } | 1233 } |
1232 | 1234 |
1233 void LayerTreeHostImpl::NotifyReadyToActivate() { | 1235 void LayerTreeHostImpl::NotifyReadyToActivate() { |
1234 client_->NotifyReadyToActivate(); | 1236 client_->NotifyReadyToActivate(); |
1235 } | 1237 } |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3456 } | 3458 } |
3457 | 3459 |
3458 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3460 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3459 std::vector<PictureLayerImpl*>::iterator it = | 3461 std::vector<PictureLayerImpl*>::iterator it = |
3460 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3462 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3461 DCHECK(it != picture_layers_.end()); | 3463 DCHECK(it != picture_layers_.end()); |
3462 picture_layers_.erase(it); | 3464 picture_layers_.erase(it); |
3463 } | 3465 } |
3464 | 3466 |
3465 } // namespace cc | 3467 } // namespace cc |
OLD | NEW |