| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |