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

Unified Diff: cc/resources/prioritized_tile_set.cc

Issue 468983002: Still produce quad when tile OOM and on demand raster is not allowed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/prioritized_tile_set.cc
diff --git a/cc/resources/prioritized_tile_set.cc b/cc/resources/prioritized_tile_set.cc
index 82c7f16facdd4567e472e7d262f6f04ded652a01..d0104cbe331f8351dea111d8bdc6deaef5321eba 100644
--- a/cc/resources/prioritized_tile_set.cc
+++ b/cc/resources/prioritized_tile_set.cc
@@ -40,13 +40,20 @@ class BinComparator {
namespace {
+bool TilePriorityTieBreaker(const Tile* tile_i, const Tile* tile_j) {
+ // When two tiles has same priority use Id as tie breaker.
+ return tile_i->id() < tile_j->id();
+}
+
typedef std::vector<Tile*> TileVector;
void SortBinTiles(ManagedTileBin bin, TileVector* tiles) {
switch (bin) {
- case NOW_AND_READY_TO_DRAW_BIN:
case NEVER_BIN:
break;
+ case NOW_AND_READY_TO_DRAW_BIN:
+ std::sort(tiles->begin(), tiles->end(), TilePriorityTieBreaker);
+ break;
case NOW_BIN:
case SOON_BIN:
case EVENTUALLY_AND_ACTIVE_BIN:
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/resources/tile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698