| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 while (!tiles_with_pending_set_pixels_.empty()) { | 234 while (!tiles_with_pending_set_pixels_.empty()) { |
| 235 Tile* tile = tiles_with_pending_set_pixels_.front(); | 235 Tile* tile = tiles_with_pending_set_pixels_.front(); |
| 236 DCHECK(tile->managed_state().resource); | 236 DCHECK(tile->managed_state().resource); |
| 237 | 237 |
| 238 // Set pixel tasks complete in the order they are posted. | 238 // Set pixel tasks complete in the order they are posted. |
| 239 if (!resource_pool_->resource_provider()->didSetPixelsComplete( | 239 if (!resource_pool_->resource_provider()->didSetPixelsComplete( |
| 240 tile->managed_state().resource->id())) { | 240 tile->managed_state().resource->id())) { |
| 241 break; | 241 break; |
| 242 } | 242 } |
| 243 | 243 |
| 244 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0 && |
| 245 tile->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) |
| 246 client_->DidUploadVisibleHighResolutionTile(); |
| 247 |
| 244 // It's now safe to release the pixel buffer. | 248 // It's now safe to release the pixel buffer. |
| 245 resource_pool_->resource_provider()->releasePixelBuffer( | 249 resource_pool_->resource_provider()->releasePixelBuffer( |
| 246 tile->managed_state().resource->id()); | 250 tile->managed_state().resource->id()); |
| 247 | 251 |
| 248 DidFinishTileInitialization(tile); | 252 DidFinishTileInitialization(tile); |
| 249 tiles_with_pending_set_pixels_.pop(); | 253 tiles_with_pending_set_pixels_.pop(); |
| 250 } | 254 } |
| 251 } | 255 } |
| 252 | 256 |
| 253 void TileManager::GetRenderingStats(RenderingStats* stats) { | 257 void TileManager::GetRenderingStats(RenderingStats* stats) { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } | 523 } |
| 520 | 524 |
| 521 void TileManager::DidFinishTileInitialization(Tile* tile) { | 525 void TileManager::DidFinishTileInitialization(Tile* tile) { |
| 522 ManagedTileState& managed_tile_state = tile->managed_state(); | 526 ManagedTileState& managed_tile_state = tile->managed_state(); |
| 523 DCHECK(managed_tile_state.resource); | 527 DCHECK(managed_tile_state.resource); |
| 524 managed_tile_state.resource_is_being_initialized = false; | 528 managed_tile_state.resource_is_being_initialized = false; |
| 525 managed_tile_state.can_be_freed = true; | 529 managed_tile_state.can_be_freed = true; |
| 526 } | 530 } |
| 527 | 531 |
| 528 } // namespace cc | 532 } // namespace cc |
| OLD | NEW |