OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/common/gpu/gpu_memory_manager.h" | 5 #include "content/common/gpu/gpu_memory_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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 client_hard_limit_bytes_ = bytes_min; | 100 client_hard_limit_bytes_ = bytes_min; |
101 // Clamp the observed value to a specific range on Android. | 101 // Clamp the observed value to a specific range on Android. |
102 client_hard_limit_bytes_ = std::max(client_hard_limit_bytes_, | 102 client_hard_limit_bytes_ = std::max(client_hard_limit_bytes_, |
103 static_cast<uint64>(16 * 1024 * 1024)); | 103 static_cast<uint64>(16 * 1024 * 1024)); |
104 client_hard_limit_bytes_ = std::min(client_hard_limit_bytes_, | 104 client_hard_limit_bytes_ = std::min(client_hard_limit_bytes_, |
105 static_cast<uint64>(256 * 1024 * 1024)); | 105 static_cast<uint64>(256 * 1024 * 1024)); |
106 #else | 106 #else |
107 // Ignore what the system said and give all clients the same maximum | 107 // Ignore what the system said and give all clients the same maximum |
108 // allocation on desktop platforms. | 108 // allocation on desktop platforms. |
109 client_hard_limit_bytes_ = 256 * 1024 * 1024; | 109 client_hard_limit_bytes_ = 512 * 1024 * 1024; |
110 #endif | 110 #endif |
111 } | 111 } |
112 | 112 |
113 void GpuMemoryManager::ScheduleManage( | 113 void GpuMemoryManager::ScheduleManage( |
114 ScheduleManageTime schedule_manage_time) { | 114 ScheduleManageTime schedule_manage_time) { |
115 if (disable_schedule_manage_) | 115 if (disable_schedule_manage_) |
116 return; | 116 return; |
117 if (manage_immediate_scheduled_) | 117 if (manage_immediate_scheduled_) |
118 return; | 118 return; |
119 if (schedule_manage_time == kScheduleManageNow) { | 119 if (schedule_manage_time == kScheduleManageNow) { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 403 |
404 void GpuMemoryManager::RemoveClientFromList( | 404 void GpuMemoryManager::RemoveClientFromList( |
405 GpuMemoryManagerClientState* client_state) { | 405 GpuMemoryManagerClientState* client_state) { |
406 DCHECK(client_state->list_iterator_valid_); | 406 DCHECK(client_state->list_iterator_valid_); |
407 ClientStateList* client_list = GetClientList(client_state); | 407 ClientStateList* client_list = GetClientList(client_state); |
408 client_list->erase(client_state->list_iterator_); | 408 client_list->erase(client_state->list_iterator_); |
409 client_state->list_iterator_valid_ = false; | 409 client_state->list_iterator_valid_ = false; |
410 } | 410 } |
411 | 411 |
412 } // namespace content | 412 } // namespace content |
OLD | NEW |