OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_all.h" | 5 #include "cc/resources/raster_tile_priority_queue_all.h" |
6 | 6 |
7 #include "cc/resources/tiling_set_raster_queue_all.h" | 7 #include "cc/resources/tiling_set_raster_queue_all.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 } | 79 } |
80 | 80 |
81 private: | 81 private: |
82 TreePriority tree_priority_; | 82 TreePriority tree_priority_; |
83 }; | 83 }; |
84 | 84 |
85 WhichTree HigherPriorityTree(TreePriority tree_priority, | 85 WhichTree HigherPriorityTree(TreePriority tree_priority, |
86 const TilingSetRasterQueueAll* active_queue, | 86 const TilingSetRasterQueueAll* active_queue, |
87 const TilingSetRasterQueueAll* pending_queue, | 87 const TilingSetRasterQueueAll* pending_queue, |
88 const Tile* shared_tile) { | 88 const Tile* shared_tile) { |
89 const Tile* active_tile = shared_tile ? shared_tile : active_queue->Top(); | |
enne (OOO)
2015/04/15 20:47:02
Can you leave a comment about why you're doing thi
vmpstr
2015/04/15 21:05:24
Done.
| |
90 const Tile* pending_tile = shared_tile ? shared_tile : pending_queue->Top(); | |
91 if (active_tile->priority(ACTIVE_TREE).resolution == NON_IDEAL_RESOLUTION) | |
92 return PENDING_TREE; | |
93 if (pending_tile->priority(PENDING_TREE).resolution == NON_IDEAL_RESOLUTION) | |
94 return ACTIVE_TREE; | |
95 | |
89 switch (tree_priority) { | 96 switch (tree_priority) { |
90 case SMOOTHNESS_TAKES_PRIORITY: { | 97 case SMOOTHNESS_TAKES_PRIORITY: { |
91 const Tile* active_tile = shared_tile ? shared_tile : active_queue->Top(); | |
92 const Tile* pending_tile = | |
93 shared_tile ? shared_tile : pending_queue->Top(); | |
94 | |
95 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); | 98 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); |
96 const TilePriority& pending_priority = | 99 const TilePriority& pending_priority = |
97 pending_tile->priority(PENDING_TREE); | 100 pending_tile->priority(PENDING_TREE); |
98 | 101 |
99 // If we're down to eventually bin tiles on the active tree, process the | 102 // If we're down to eventually bin tiles on the active tree, process the |
100 // pending tree to allow tiles required for activation to be initialized | 103 // pending tree to allow tiles required for activation to be initialized |
101 // when memory policy only allows prepaint. | 104 // when memory policy only allows prepaint. |
102 if (active_priority.priority_bin == TilePriority::EVENTUALLY && | 105 if (active_priority.priority_bin == TilePriority::EVENTUALLY && |
103 pending_priority.priority_bin == TilePriority::NOW) { | 106 pending_priority.priority_bin == TilePriority::NOW) { |
104 return PENDING_TREE; | 107 return PENDING_TREE; |
105 } | 108 } |
106 return ACTIVE_TREE; | 109 return ACTIVE_TREE; |
107 } | 110 } |
108 case NEW_CONTENT_TAKES_PRIORITY: | 111 case NEW_CONTENT_TAKES_PRIORITY: |
109 return PENDING_TREE; | 112 return PENDING_TREE; |
110 case SAME_PRIORITY_FOR_BOTH_TREES: { | 113 case SAME_PRIORITY_FOR_BOTH_TREES: { |
111 const Tile* active_tile = shared_tile ? shared_tile : active_queue->Top(); | |
112 const Tile* pending_tile = | |
113 shared_tile ? shared_tile : pending_queue->Top(); | |
114 | |
115 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); | 114 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); |
116 const TilePriority& pending_priority = | 115 const TilePriority& pending_priority = |
117 pending_tile->priority(PENDING_TREE); | 116 pending_tile->priority(PENDING_TREE); |
118 | 117 |
119 if (active_priority.IsHigherPriorityThan(pending_priority)) | 118 if (active_priority.IsHigherPriorityThan(pending_priority)) |
120 return ACTIVE_TREE; | 119 return ACTIVE_TREE; |
121 return PENDING_TREE; | 120 return PENDING_TREE; |
122 } | 121 } |
123 default: | 122 default: |
124 NOTREACHED(); | 123 NOTREACHED(); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
313 | 312 |
314 state->BeginDictionary("pending_queue"); | 313 state->BeginDictionary("pending_queue"); |
315 state->SetBoolean("has_tile", active_queue_has_tile); | 314 state->SetBoolean("has_tile", active_queue_has_tile); |
316 state->SetInteger("active_priority_bin", active_priority_bin); | 315 state->SetInteger("active_priority_bin", active_priority_bin); |
317 state->SetInteger("pending_priority_bin", pending_priority_bin); | 316 state->SetInteger("pending_priority_bin", pending_priority_bin); |
318 state->EndDictionary(); | 317 state->EndDictionary(); |
319 return state; | 318 return state; |
320 } | 319 } |
321 | 320 |
322 } // namespace cc | 321 } // namespace cc |
OLD | NEW |