OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/resources/raster_tile_priority_queue.h" | 5 #include "cc/resources/raster_tile_priority_queue.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 private: | 62 private: |
63 TreePriority tree_priority_; | 63 TreePriority tree_priority_; |
64 }; | 64 }; |
65 | 65 |
66 WhichTree HigherPriorityTree( | 66 WhichTree HigherPriorityTree( |
67 TreePriority tree_priority, | 67 TreePriority tree_priority, |
68 const PictureLayerImpl::LayerRasterTileIterator* active_iterator, | 68 const PictureLayerImpl::LayerRasterTileIterator* active_iterator, |
69 const PictureLayerImpl::LayerRasterTileIterator* pending_iterator, | 69 const PictureLayerImpl::LayerRasterTileIterator* pending_iterator, |
70 const Tile* shared_tile) { | 70 const Tile* shared_tile) { |
71 switch (tree_priority) { | 71 switch (tree_priority) { |
72 case SMOOTHNESS_TAKES_PRIORITY: | 72 case SMOOTHNESS_TAKES_PRIORITY: { |
73 const Tile* active_tile = shared_tile ? shared_tile : **active_iterator; | |
74 const Tile* pending_tile = shared_tile ? shared_tile : **pending_iterator; | |
75 | |
76 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); | |
77 const TilePriority& pending_priority = | |
78 pending_tile->priority(PENDING_TREE); | |
79 | |
80 // If we've down to eventually bin tiles on the active tree, but the | |
81 // pending tree has needed now tiles, process the pending tree to avoid | |
82 // activation starvation. | |
reveman
2014/10/13 19:45:11
I don't see how this used to starve activation dif
vmpstr
2014/10/13 20:20:13
In the pre-iterator approach, tiles that are requi
reveman
2014/10/13 21:07:36
The change looks fine to me. It's just the comment
vmpstr
2014/10/13 21:33:40
Done.
| |
83 if (active_priority.priority_bin == TilePriority::EVENTUALLY && | |
84 pending_priority.priority_bin == TilePriority::NOW) { | |
85 return PENDING_TREE; | |
86 } | |
73 return ACTIVE_TREE; | 87 return ACTIVE_TREE; |
88 } | |
74 case NEW_CONTENT_TAKES_PRIORITY: | 89 case NEW_CONTENT_TAKES_PRIORITY: |
75 return PENDING_TREE; | 90 return PENDING_TREE; |
76 case SAME_PRIORITY_FOR_BOTH_TREES: { | 91 case SAME_PRIORITY_FOR_BOTH_TREES: { |
77 const Tile* active_tile = shared_tile ? shared_tile : **active_iterator; | 92 const Tile* active_tile = shared_tile ? shared_tile : **active_iterator; |
78 const Tile* pending_tile = shared_tile ? shared_tile : **pending_iterator; | 93 const Tile* pending_tile = shared_tile ? shared_tile : **pending_iterator; |
79 | 94 |
80 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); | 95 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); |
81 const TilePriority& pending_priority = | 96 const TilePriority& pending_priority = |
82 pending_tile->priority(PENDING_TREE); | 97 pending_tile->priority(PENDING_TREE); |
83 | 98 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 return PENDING_TREE; | 243 return PENDING_TREE; |
229 if (!pending_iterator) | 244 if (!pending_iterator) |
230 return ACTIVE_TREE; | 245 return ACTIVE_TREE; |
231 | 246 |
232 // Now both iterators have tiles, so we have to decide based on tree priority. | 247 // Now both iterators have tiles, so we have to decide based on tree priority. |
233 return HigherPriorityTree( | 248 return HigherPriorityTree( |
234 tree_priority, &active_iterator, &pending_iterator, nullptr); | 249 tree_priority, &active_iterator, &pending_iterator, nullptr); |
235 } | 250 } |
236 | 251 |
237 } // namespace cc | 252 } // namespace cc |
OLD | NEW |