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

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

Issue 651503004: cc: Bump up pending tree now tiles order for smoothness mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 6 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 | « cc/resources/raster_tile_priority_queue.cc ('k') | cc/resources/tile_manager_unittest.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/tile_manager.h" 5 #include "cc/resources/tile_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 10
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 bool TileManager::FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit( 493 bool TileManager::FreeTileResourcesWithLowerPriorityUntilUsageIsWithinLimit(
494 const MemoryUsage& limit, 494 const MemoryUsage& limit,
495 const TilePriority& other_priority, 495 const TilePriority& other_priority,
496 MemoryUsage* usage) { 496 MemoryUsage* usage) {
497 while (usage->Exceeds(limit)) { 497 while (usage->Exceeds(limit)) {
498 RebuildEvictionQueueIfNeeded(); 498 RebuildEvictionQueueIfNeeded();
499 if (eviction_priority_queue_.IsEmpty()) 499 if (eviction_priority_queue_.IsEmpty())
500 return false; 500 return false;
501 501
502 Tile* tile = eviction_priority_queue_.Top(); 502 Tile* tile = eviction_priority_queue_.Top();
503 if (!other_priority.IsHigherPriorityThan( 503 if (!other_priority.IsHigherPriorityThan(tile->combined_priority()))
504 tile->priority_for_tree_priority(global_state_.tree_priority))) {
505 return false; 504 return false;
506 }
507 505
508 *usage -= MemoryUsage::FromTile(tile); 506 *usage -= MemoryUsage::FromTile(tile);
509 FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile); 507 FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(tile);
510 eviction_priority_queue_.Pop(); 508 eviction_priority_queue_.Pop();
511 } 509 }
512 return true; 510 return true;
513 } 511 }
514 512
515 bool TileManager::TilePriorityViolatesMemoryPolicy( 513 bool TileManager::TilePriorityViolatesMemoryPolicy(
516 const TilePriority& priority) { 514 const TilePriority& priority) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 MemoryUsage memory_usage(resource_pool_->acquired_memory_usage_bytes(), 551 MemoryUsage memory_usage(resource_pool_->acquired_memory_usage_bytes(),
554 resource_pool_->acquired_resource_count()); 552 resource_pool_->acquired_resource_count());
555 553
556 eviction_priority_queue_is_up_to_date_ = false; 554 eviction_priority_queue_is_up_to_date_ = false;
557 raster_priority_queue_.Reset(); 555 raster_priority_queue_.Reset();
558 client_->BuildRasterQueue(&raster_priority_queue_, 556 client_->BuildRasterQueue(&raster_priority_queue_,
559 global_state_.tree_priority); 557 global_state_.tree_priority);
560 558
561 while (!raster_priority_queue_.IsEmpty()) { 559 while (!raster_priority_queue_.IsEmpty()) {
562 Tile* tile = raster_priority_queue_.Top(); 560 Tile* tile = raster_priority_queue_.Top();
563 TilePriority priority = 561 TilePriority priority = tile->combined_priority();
564 tile->priority_for_tree_priority(global_state_.tree_priority);
565 562
566 if (TilePriorityViolatesMemoryPolicy(priority)) 563 if (TilePriorityViolatesMemoryPolicy(priority))
567 break; 564 break;
568 565
569 // We won't be able to schedule this tile, so break out early. 566 // We won't be able to schedule this tile, so break out early.
570 if (tiles_that_need_to_be_rasterized->size() >= 567 if (tiles_that_need_to_be_rasterized->size() >=
571 kScheduledRasterTasksLimit) { 568 kScheduledRasterTasksLimit) {
572 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; 569 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false;
573 break; 570 break;
574 } 571 }
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 result -= other; 905 result -= other;
909 return result; 906 return result;
910 } 907 }
911 908
912 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { 909 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const {
913 return memory_bytes_ > limit.memory_bytes_ || 910 return memory_bytes_ > limit.memory_bytes_ ||
914 resource_count_ > limit.resource_count_; 911 resource_count_ > limit.resource_count_;
915 } 912 }
916 913
917 } // namespace cc 914 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/raster_tile_priority_queue.cc ('k') | cc/resources/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698