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 <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 return; | 504 return; |
505 } | 505 } |
506 | 506 |
507 FreeResourcesForReleasedTiles(); | 507 FreeResourcesForReleasedTiles(); |
508 | 508 |
509 resource_pool_->ReduceResourceUsage(); | 509 resource_pool_->ReduceResourceUsage(); |
510 | 510 |
511 // We don't reserve memory for required-for-activation tiles during | 511 // We don't reserve memory for required-for-activation tiles during |
512 // accelerated gestures, so we just postpone activation when we don't | 512 // accelerated gestures, so we just postpone activation when we don't |
513 // have these tiles, and activate after the accelerated gesture. | 513 // have these tiles, and activate after the accelerated gesture. |
514 // Likewise if we don't have any memory (as is the case when we're | |
515 // invisible), if we have tiles that aren't ready, then we shouldn't | |
reveman
2014/09/23 02:38:54
Why is 0 the magic number here? Seems wrong to ass
vmpstr
2014/09/23 15:29:22
Good point. Do you think we should make it a part
reveman
2014/09/23 16:39:11
Maybe it's fine to just use "global_state_.memory_
vmpstr
2014/09/23 17:25:32
Done.
| |
516 // activate as activation can cause checkerboards. | |
514 bool allow_rasterize_on_demand = | 517 bool allow_rasterize_on_demand = |
515 global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY; | 518 global_state_.tree_priority != SMOOTHNESS_TAKES_PRIORITY && |
519 global_state_.hard_memory_limit_in_bytes != 0; | |
516 | 520 |
517 // Use on-demand raster for any required-for-activation tiles that have not | 521 // Use on-demand raster for any required-for-activation tiles that have not |
518 // been been assigned memory after reaching a steady memory state. This | 522 // been been assigned memory after reaching a steady memory state. This |
519 // ensures that we activate even when OOM. | 523 // ensures that we activate even when OOM. |
520 for (TileMap::iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | 524 for (TileMap::iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
521 Tile* tile = it->second; | 525 Tile* tile = it->second; |
522 ManagedTileState& mts = tile->managed_state(); | 526 ManagedTileState& mts = tile->managed_state(); |
523 ManagedTileState::TileVersion& tile_version = | 527 ManagedTileState::TileVersion& tile_version = |
524 mts.tile_versions[mts.raster_mode]; | 528 mts.tile_versions[mts.raster_mode]; |
525 | 529 |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1179 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); | 1183 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); |
1180 | 1184 |
1181 rasterizer_->CheckForCompletedTasks(); | 1185 rasterizer_->CheckForCompletedTasks(); |
1182 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; | 1186 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
1183 | 1187 |
1184 if (IsReadyToActivate()) | 1188 if (IsReadyToActivate()) |
1185 client_->NotifyReadyToActivate(); | 1189 client_->NotifyReadyToActivate(); |
1186 } | 1190 } |
1187 | 1191 |
1188 } // namespace cc | 1192 } // namespace cc |
OLD | NEW |