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

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

Issue 9581018: GPU: Build most of the gpu as a single DLL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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 <vector> 8 #include <vector>
9 9
10 #include "../../gpu_export.h"
10 #include "../common/types.h" 11 #include "../common/types.h"
11 #include "../client/fenced_allocator.h" 12 #include "../client/fenced_allocator.h"
12 #include "../common/buffer.h" 13 #include "../common/buffer.h"
13 14
14 namespace gpu { 15 namespace gpu {
15 16
16 class CommandBufferHelper; 17 class CommandBufferHelper;
17 18
18 // Manages a shared memory segment. 19 // Manages a shared memory segment.
19 class MemoryChunk { 20 class GPU_EXPORT MemoryChunk {
20 public: 21 public:
21 MemoryChunk(int32 shm_id, gpu::Buffer shm, CommandBufferHelper* helper); 22 MemoryChunk(int32 shm_id, gpu::Buffer shm, CommandBufferHelper* helper);
22 23
23 // Gets the size of the largest free block that is available without waiting. 24 // Gets the size of the largest free block that is available without waiting.
24 unsigned int GetLargestFreeSizeWithoutWaiting() { 25 unsigned int GetLargestFreeSizeWithoutWaiting() {
25 return allocator_.GetLargestFreeSize(); 26 return allocator_.GetLargestFreeSize();
26 } 27 }
27 28
28 // Gets the size of the largest free block that can be allocated if the 29 // Gets the size of the largest free block that can be allocated if the
29 // caller can wait. 30 // caller can wait.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 98
98 private: 99 private:
99 int32 shm_id_; 100 int32 shm_id_;
100 gpu::Buffer shm_; 101 gpu::Buffer shm_;
101 FencedAllocatorWrapper allocator_; 102 FencedAllocatorWrapper allocator_;
102 103
103 DISALLOW_COPY_AND_ASSIGN(MemoryChunk); 104 DISALLOW_COPY_AND_ASSIGN(MemoryChunk);
104 }; 105 };
105 106
106 // Manages MemoryChucks. 107 // Manages MemoryChucks.
107 class MappedMemoryManager { 108 class GPU_EXPORT MappedMemoryManager {
108 public: 109 public:
109 explicit MappedMemoryManager(CommandBufferHelper* helper); 110 explicit MappedMemoryManager(CommandBufferHelper* helper);
110 111
111 ~MappedMemoryManager(); 112 ~MappedMemoryManager();
112 113
113 unsigned int chunk_size_multiple() const { 114 unsigned int chunk_size_multiple() const {
114 return chunk_size_multiple_; 115 return chunk_size_multiple_;
115 } 116 }
116 117
117 void set_chunk_size_multiple(unsigned int multiple) { 118 void set_chunk_size_multiple(unsigned int multiple) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 CommandBufferHelper* helper_; 159 CommandBufferHelper* helper_;
159 MemoryChunkVector chunks_; 160 MemoryChunkVector chunks_;
160 161
161 DISALLOW_COPY_AND_ASSIGN(MappedMemoryManager); 162 DISALLOW_COPY_AND_ASSIGN(MappedMemoryManager);
162 }; 163 };
163 164
164 } // namespace gpu 165 } // namespace gpu
165 166
166 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ 167 #endif // GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_
167 168
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/ring_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698