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

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

Issue 12502016: cc: Add command line switch to control resource usage for impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/resource_pool.cc ('k') | cc/resources/tile_priority.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 <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 raster_worker_pool_.reset(); 191 raster_worker_pool_.reset();
192 AbortPendingTileUploads(); 192 AbortPendingTileUploads();
193 DCHECK_EQ(tiles_with_pending_upload_.size(), 0); 193 DCHECK_EQ(tiles_with_pending_upload_.size(), 0);
194 DCHECK_EQ(all_tiles_.size(), 0); 194 DCHECK_EQ(all_tiles_.size(), 0);
195 DCHECK_EQ(live_or_allocated_tiles_.size(), 0); 195 DCHECK_EQ(live_or_allocated_tiles_.size(), 0);
196 } 196 }
197 197
198 void TileManager::SetGlobalState( 198 void TileManager::SetGlobalState(
199 const GlobalStateThatImpactsTilePriority& global_state) { 199 const GlobalStateThatImpactsTilePriority& global_state) {
200 global_state_ = global_state; 200 global_state_ = global_state;
201 resource_pool_->SetMaxMemoryUsageBytes(global_state_.memory_limit_in_bytes); 201 resource_pool_->SetMaxMemoryUsageBytes(
202 global_state_.memory_limit_in_bytes,
203 global_state_.unused_memory_limit_in_bytes);
202 ScheduleManageTiles(); 204 ScheduleManageTiles();
203 UpdateCheapTasksTimeLimit(); 205 UpdateCheapTasksTimeLimit();
204 } 206 }
205 207
206 void TileManager::RegisterTile(Tile* tile) { 208 void TileManager::RegisterTile(Tile* tile) {
207 all_tiles_.insert(tile); 209 all_tiles_.insert(tile);
208 210
209 const ManagedTileState& mts = tile->managed_state(); 211 const ManagedTileState& mts = tile->managed_state();
210 for (int i = 0; i < NUM_TREES; ++i) 212 for (int i = 0; i < NUM_TREES; ++i)
211 ++raster_state_count_[mts.raster_state][i][mts.tree_bin[i]]; 213 ++raster_state_count_[mts.raster_state][i][mts.tree_bin[i]];
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 skia::LazyPixelRef* pixel_ref, 1115 skia::LazyPixelRef* pixel_ref,
1114 RenderingStatsInstrumentation* stats_instrumentation) { 1116 RenderingStatsInstrumentation* stats_instrumentation) {
1115 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); 1117 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask");
1116 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 1118 base::TimeTicks start_time = stats_instrumentation->StartRecording();
1117 pixel_ref->Decode(); 1119 pixel_ref->Decode();
1118 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); 1120 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
1119 stats_instrumentation->AddDeferredImageDecode(duration); 1121 stats_instrumentation->AddDeferredImageDecode(duration);
1120 } 1122 }
1121 1123
1122 } // namespace cc 1124 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_pool.cc ('k') | cc/resources/tile_priority.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698