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

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

Issue 140673009: CC/GPU: Add a soft limit to the compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 10 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/resources/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 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 #ifndef CC_RESOURCES_TILE_MANAGER_H_ 5 #ifndef CC_RESOURCES_TILE_MANAGER_H_
6 #define CC_RESOURCES_TILE_MANAGER_H_ 6 #define CC_RESOURCES_TILE_MANAGER_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 bytes_releasable_ += BytesConsumedIfAllocated(tiles[i]); 99 bytes_releasable_ += BytesConsumedIfAllocated(tiles[i]);
100 ++resources_releasable_; 100 ++resources_releasable_;
101 } 101 }
102 } 102 }
103 RasterWorkerPool* RasterWorkerPoolForTesting() { 103 RasterWorkerPool* RasterWorkerPoolForTesting() {
104 return raster_worker_pool_.get(); 104 return raster_worker_pool_.get();
105 } 105 }
106 106
107 void SetGlobalStateForTesting( 107 void SetGlobalStateForTesting(
108 const GlobalStateThatImpactsTilePriority& state) { 108 const GlobalStateThatImpactsTilePriority& state) {
109 // Soft limit is used for resource pool such that
110 // memory returns to soft limit after going over.
109 if (state != global_state_) { 111 if (state != global_state_) {
110 global_state_ = state; 112 global_state_ = state;
111 prioritized_tiles_dirty_ = true; 113 prioritized_tiles_dirty_ = true;
112 resource_pool_->SetResourceUsageLimits( 114 resource_pool_->SetResourceUsageLimits(
113 global_state_.memory_limit_in_bytes, 115 global_state_.soft_memory_limit_in_bytes,
114 global_state_.unused_memory_limit_in_bytes, 116 global_state_.unused_memory_limit_in_bytes,
115 global_state_.num_resources_limit); 117 global_state_.num_resources_limit);
116 } 118 }
117 } 119 }
118 120
119 protected: 121 protected:
120 TileManager(TileManagerClient* client, 122 TileManager(TileManagerClient* client,
121 ResourceProvider* resource_provider, 123 ResourceProvider* resource_provider,
122 scoped_ptr<RasterWorkerPool> raster_worker_pool, 124 scoped_ptr<RasterWorkerPool> raster_worker_pool,
123 size_t max_raster_usage_bytes, 125 size_t max_raster_usage_bytes,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 220
219 // Queue used when scheduling raster tasks. 221 // Queue used when scheduling raster tasks.
220 RasterWorkerPool::RasterTask::Queue raster_tasks_; 222 RasterWorkerPool::RasterTask::Queue raster_tasks_;
221 223
222 DISALLOW_COPY_AND_ASSIGN(TileManager); 224 DISALLOW_COPY_AND_ASSIGN(TileManager);
223 }; 225 };
224 226
225 } // namespace cc 227 } // namespace cc
226 228
227 #endif // CC_RESOURCES_TILE_MANAGER_H_ 229 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698