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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 "budget", | 956 "budget", |
957 global_state_.hard_memory_limit_in_bytes, | 957 global_state_.hard_memory_limit_in_bytes, |
958 "over", | 958 "over", |
959 bytes_that_exceeded_memory_budget); | 959 bytes_that_exceeded_memory_budget); |
960 } | 960 } |
961 memory_stats_from_last_assign_.total_budget_in_bytes = | 961 memory_stats_from_last_assign_.total_budget_in_bytes = |
962 global_state_.hard_memory_limit_in_bytes; | 962 global_state_.hard_memory_limit_in_bytes; |
963 memory_stats_from_last_assign_.bytes_allocated = | 963 memory_stats_from_last_assign_.bytes_allocated = |
964 hard_bytes_allocatable - hard_bytes_left; | 964 hard_bytes_allocatable - hard_bytes_left; |
965 memory_stats_from_last_assign_.bytes_unreleasable = | 965 memory_stats_from_last_assign_.bytes_unreleasable = |
966 hard_bytes_allocatable - bytes_releasable_; | 966 resource_pool_->acquired_memory_usage_bytes() - bytes_releasable_; |
967 memory_stats_from_last_assign_.bytes_over = bytes_that_exceeded_memory_budget; | 967 memory_stats_from_last_assign_.bytes_over = bytes_that_exceeded_memory_budget; |
968 } | 968 } |
969 | 969 |
970 void TileManager::FreeResourceForTile(Tile* tile, RasterMode mode) { | 970 void TileManager::FreeResourceForTile(Tile* tile, RasterMode mode) { |
971 ManagedTileState& mts = tile->managed_state(); | 971 ManagedTileState& mts = tile->managed_state(); |
972 if (mts.tile_versions[mode].resource_) { | 972 if (mts.tile_versions[mode].resource_) { |
973 resource_pool_->ReleaseResource(mts.tile_versions[mode].resource_.Pass()); | 973 resource_pool_->ReleaseResource(mts.tile_versions[mode].resource_.Pass()); |
974 | 974 |
975 DCHECK_GE(bytes_releasable_, BytesConsumedIfAllocated(tile)); | 975 DCHECK_GE(bytes_releasable_, BytesConsumedIfAllocated(tile)); |
976 DCHECK_GE(resources_releasable_, 1u); | 976 DCHECK_GE(resources_releasable_, 1u); |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1626 | 1626 |
1627 if (b_priority.resolution != a_priority.resolution) { | 1627 if (b_priority.resolution != a_priority.resolution) { |
1628 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || | 1628 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || |
1629 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || | 1629 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || |
1630 (a_priority.resolution == NON_IDEAL_RESOLUTION); | 1630 (a_priority.resolution == NON_IDEAL_RESOLUTION); |
1631 } | 1631 } |
1632 return a_priority.IsHigherPriorityThan(b_priority); | 1632 return a_priority.IsHigherPriorityThan(b_priority); |
1633 } | 1633 } |
1634 | 1634 |
1635 } // namespace cc | 1635 } // namespace cc |
OLD | NEW |