Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: cc/tiles/raster_tile_priority_queue_all.cc

Issue 2407443002: cc: Properly detect tiles that are needed now. (Closed)
Patch Set: qfix: update Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/tiles/tile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/tiles/raster_tile_priority_queue_all.h" 5 #include "cc/tiles/raster_tile_priority_queue_all.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/tiles/tiling_set_raster_queue_all.h" 8 #include "cc/tiles/tiling_set_raster_queue_all.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 return active_queues_; 138 return active_queues_;
139 139
140 const PrioritizedTile& active_tile = active_queues_.front()->Top(); 140 const PrioritizedTile& active_tile = active_queues_.front()->Top();
141 const PrioritizedTile& pending_tile = pending_queues_.front()->Top(); 141 const PrioritizedTile& pending_tile = pending_queues_.front()->Top();
142 142
143 const TilePriority& active_priority = active_tile.priority(); 143 const TilePriority& active_priority = active_tile.priority();
144 const TilePriority& pending_priority = pending_tile.priority(); 144 const TilePriority& pending_priority = pending_tile.priority();
145 145
146 switch (tree_priority_) { 146 switch (tree_priority_) {
147 case SMOOTHNESS_TAKES_PRIORITY: { 147 case SMOOTHNESS_TAKES_PRIORITY: {
148 // If we're down to eventually bin tiles on the active tree and there 148 // If we're done with required tiles on the active tree, then process
149 // is a pending tree, process the entire pending tree to allow tiles 149 // required tiles on the pending tree. If either the active tree has
150 // required for activation to be initialized when memory policy only 150 // required tiles, or none of the trees have required tiles, then process
151 // allows prepaint. The eventually bin tiles on the active tree are 151 // the active tree by default.
152 // lowest priority since that work is likely to be thrown away when 152 bool active_tree_has_required_tiles =
153 // we activate. 153 active_tile.tile()->required_for_activation() ||
154 if (active_priority.priority_bin == TilePriority::EVENTUALLY) 154 active_tile.tile()->required_for_draw();
155 bool pending_tree_has_required_tiles =
156 pending_tile.tile()->required_for_activation();
157 if (!active_tree_has_required_tiles && pending_tree_has_required_tiles)
155 return pending_queues_; 158 return pending_queues_;
156 return active_queues_; 159 return active_queues_;
157 } 160 }
158 case NEW_CONTENT_TAKES_PRIORITY: { 161 case NEW_CONTENT_TAKES_PRIORITY: {
159 // If we're down to soon bin tiles on the pending tree, process the 162 // If we're down to soon bin tiles on the pending tree, process the
160 // active tree to allow tiles required for activation to be initialized 163 // active tree to allow tiles required for activation to be initialized
161 // when memory policy only allows prepaint. Note that active required for 164 // when memory policy only allows prepaint. Note that active required for
162 // activation tiles might come from either now or soon bins. 165 // activation tiles might come from either now or soon bins.
163 if (pending_priority.priority_bin >= TilePriority::SOON && 166 if (pending_priority.priority_bin >= TilePriority::SOON &&
164 active_priority.priority_bin <= TilePriority::SOON) { 167 active_priority.priority_bin <= TilePriority::SOON) {
165 return active_queues_; 168 return active_queues_;
166 } 169 }
167 return pending_queues_; 170 return pending_queues_;
168 } 171 }
169 case SAME_PRIORITY_FOR_BOTH_TREES: { 172 case SAME_PRIORITY_FOR_BOTH_TREES: {
170 if (active_priority.IsHigherPriorityThan(pending_priority)) 173 if (active_priority.IsHigherPriorityThan(pending_priority))
171 return active_queues_; 174 return active_queues_;
172 return pending_queues_; 175 return pending_queues_;
173 } 176 }
174 default: 177 default:
175 NOTREACHED(); 178 NOTREACHED();
176 return active_queues_; 179 return active_queues_;
177 } 180 }
178 } 181 }
179 182
180 } // namespace cc 183 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698