| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "GrBufferAllocPool.h" | 10 #include "GrBufferAllocPool.h" |
| 11 #include "GrTypes.h" | 11 #include "GrTypes.h" |
| 12 #include "GrVertexBuffer.h" | 12 #include "GrVertexBuffer.h" |
| 13 #include "GrIndexBuffer.h" | 13 #include "GrIndexBuffer.h" |
| 14 #include "GrGpu.h" | 14 #include "GrGpu.h" |
| 15 | 15 |
| 16 #if GR_DEBUG | 16 #if GR_DEBUG |
| 17 #define VALIDATE validate | 17 #define VALIDATE validate |
| 18 #else | 18 #else |
| 19 static void VALIDATE(bool x = false) {} | 19 static void VALIDATE(bool = false) {} |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 // page size | 22 // page size |
| 23 #define GrBufferAllocPool_MIN_BLOCK_SIZE ((size_t)1 << 12) | 23 #define GrBufferAllocPool_MIN_BLOCK_SIZE ((size_t)1 << 12) |
| 24 | 24 |
| 25 GrBufferAllocPool::GrBufferAllocPool(GrGpu* gpu, | 25 GrBufferAllocPool::GrBufferAllocPool(GrGpu* gpu, |
| 26 BufferType bufferType, | 26 BufferType bufferType, |
| 27 bool frequentResetHint, | 27 bool frequentResetHint, |
| 28 size_t blockSize, | 28 size_t blockSize, |
| 29 int preallocBufferCnt) : | 29 int preallocBufferCnt) : |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 } | 478 } |
| 479 } | 479 } |
| 480 | 480 |
| 481 int GrIndexBufferAllocPool::preallocatedBufferIndices() const { | 481 int GrIndexBufferAllocPool::preallocatedBufferIndices() const { |
| 482 return INHERITED::preallocatedBufferSize() / sizeof(uint16_t); | 482 return INHERITED::preallocatedBufferSize() / sizeof(uint16_t); |
| 483 } | 483 } |
| 484 | 484 |
| 485 int GrIndexBufferAllocPool::currentBufferIndices() const { | 485 int GrIndexBufferAllocPool::currentBufferIndices() const { |
| 486 return currentBufferItems(sizeof(uint16_t)); | 486 return currentBufferItems(sizeof(uint16_t)); |
| 487 } | 487 } |
| OLD | NEW |