OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrBufferAllocPool_DEFINED | 8 #ifndef GrBufferAllocPool_DEFINED |
9 #define GrBufferAllocPool_DEFINED | 9 #define GrBufferAllocPool_DEFINED |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 private: | 100 private: |
101 struct BufferBlock { | 101 struct BufferBlock { |
102 size_t fBytesFree; | 102 size_t fBytesFree; |
103 GrGeometryBuffer* fBuffer; | 103 GrGeometryBuffer* fBuffer; |
104 }; | 104 }; |
105 | 105 |
106 bool createBlock(size_t requestSize); | 106 bool createBlock(size_t requestSize); |
107 void destroyBlock(); | 107 void destroyBlock(); |
108 void deleteBlocks(); | 108 void deleteBlocks(); |
109 void flushCpuData(const BufferBlock& block, size_t flushSize); | 109 void flushCpuData(const BufferBlock& block, size_t flushSize); |
| 110 void* resetCpuData(size_t newSize); |
110 #ifdef SK_DEBUG | 111 #ifdef SK_DEBUG |
111 void validate(bool unusedBlockAllowed = false) const; | 112 void validate(bool unusedBlockAllowed = false) const; |
112 #endif | 113 #endif |
113 | |
114 size_t fBytesInUse; | 114 size_t fBytesInUse; |
115 | 115 |
116 GrGpu* fGpu; | 116 GrGpu* fGpu; |
117 size_t fMinBlockSize; | 117 size_t fMinBlockSize; |
118 BufferType fBufferType; | 118 BufferType fBufferType; |
119 | 119 |
120 SkTArray<BufferBlock> fBlocks; | 120 SkTArray<BufferBlock> fBlocks; |
121 SkAutoMalloc fCpuData; | 121 void* fCpuData; |
122 void* fBufferPtr; | 122 void* fBufferPtr; |
123 size_t fGeometryBufferMapThreshold; | 123 size_t fGeometryBufferMapThreshold; |
124 }; | 124 }; |
125 | 125 |
126 class GrVertexBuffer; | 126 class GrVertexBuffer; |
127 | 127 |
128 /** | 128 /** |
129 * A GrBufferAllocPool of vertex buffers | 129 * A GrBufferAllocPool of vertex buffers |
130 */ | 130 */ |
131 class GrVertexBufferAllocPool : public GrBufferAllocPool { | 131 class GrVertexBufferAllocPool : public GrBufferAllocPool { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 */ | 201 */ |
202 void* makeSpace(int indexCount, | 202 void* makeSpace(int indexCount, |
203 const GrIndexBuffer** buffer, | 203 const GrIndexBuffer** buffer, |
204 int* startIndex); | 204 int* startIndex); |
205 | 205 |
206 private: | 206 private: |
207 typedef GrBufferAllocPool INHERITED; | 207 typedef GrBufferAllocPool INHERITED; |
208 }; | 208 }; |
209 | 209 |
210 #endif | 210 #endif |
OLD | NEW |