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/tile_manager.h" | 5 #include "cc/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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 DidFinishTileInitialization(tile); | 248 DidFinishTileInitialization(tile); |
249 tiles_with_pending_set_pixels_.pop(); | 249 tiles_with_pending_set_pixels_.pop(); |
250 } | 250 } |
251 } | 251 } |
252 | 252 |
253 void TileManager::GetRenderingStats(RenderingStats* stats) { | 253 void TileManager::GetRenderingStats(RenderingStats* stats) { |
254 raster_worker_pool_->GetRenderingStats(stats); | 254 raster_worker_pool_->GetRenderingStats(stats); |
255 stats->totalDeferredImageCacheHitCount = | 255 stats->totalDeferredImageCacheHitCount = |
256 rendering_stats_.totalDeferredImageCacheHitCount; | 256 rendering_stats_.totalDeferredImageCacheHitCount; |
257 stats->totalImageGatheringCount = rendering_stats_.totalImageGatheringCount; | 257 stats->totalImageGatheringCount = rendering_stats_.totalImageGatheringCount; |
258 stats->totalImageGatheringTimeInSeconds = | 258 stats->totalImageGatheringTime = |
259 rendering_stats_.totalImageGatheringTimeInSeconds; | 259 rendering_stats_.totalImageGatheringTime; |
260 } | 260 } |
261 | 261 |
262 void TileManager::GetMemoryStats( | 262 void TileManager::GetMemoryStats( |
263 size_t* memoryRequiredBytes, | 263 size_t* memoryRequiredBytes, |
264 size_t* memoryNiceToHaveBytes, | 264 size_t* memoryNiceToHaveBytes, |
265 size_t* memoryUsedBytes) { | 265 size_t* memoryUsedBytes) { |
266 *memoryRequiredBytes = 0; | 266 *memoryRequiredBytes = 0; |
267 *memoryNiceToHaveBytes = 0; | 267 *memoryNiceToHaveBytes = 0; |
268 *memoryUsedBytes = 0; | 268 *memoryUsedBytes = 0; |
269 for (TileVector::iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | 269 for (TileVector::iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 } | 374 } |
375 | 375 |
376 void TileManager::GatherPixelRefsForTile(Tile* tile) { | 376 void TileManager::GatherPixelRefsForTile(Tile* tile) { |
377 TRACE_EVENT0("cc", "TileManager::GatherPixelRefsForTile"); | 377 TRACE_EVENT0("cc", "TileManager::GatherPixelRefsForTile"); |
378 ManagedTileState& managed_state = tile->managed_state(); | 378 ManagedTileState& managed_state = tile->managed_state(); |
379 if (managed_state.need_to_gather_pixel_refs) { | 379 if (managed_state.need_to_gather_pixel_refs) { |
380 base::TimeTicks gather_begin_time = base::TimeTicks::Now(); | 380 base::TimeTicks gather_begin_time = base::TimeTicks::Now(); |
381 const_cast<PicturePileImpl *>(tile->picture_pile())->GatherPixelRefs( | 381 const_cast<PicturePileImpl *>(tile->picture_pile())->GatherPixelRefs( |
382 tile->content_rect_, managed_state.pending_pixel_refs); | 382 tile->content_rect_, managed_state.pending_pixel_refs); |
383 rendering_stats_.totalImageGatheringCount++; | 383 rendering_stats_.totalImageGatheringCount++; |
384 rendering_stats_.totalImageGatheringTimeInSeconds += | 384 rendering_stats_.totalImageGatheringTime += |
385 (base::TimeTicks::Now() - gather_begin_time).InSecondsF(); | 385 base::TimeTicks::Now() - gather_begin_time; |
386 managed_state.need_to_gather_pixel_refs = false; | 386 managed_state.need_to_gather_pixel_refs = false; |
387 } | 387 } |
388 } | 388 } |
389 | 389 |
390 void TileManager::DispatchImageDecodeTasksForTile(Tile* tile) { | 390 void TileManager::DispatchImageDecodeTasksForTile(Tile* tile) { |
391 GatherPixelRefsForTile(tile); | 391 GatherPixelRefsForTile(tile); |
392 std::list<skia::LazyPixelRef*>& pending_pixel_refs = | 392 std::list<skia::LazyPixelRef*>& pending_pixel_refs = |
393 tile->managed_state().pending_pixel_refs; | 393 tile->managed_state().pending_pixel_refs; |
394 std::list<skia::LazyPixelRef*>::iterator it = pending_pixel_refs.begin(); | 394 std::list<skia::LazyPixelRef*>::iterator it = pending_pixel_refs.begin(); |
395 while (it != pending_pixel_refs.end()) { | 395 while (it != pending_pixel_refs.end()) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 } | 519 } |
520 | 520 |
521 void TileManager::DidFinishTileInitialization(Tile* tile) { | 521 void TileManager::DidFinishTileInitialization(Tile* tile) { |
522 ManagedTileState& managed_tile_state = tile->managed_state(); | 522 ManagedTileState& managed_tile_state = tile->managed_state(); |
523 DCHECK(managed_tile_state.resource); | 523 DCHECK(managed_tile_state.resource); |
524 managed_tile_state.resource_is_being_initialized = false; | 524 managed_tile_state.resource_is_being_initialized = false; |
525 managed_tile_state.can_be_freed = true; | 525 managed_tile_state.can_be_freed = true; |
526 } | 526 } |
527 | 527 |
528 } // namespace cc | 528 } // namespace cc |
OLD | NEW |