OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 settings_.max_memory_for_prepaint_percentage) / | 1169 settings_.max_memory_for_prepaint_percentage) / |
1170 100; | 1170 100; |
1171 } | 1171 } |
1172 global_tile_state_.memory_limit_policy = | 1172 global_tile_state_.memory_limit_policy = |
1173 ManagedMemoryPolicy::PriorityCutoffToTileMemoryLimitPolicy( | 1173 ManagedMemoryPolicy::PriorityCutoffToTileMemoryLimitPolicy( |
1174 visible_ ? | 1174 visible_ ? |
1175 policy.priority_cutoff_when_visible : | 1175 policy.priority_cutoff_when_visible : |
1176 gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); | 1176 gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING); |
1177 global_tile_state_.num_resources_limit = policy.num_resources_limit; | 1177 global_tile_state_.num_resources_limit = policy.num_resources_limit; |
1178 | 1178 |
| 1179 if (use_gpu_rasterization_ && rasterizer_) |
| 1180 rasterizer_->SetMemoryLimits(visible_, |
| 1181 global_tile_state_.hard_memory_limit_in_bytes); |
| 1182 |
1179 // TODO(reveman): We should avoid keeping around unused resources if | 1183 // TODO(reveman): We should avoid keeping around unused resources if |
1180 // possible. crbug.com/224475 | 1184 // possible. crbug.com/224475 |
1181 // Unused limit is calculated from soft-limit, as hard-limit may | 1185 // Unused limit is calculated from soft-limit, as hard-limit may |
1182 // be very high and shouldn't typically be exceeded. | 1186 // be very high and shouldn't typically be exceeded. |
1183 size_t unused_memory_limit_in_bytes = static_cast<size_t>( | 1187 size_t unused_memory_limit_in_bytes = static_cast<size_t>( |
1184 (static_cast<int64>(global_tile_state_.soft_memory_limit_in_bytes) * | 1188 (static_cast<int64>(global_tile_state_.soft_memory_limit_in_bytes) * |
1185 settings_.max_unused_resource_memory_percentage) / | 1189 settings_.max_unused_resource_memory_percentage) / |
1186 100); | 1190 100); |
1187 | 1191 |
1188 DCHECK(resource_pool_); | 1192 DCHECK(resource_pool_); |
(...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3416 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3420 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3417 | 3421 |
3418 curve->UpdateTarget( | 3422 curve->UpdateTarget( |
3419 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3423 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3420 .InSecondsF(), | 3424 .InSecondsF(), |
3421 new_target); | 3425 new_target); |
3422 | 3426 |
3423 return true; | 3427 return true; |
3424 } | 3428 } |
3425 } // namespace cc | 3429 } // namespace cc |
OLD | NEW |