Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: content/common/gpu/gpu_memory_manager.h

Issue 1324413003: Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove more memory alloc codes. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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();
121 115
122 // Send memory usage stats to the browser process. 116 // Send memory usage stats to the browser process.
123 void SendUmaStatsToBrowser(); 117 void SendUmaStatsToBrowser();
124 118
125 // Get the current number of bytes allocated. 119 // Get the current number of bytes allocated.
126 uint64 GetCurrentUsage() const { 120 uint64 GetCurrentUsage() const {
127 return bytes_allocated_managed_current_ + 121 return bytes_allocated_managed_current_ +
128 bytes_allocated_unmanaged_current_; 122 bytes_allocated_unmanaged_current_;
129 } 123 }
130 124
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 uint64 bytes_allocated_managed_current_; 171 uint64 bytes_allocated_managed_current_;
178 uint64 bytes_allocated_unmanaged_current_; 172 uint64 bytes_allocated_unmanaged_current_;
179 uint64 bytes_allocated_historical_max_; 173 uint64 bytes_allocated_historical_max_;
180 174
181 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager); 175 DISALLOW_COPY_AND_ASSIGN(GpuMemoryManager);
182 }; 176 };
183 177
184 } // namespace content 178 } // namespace content
185 179
186 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_ 180 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698