| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 void TileManager::AbortPendingTileUploads() { | 355 void TileManager::AbortPendingTileUploads() { |
| 356 while (!tiles_with_pending_upload_.empty()) { | 356 while (!tiles_with_pending_upload_.empty()) { |
| 357 Tile* tile = tiles_with_pending_upload_.front(); | 357 Tile* tile = tiles_with_pending_upload_.front(); |
| 358 DCHECK(tile->drawing_info().resource_); | 358 DCHECK(tile->drawing_info().resource_); |
| 359 | 359 |
| 360 resource_pool_->resource_provider()->AbortSetPixels( | 360 resource_pool_->resource_provider()->AbortSetPixels( |
| 361 tile->drawing_info().resource_->id()); | 361 tile->drawing_info().resource_->id()); |
| 362 resource_pool_->resource_provider()->ReleasePixelBuffer( | 362 resource_pool_->resource_provider()->ReleasePixelBuffer( |
| 363 tile->drawing_info().resource_->id()); | 363 tile->drawing_info().resource_->id()); |
| 364 tile->drawing_info().memory_state_ = USING_RELEASABLE_MEMORY; |
| 364 | 365 |
| 365 FreeResourcesForTile(tile); | 366 FreeResourcesForTile(tile); |
| 366 | 367 |
| 367 bytes_pending_upload_ -= tile->bytes_consumed_if_allocated(); | 368 bytes_pending_upload_ -= tile->bytes_consumed_if_allocated(); |
| 368 tiles_with_pending_upload_.pop(); | 369 tiles_with_pending_upload_.pop(); |
| 369 } | 370 } |
| 370 } | 371 } |
| 371 | 372 |
| 372 void TileManager::ForceTileUploadToComplete(Tile* tile) { | 373 void TileManager::ForceTileUploadToComplete(Tile* tile) { |
| 373 DCHECK(tile); | 374 DCHECK(tile); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 skia::LazyPixelRef* pixel_ref, | 980 skia::LazyPixelRef* pixel_ref, |
| 980 RenderingStatsInstrumentation* stats_instrumentation) { | 981 RenderingStatsInstrumentation* stats_instrumentation) { |
| 981 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); | 982 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); |
| 982 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 983 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
| 983 pixel_ref->Decode(); | 984 pixel_ref->Decode(); |
| 984 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); | 985 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); |
| 985 stats_instrumentation->AddDeferredImageDecode(duration); | 986 stats_instrumentation->AddDeferredImageDecode(duration); |
| 986 } | 987 } |
| 987 | 988 |
| 988 } // namespace cc | 989 } // namespace cc |
| OLD | NEW |