| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 live_or_allocated_tiles_.push_back(tile); | 363 live_or_allocated_tiles_.push_back(tile); |
| 364 } | 364 } |
| 365 TRACE_COUNTER_ID1("cc", "LiveOrAllocatedTileCount", this, | 365 TRACE_COUNTER_ID1("cc", "LiveOrAllocatedTileCount", this, |
| 366 live_or_allocated_tiles_.size()); | 366 live_or_allocated_tiles_.size()); |
| 367 | 367 |
| 368 SortTiles(); | 368 SortTiles(); |
| 369 | 369 |
| 370 // Assign gpu memory and determine what tiles need to be rasterized. | 370 // Assign gpu memory and determine what tiles need to be rasterized. |
| 371 AssignGpuMemoryToTiles(); | 371 AssignGpuMemoryToTiles(); |
| 372 | 372 |
| 373 TRACE_EVENT_INSTANT1("cc", "DidManage", "state", | 373 TRACE_EVENT_INSTANT1("cc", "DidManage", TRACE_EVENT_SCOPE_THREAD, |
| 374 ValueToString(BasicStateAsValue())); | 374 "state", ValueToString(BasicStateAsValue())); |
| 375 | 375 |
| 376 // Finally, kick the rasterizer. | 376 // Finally, kick the rasterizer. |
| 377 DispatchMoreTasks(); | 377 DispatchMoreTasks(); |
| 378 } | 378 } |
| 379 | 379 |
| 380 void TileManager::CheckForCompletedTileUploads() { | 380 void TileManager::CheckForCompletedTileUploads() { |
| 381 while (!tiles_with_pending_upload_.empty()) { | 381 while (!tiles_with_pending_upload_.empty()) { |
| 382 Tile* tile = tiles_with_pending_upload_.front(); | 382 Tile* tile = tiles_with_pending_upload_.front(); |
| 383 ManagedTileState& managed_tile_state = tile->managed_state(); | 383 ManagedTileState& managed_tile_state = tile->managed_state(); |
| 384 DCHECK(managed_tile_state.drawing_info.resource_); | 384 DCHECK(managed_tile_state.drawing_info.resource_); |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 skia::LazyPixelRef* pixel_ref, | 1090 skia::LazyPixelRef* pixel_ref, |
| 1091 RenderingStatsInstrumentation* stats_instrumentation) { | 1091 RenderingStatsInstrumentation* stats_instrumentation) { |
| 1092 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); | 1092 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); |
| 1093 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 1093 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
| 1094 pixel_ref->Decode(); | 1094 pixel_ref->Decode(); |
| 1095 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 1095 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); |
| 1096 stats_instrumentation->AddDeferredImageDecode(duration); | 1096 stats_instrumentation->AddDeferredImageDecode(duration); |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 } // namespace cc | 1099 } // namespace cc |
| OLD | NEW |