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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 friend class GrGpu; | 148 friend class GrGpu; |
149 void releaseGpuRef(); | 149 void releaseGpuRef(); |
150 | 150 |
151 struct BufferBlock { | 151 struct BufferBlock { |
152 size_t fBytesFree; | 152 size_t fBytesFree; |
153 GrGeometryBuffer* fBuffer; | 153 GrGeometryBuffer* fBuffer; |
154 }; | 154 }; |
155 | 155 |
156 bool createBlock(size_t requestSize); | 156 bool createBlock(size_t requestSize); |
157 void destroyBlock(); | 157 void destroyBlock(); |
158 void flushCpuData(GrGeometryBuffer* buffer, size_t flushSize); | 158 void flushCpuData(const BufferBlock& block, size_t flushSize); |
159 #ifdef SK_DEBUG | 159 #ifdef SK_DEBUG |
160 void validate(bool unusedBlockAllowed = false) const; | 160 void validate(bool unusedBlockAllowed = false) const; |
161 #endif | 161 #endif |
162 | 162 |
163 size_t fBytesInUse; | 163 size_t fBytesInUse; |
164 | 164 |
165 GrGpu* fGpu; | 165 GrGpu* fGpu; |
166 bool fGpuIsReffed; | 166 bool fGpuIsReffed; |
167 bool fFrequentResetHint; | 167 bool fFrequentResetHint; |
168 SkTDArray<GrGeometryBuffer*> fPreallocBuffers; | 168 SkTDArray<GrGeometryBuffer*> fPreallocBuffers; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 * @return number of indices that fit in one of the preallocated index | 338 * @return number of indices that fit in one of the preallocated index |
339 * buffers. | 339 * buffers. |
340 */ | 340 */ |
341 int preallocatedBufferIndices() const; | 341 int preallocatedBufferIndices() const; |
342 | 342 |
343 private: | 343 private: |
344 typedef GrBufferAllocPool INHERITED; | 344 typedef GrBufferAllocPool INHERITED; |
345 }; | 345 }; |
346 | 346 |
347 #endif | 347 #endif |
OLD | NEW |