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

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

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/resource_provider.cc ('k') | cc/surfaces/display.h » ('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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 534
535 void TileManager::AssignGpuMemoryToTiles( 535 void TileManager::AssignGpuMemoryToTiles(
536 TileVector* tiles_that_need_to_be_rasterized) { 536 TileVector* tiles_that_need_to_be_rasterized) {
537 TRACE_EVENT_BEGIN0("cc", "TileManager::AssignGpuMemoryToTiles"); 537 TRACE_EVENT_BEGIN0("cc", "TileManager::AssignGpuMemoryToTiles");
538 538
539 // Maintain the list of released resources that can potentially be re-used 539 // Maintain the list of released resources that can potentially be re-used
540 // or deleted. 540 // or deleted.
541 // If this operation becomes expensive too, only do this after some 541 // If this operation becomes expensive too, only do this after some
542 // resource(s) was returned. Note that in that case, one also need to 542 // resource(s) was returned. Note that in that case, one also need to
543 // invalidate when releasing some resource from the pool. 543 // invalidate when releasing some resource from the pool.
544 resource_pool_->CheckBusyResources(); 544 resource_pool_->CheckBusyResources(false);
545 545
546 // Now give memory out to the tiles until we're out, and build 546 // Now give memory out to the tiles until we're out, and build
547 // the needs-to-be-rasterized queue. 547 // the needs-to-be-rasterized queue.
548 unsigned schedule_priority = 1u; 548 unsigned schedule_priority = 1u;
549 all_tiles_that_need_to_be_rasterized_are_scheduled_ = true; 549 all_tiles_that_need_to_be_rasterized_are_scheduled_ = true;
550 bool had_enough_memory_to_schedule_tiles_needed_now = true; 550 bool had_enough_memory_to_schedule_tiles_needed_now = true;
551 551
552 MemoryUsage hard_memory_limit(global_state_.hard_memory_limit_in_bytes, 552 MemoryUsage hard_memory_limit(global_state_.hard_memory_limit_in_bytes,
553 global_state_.num_resources_limit); 553 global_state_.num_resources_limit);
554 MemoryUsage soft_memory_limit(global_state_.soft_memory_limit_in_bytes, 554 MemoryUsage soft_memory_limit(global_state_.soft_memory_limit_in_bytes,
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 result -= other; 922 result -= other;
923 return result; 923 return result;
924 } 924 }
925 925
926 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { 926 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const {
927 return memory_bytes_ > limit.memory_bytes_ || 927 return memory_bytes_ > limit.memory_bytes_ ||
928 resource_count_ > limit.resource_count_; 928 resource_count_ > limit.resource_count_;
929 } 929 }
930 930
931 } // namespace cc 931 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/surfaces/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698