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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 DCHECK_IMPLIES(twin_layer, twin_layer->GetTree() == PENDING_TREE); | 1233 DCHECK_IMPLIES(twin_layer, twin_layer->GetTree() == PENDING_TREE); |
1234 layer_pairs->push_back(PictureLayerImpl::Pair(layer, twin_layer)); | 1234 layer_pairs->push_back(PictureLayerImpl::Pair(layer, twin_layer)); |
1235 } else if (!twin_layer) { | 1235 } else if (!twin_layer) { |
1236 DCHECK(layer->GetTree() == PENDING_TREE); | 1236 DCHECK(layer->GetTree() == PENDING_TREE); |
1237 layer_pairs->push_back(PictureLayerImpl::Pair(NULL, layer)); | 1237 layer_pairs->push_back(PictureLayerImpl::Pair(NULL, layer)); |
1238 } | 1238 } |
1239 } | 1239 } |
1240 } | 1240 } |
1241 | 1241 |
1242 void LayerTreeHostImpl::BuildRasterQueue(RasterTilePriorityQueue* queue, | 1242 void LayerTreeHostImpl::BuildRasterQueue(RasterTilePriorityQueue* queue, |
1243 TreePriority tree_priority) { | 1243 TreePriority tree_priority, |
| 1244 RasterTilePriorityQueue::Type type) { |
1244 TRACE_EVENT0("cc", "LayerTreeHostImpl::BuildRasterQueue"); | 1245 TRACE_EVENT0("cc", "LayerTreeHostImpl::BuildRasterQueue"); |
1245 picture_layer_pairs_.clear(); | 1246 picture_layer_pairs_.clear(); |
1246 GetPictureLayerImplPairs(&picture_layer_pairs_, true); | 1247 GetPictureLayerImplPairs(&picture_layer_pairs_, true); |
1247 queue->Build(picture_layer_pairs_, tree_priority); | 1248 queue->Build(picture_layer_pairs_, tree_priority, type); |
1248 | 1249 |
1249 if (!queue->IsEmpty()) { | 1250 if (!queue->IsEmpty()) { |
1250 // Only checking the Top() tile here isn't a definite answer that there is | 1251 // Only checking the Top() tile here isn't a definite answer that there is |
1251 // or isn't something required for draw in this raster queue. It's just a | 1252 // or isn't something required for draw in this raster queue. It's just a |
1252 // heuristic to let us hit the common case and proactively tell the | 1253 // heuristic to let us hit the common case and proactively tell the |
1253 // scheduler that we expect to draw within each vsync until we get all the | 1254 // scheduler that we expect to draw within each vsync until we get all the |
1254 // tiles ready to draw. If we happen to miss a required for draw tile here, | 1255 // tiles ready to draw. If we happen to miss a required for draw tile here, |
1255 // then we will miss telling the scheduler each frame that we intend to draw | 1256 // then we will miss telling the scheduler each frame that we intend to draw |
1256 // so it may make worse scheduling decisions. | 1257 // so it may make worse scheduling decisions. |
1257 required_for_draw_tile_is_top_of_raster_queue_ = | 1258 required_for_draw_tile_is_top_of_raster_queue_ = |
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3507 } | 3508 } |
3508 | 3509 |
3509 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3510 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3510 std::vector<PictureLayerImpl*>::iterator it = | 3511 std::vector<PictureLayerImpl*>::iterator it = |
3511 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3512 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3512 DCHECK(it != picture_layers_.end()); | 3513 DCHECK(it != picture_layers_.end()); |
3513 picture_layers_.erase(it); | 3514 picture_layers_.erase(it); |
3514 } | 3515 } |
3515 | 3516 |
3516 } // namespace cc | 3517 } // namespace cc |
OLD | NEW |