OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "../common/types.h" | 10 #include "../common/types.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 int32 shm_id_; | 94 int32 shm_id_; |
95 gpu::Buffer shm_; | 95 gpu::Buffer shm_; |
96 FencedAllocatorWrapper allocator_; | 96 FencedAllocatorWrapper allocator_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(MemoryChunk); | 98 DISALLOW_COPY_AND_ASSIGN(MemoryChunk); |
99 }; | 99 }; |
100 | 100 |
101 // Manages MemoryChucks. | 101 // Manages MemoryChucks. |
102 class MappedMemoryManager { | 102 class MappedMemoryManager { |
103 public: | 103 public: |
104 explicit MappedMemoryManager(CommandBufferHelper* helper) | 104 explicit MappedMemoryManager(CommandBufferHelper* helper); |
105 : helper_(helper) { | |
106 } | |
107 | 105 |
108 ~MappedMemoryManager(); | 106 ~MappedMemoryManager(); |
109 | 107 |
110 // Allocates a block of memory | 108 // Allocates a block of memory |
111 // Parameters: | 109 // Parameters: |
112 // size: size of memory to allocate. | 110 // size: size of memory to allocate. |
113 // shm_id: pointer to variable to receive the shared memory id. | 111 // shm_id: pointer to variable to receive the shared memory id. |
114 // shm_offset: pointer to variable to receive the shared memory offset. | 112 // shm_offset: pointer to variable to receive the shared memory offset. |
115 // Returns: | 113 // Returns: |
116 // pointer to allocated block of memory. NULL if failure. | 114 // pointer to allocated block of memory. NULL if failure. |
(...skipping 20 matching lines...) Expand all Loading... |
137 CommandBufferHelper* helper_; | 135 CommandBufferHelper* helper_; |
138 MemoryChunkVector chunks_; | 136 MemoryChunkVector chunks_; |
139 | 137 |
140 DISALLOW_COPY_AND_ASSIGN(MappedMemoryManager); | 138 DISALLOW_COPY_AND_ASSIGN(MappedMemoryManager); |
141 }; | 139 }; |
142 | 140 |
143 } // namespace gpu | 141 } // namespace gpu |
144 | 142 |
145 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ | 143 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ |
146 | 144 |
OLD | NEW |