| 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 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 Loading... |
| 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() { |
| 33 return shm_.get(); |
| 34 } |
| 35 |
| 32 // Gets the size of the largest free block that is available without waiting. | 36 // Gets the size of the largest free block that is available without waiting. |
| 33 unsigned int GetLargestFreeSizeWithoutWaiting() { | 37 unsigned int GetLargestFreeSizeWithoutWaiting() { |
| 34 return allocator_.GetLargestFreeSize(); | 38 return allocator_.GetLargestFreeSize(); |
| 35 } | 39 } |
| 36 | 40 |
| 37 // Gets the size of the largest free block that can be allocated if the | 41 // Gets the size of the largest free block that can be allocated if the |
| 38 // caller can wait. | 42 // caller can wait. |
| 39 unsigned int GetLargestFreeSizeWithWaiting() { | 43 unsigned int GetLargestFreeSizeWithWaiting() { |
| 40 return allocator_.GetLargestFreeOrPendingSize(); | 44 return allocator_.GetLargestFreeOrPendingSize(); |
| 41 } | 45 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 uint32_t shm_offset_; | 277 uint32_t shm_offset_; |
| 274 bool flush_after_release_; | 278 bool flush_after_release_; |
| 275 CommandBufferHelper* helper_; | 279 CommandBufferHelper* helper_; |
| 276 MappedMemoryManager* mapped_memory_manager_; | 280 MappedMemoryManager* mapped_memory_manager_; |
| 277 DISALLOW_COPY_AND_ASSIGN(ScopedMappedMemoryPtr); | 281 DISALLOW_COPY_AND_ASSIGN(ScopedMappedMemoryPtr); |
| 278 }; | 282 }; |
| 279 | 283 |
| 280 } // namespace gpu | 284 } // namespace gpu |
| 281 | 285 |
| 282 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ | 286 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ |
| OLD | NEW |