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 #if defined(ENABLE_GPU) | 8 #if defined(ENABLE_GPU) |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 friend class GpuMemoryManagerTest; | 80 friend class GpuMemoryManagerTest; |
81 | 81 |
82 void Manage(); | 82 void Manage(); |
83 | 83 |
84 size_t CalculateBonusMemoryAllocationBasedOnSize(gfx::Size size) const; | 84 size_t CalculateBonusMemoryAllocationBasedOnSize(gfx::Size size) const; |
85 | 85 |
86 size_t GetAvailableGpuMemory() const { | 86 size_t GetAvailableGpuMemory() const { |
87 return bytes_available_gpu_memory_; | 87 return bytes_available_gpu_memory_; |
88 } | 88 } |
89 | 89 |
| 90 // The maximum amount of memory that a tab may be assigned |
| 91 size_t GetMaximumTabAllocation() const { |
| 92 return 128 * 1024 * 1024; |
| 93 } |
| 94 |
90 // The minimum non-zero amount of memory that a tab may be assigned | 95 // The minimum non-zero amount of memory that a tab may be assigned |
91 size_t GetMinimumTabAllocation() const { | 96 size_t GetMinimumTabAllocation() const { |
92 #if defined(OS_ANDROID) | 97 #if defined(OS_ANDROID) |
93 return 32 * 1024 * 1024; | 98 return 32 * 1024 * 1024; |
94 #else | 99 #else |
95 return 64 * 1024 * 1024; | 100 return 64 * 1024 * 1024; |
96 #endif | 101 #endif |
97 } | 102 } |
98 | 103 |
99 class CONTENT_EXPORT StubWithSurfaceComparator { | 104 class CONTENT_EXPORT StubWithSurfaceComparator { |
(...skipping 17 matching lines...) Expand all Loading... |
117 // The current total memory usage, and historical maximum memory usage | 122 // The current total memory usage, and historical maximum memory usage |
118 size_t bytes_allocated_current_; | 123 size_t bytes_allocated_current_; |
119 size_t bytes_allocated_historical_max_; | 124 size_t bytes_allocated_historical_max_; |
120 | 125 |
121 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); | 126 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); |
122 }; | 127 }; |
123 | 128 |
124 #endif | 129 #endif |
125 | 130 |
126 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ | 131 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ |
OLD | NEW |