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

Side by Side Diff: cc/resources/eviction_tile_priority_queue.cc

Issue 736753002: cc: Implement geometry-based tile eviction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years 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
OLDNEW
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/eviction_tile_priority_queue.h" 5 #include "cc/resources/eviction_tile_priority_queue.h"
6 6
7 namespace cc { 7 namespace cc {
8 8
9 namespace { 9 namespace {
10 10
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 DCHECK(!IsEmpty()); 193 DCHECK(!IsEmpty());
194 194
195 // If we only have one iterator with tiles, return it. 195 // If we only have one iterator with tiles, return it.
196 if (!active_queue || active_queue->IsEmpty()) 196 if (!active_queue || active_queue->IsEmpty())
197 return PENDING_TREE; 197 return PENDING_TREE;
198 if (!pending_queue || pending_queue->IsEmpty()) 198 if (!pending_queue || pending_queue->IsEmpty())
199 return ACTIVE_TREE; 199 return ACTIVE_TREE;
200 200
201 const Tile* active_tile = active_queue->Top(); 201 const Tile* active_tile = active_queue->Top();
202 const Tile* pending_tile = pending_queue->Top(); 202 const Tile* pending_tile = pending_queue->Top();
203
204 // If tiles are the same, it doesn't matter which tree we return.
203 if (active_tile == pending_tile) 205 if (active_tile == pending_tile)
204 return ACTIVE_TREE; 206 return ACTIVE_TREE;
205 207
206 const TilePriority& active_priority = 208 const TilePriority& active_priority =
207 active_tile->priority_for_tree_priority(tree_priority); 209 active_tile->priority_for_tree_priority(tree_priority);
208 const TilePriority& pending_priority = 210 const TilePriority& pending_priority =
209 pending_tile->priority_for_tree_priority(tree_priority); 211 pending_tile->priority_for_tree_priority(tree_priority);
210 212
213 // If the bins are the same and activation differs, then return the tree of
214 // the tile not required for activation.
215 if (active_priority.priority_bin == pending_priority.priority_bin &&
216 active_tile->required_for_activation() !=
217 pending_tile->required_for_activation()) {
218 return active_tile->required_for_activation() ? PENDING_TREE : ACTIVE_TREE;
219 }
220
221 // Return tile with a lower priority.
211 if (pending_priority.IsHigherPriorityThan(active_priority)) 222 if (pending_priority.IsHigherPriorityThan(active_priority))
212 return ACTIVE_TREE; 223 return ACTIVE_TREE;
213 return PENDING_TREE; 224 return PENDING_TREE;
214 } 225 }
215 226
216 } // namespace cc 227 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698