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

Side by Side Diff: gpu/command_buffer/client/mapped_memory.h

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: (rebase) Created 3 years, 7 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 GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ 6 #define GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 11 matching lines...) Expand all
22 class CommandBufferHelper; 22 class CommandBufferHelper;
23 23
24 // Manages a shared memory segment. 24 // Manages a shared memory segment.
25 class GPU_EXPORT MemoryChunk { 25 class GPU_EXPORT MemoryChunk {
26 public: 26 public:
27 MemoryChunk(int32_t shm_id, 27 MemoryChunk(int32_t shm_id,
28 scoped_refptr<gpu::Buffer> shm, 28 scoped_refptr<gpu::Buffer> shm,
29 CommandBufferHelper* helper); 29 CommandBufferHelper* helper);
30 ~MemoryChunk(); 30 ~MemoryChunk();
31 31
32 gpu::Buffer* buffer() { return shm_.get(); }
33
32 // Gets the size of the largest free block that is available without waiting. 34 // Gets the size of the largest free block that is available without waiting.
33 unsigned int GetLargestFreeSizeWithoutWaiting() { 35 unsigned int GetLargestFreeSizeWithoutWaiting() {
34 return allocator_.GetLargestFreeSize(); 36 return allocator_.GetLargestFreeSize();
35 } 37 }
36 38
37 // Gets the size of the largest free block that can be allocated if the 39 // Gets the size of the largest free block that can be allocated if the
38 // caller can wait. 40 // caller can wait.
39 unsigned int GetLargestFreeSizeWithWaiting() { 41 unsigned int GetLargestFreeSizeWithWaiting() {
40 return allocator_.GetLargestFreeOrPendingSize(); 42 return allocator_.GetLargestFreeOrPendingSize();
41 } 43 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 uint32_t shm_offset_; 275 uint32_t shm_offset_;
274 bool flush_after_release_; 276 bool flush_after_release_;
275 CommandBufferHelper* helper_; 277 CommandBufferHelper* helper_;
276 MappedMemoryManager* mapped_memory_manager_; 278 MappedMemoryManager* mapped_memory_manager_;
277 DISALLOW_COPY_AND_ASSIGN(ScopedMappedMemoryPtr); 279 DISALLOW_COPY_AND_ASSIGN(ScopedMappedMemoryPtr);
278 }; 280 };
279 281
280 } // namespace gpu 282 } // namespace gpu
281 283
282 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ 284 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | gpu/command_buffer/client/mapped_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698