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