| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 // If we're down to eventually bin tiles on the active tree, process the | 99 // 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 | 100 // pending tree to allow tiles required for activation to be initialized |
| 101 // when memory policy only allows prepaint. | 101 // when memory policy only allows prepaint. |
| 102 if (active_priority.priority_bin == TilePriority::EVENTUALLY && | 102 if (active_priority.priority_bin == TilePriority::EVENTUALLY && |
| 103 pending_priority.priority_bin == TilePriority::NOW) { | 103 pending_priority.priority_bin == TilePriority::NOW) { |
| 104 return PENDING_TREE; | 104 return PENDING_TREE; |
| 105 } | 105 } |
| 106 return ACTIVE_TREE; | 106 return ACTIVE_TREE; |
| 107 } | 107 } |
| 108 case NEW_CONTENT_TAKES_PRIORITY: | 108 case NEW_CONTENT_TAKES_PRIORITY: { |
| 109 const Tile* active_tile = shared_tile ? shared_tile : active_queue->Top(); |
| 110 const Tile* pending_tile = |
| 111 shared_tile ? shared_tile : pending_queue->Top(); |
| 112 |
| 113 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); |
| 114 const TilePriority& pending_priority = |
| 115 pending_tile->priority(PENDING_TREE); |
| 116 |
| 117 // If we're down to eventually bin tiles on the pending tree, process the |
| 118 // active tree to allow tiles required for activation to be initialized |
| 119 // when memory policy only allows prepaint. Note that active required for |
| 120 // activation tiles might come from either now or soon bins. |
| 121 if (pending_priority.priority_bin == TilePriority::EVENTUALLY && |
| 122 active_priority.priority_bin <= TilePriority::SOON) { |
| 123 return ACTIVE_TREE; |
| 124 } |
| 109 return PENDING_TREE; | 125 return PENDING_TREE; |
| 126 } |
| 110 case SAME_PRIORITY_FOR_BOTH_TREES: { | 127 case SAME_PRIORITY_FOR_BOTH_TREES: { |
| 111 const Tile* active_tile = shared_tile ? shared_tile : active_queue->Top(); | 128 const Tile* active_tile = shared_tile ? shared_tile : active_queue->Top(); |
| 112 const Tile* pending_tile = | 129 const Tile* pending_tile = |
| 113 shared_tile ? shared_tile : pending_queue->Top(); | 130 shared_tile ? shared_tile : pending_queue->Top(); |
| 114 | 131 |
| 115 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); | 132 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); |
| 116 const TilePriority& pending_priority = | 133 const TilePriority& pending_priority = |
| 117 pending_tile->priority(PENDING_TREE); | 134 pending_tile->priority(PENDING_TREE); |
| 118 | 135 |
| 119 if (active_priority.IsHigherPriorityThan(pending_priority)) | 136 if (active_priority.IsHigherPriorityThan(pending_priority)) |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 330 |
| 314 state->BeginDictionary("pending_queue"); | 331 state->BeginDictionary("pending_queue"); |
| 315 state->SetBoolean("has_tile", active_queue_has_tile); | 332 state->SetBoolean("has_tile", active_queue_has_tile); |
| 316 state->SetInteger("active_priority_bin", active_priority_bin); | 333 state->SetInteger("active_priority_bin", active_priority_bin); |
| 317 state->SetInteger("pending_priority_bin", pending_priority_bin); | 334 state->SetInteger("pending_priority_bin", pending_priority_bin); |
| 318 state->EndDictionary(); | 335 state->EndDictionary(); |
| 319 return state; | 336 return state; |
| 320 } | 337 } |
| 321 | 338 |
| 322 } // namespace cc | 339 } // namespace cc |
| OLD | NEW |