| 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 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 FRIEND_TEST_ALL_PREFIXES(GpuMemoryManagerTest, | 105 FRIEND_TEST_ALL_PREFIXES(GpuMemoryManagerTest, |
| 106 DefaultAllocation); | 106 DefaultAllocation); |
| 107 | 107 |
| 108 typedef std::map<gpu::gles2::MemoryTracker*, GpuMemoryTrackingGroup*> | 108 typedef std::map<gpu::gles2::MemoryTracker*, GpuMemoryTrackingGroup*> |
| 109 TrackingGroupMap; | 109 TrackingGroupMap; |
| 110 | 110 |
| 111 typedef std::list<GpuMemoryManagerClientState*> ClientStateList; | 111 typedef std::list<GpuMemoryManagerClientState*> ClientStateList; |
| 112 | 112 |
| 113 void Manage(); | 113 void Manage(); |
| 114 void SetClientsHibernatedState() const; | 114 void SetClientsHibernatedState() const; |
| 115 void AssignSurfacesAllocations(); |
| 116 void AssignNonSurfacesAllocations(); |
| 117 |
| 118 // Update the amount of GPU memory we think we have in the system, based |
| 119 // on what the stubs' contexts report. |
| 120 void UpdateAvailableGpuMemory(); |
| 115 | 121 |
| 116 // Send memory usage stats to the browser process. | 122 // Send memory usage stats to the browser process. |
| 117 void SendUmaStatsToBrowser(); | 123 void SendUmaStatsToBrowser(); |
| 118 | 124 |
| 119 // Get the current number of bytes allocated. | 125 // Get the current number of bytes allocated. |
| 120 uint64 GetCurrentUsage() const { | 126 uint64 GetCurrentUsage() const { |
| 121 return bytes_allocated_current_; | 127 return bytes_allocated_current_; |
| 122 } | 128 } |
| 123 | 129 |
| 124 // GpuMemoryTrackingGroup interface | 130 // GpuMemoryTrackingGroup interface |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // The current total memory usage, and historical maximum memory usage | 174 // The current total memory usage, and historical maximum memory usage |
| 169 uint64 bytes_allocated_current_; | 175 uint64 bytes_allocated_current_; |
| 170 uint64 bytes_allocated_historical_max_; | 176 uint64 bytes_allocated_historical_max_; |
| 171 | 177 |
| 172 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); | 178 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); |
| 173 }; | 179 }; |
| 174 | 180 |
| 175 } // namespace content | 181 } // namespace content |
| 176 | 182 |
| 177 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | 183 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ |
| OLD | NEW |