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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 while (!tiles_with_pending_set_pixels_.empty()) { | 241 while (!tiles_with_pending_set_pixels_.empty()) { |
242 Tile* tile = tiles_with_pending_set_pixels_.front(); | 242 Tile* tile = tiles_with_pending_set_pixels_.front(); |
243 DCHECK(tile->managed_state().resource); | 243 DCHECK(tile->managed_state().resource); |
244 | 244 |
245 // Set pixel tasks complete in the order they are posted. | 245 // Set pixel tasks complete in the order they are posted. |
246 if (!resource_pool_->resource_provider()->didSetPixelsComplete( | 246 if (!resource_pool_->resource_provider()->didSetPixelsComplete( |
247 tile->managed_state().resource->id())) { | 247 tile->managed_state().resource->id())) { |
248 break; | 248 break; |
249 } | 249 } |
250 | 250 |
| 251 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0 && |
| 252 tile->priority(ACTIVE_TREE).resolution == HIGH_RESOLUTION) |
| 253 client_->DidUploadVisibleHighResolutionTile(); |
| 254 |
251 // It's now safe to release the pixel buffer. | 255 // It's now safe to release the pixel buffer. |
252 resource_pool_->resource_provider()->releasePixelBuffer( | 256 resource_pool_->resource_provider()->releasePixelBuffer( |
253 tile->managed_state().resource->id()); | 257 tile->managed_state().resource->id()); |
254 | 258 |
255 DidFinishTileInitialization(tile); | 259 DidFinishTileInitialization(tile); |
256 tiles_with_pending_set_pixels_.pop(); | 260 tiles_with_pending_set_pixels_.pop(); |
257 } | 261 } |
258 } | 262 } |
259 | 263 |
260 void TileManager::GetRenderingStats(RenderingStats* stats) { | 264 void TileManager::GetRenderingStats(RenderingStats* stats) { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 } | 530 } |
527 | 531 |
528 void TileManager::DidFinishTileInitialization(Tile* tile) { | 532 void TileManager::DidFinishTileInitialization(Tile* tile) { |
529 ManagedTileState& managed_tile_state = tile->managed_state(); | 533 ManagedTileState& managed_tile_state = tile->managed_state(); |
530 DCHECK(managed_tile_state.resource); | 534 DCHECK(managed_tile_state.resource); |
531 managed_tile_state.resource_is_being_initialized = false; | 535 managed_tile_state.resource_is_being_initialized = false; |
532 managed_tile_state.can_be_freed = true; | 536 managed_tile_state.can_be_freed = true; |
533 } | 537 } |
534 | 538 |
535 } // namespace cc | 539 } // namespace cc |
OLD | NEW |