| 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 "GrGpu.h" | 10 #include "GrGpu.h" |
| 11 | 11 |
| 12 #include "GrBufferAllocPool.h" | 12 #include "GrBufferAllocPool.h" |
| 13 #include "GrContext.h" | 13 #include "GrContext.h" |
| 14 #include "GrDrawTargetCaps.h" |
| 14 #include "GrIndexBuffer.h" | 15 #include "GrIndexBuffer.h" |
| 15 #include "GrStencilBuffer.h" | 16 #include "GrStencilBuffer.h" |
| 16 #include "GrVertexBuffer.h" | 17 #include "GrVertexBuffer.h" |
| 17 | 18 |
| 18 // probably makes no sense for this to be less than a page | 19 // probably makes no sense for this to be less than a page |
| 19 static const size_t VERTEX_POOL_VB_SIZE = 1 << 18; | 20 static const size_t VERTEX_POOL_VB_SIZE = 1 << 18; |
| 20 static const int VERTEX_POOL_VB_COUNT = 4; | 21 static const int VERTEX_POOL_VB_COUNT = 4; |
| 21 static const size_t INDEX_POOL_IB_SIZE = 1 << 16; | 22 static const size_t INDEX_POOL_IB_SIZE = 1 << 16; |
| 22 static const int INDEX_POOL_IB_COUNT = 4; | 23 static const int INDEX_POOL_IB_COUNT = 4; |
| 23 | 24 |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 } | 524 } |
| 524 | 525 |
| 525 void GrGpu::releaseIndexArray() { | 526 void GrGpu::releaseIndexArray() { |
| 526 // if index source was array, we stowed data in the pool | 527 // if index source was array, we stowed data in the pool |
| 527 const GeometrySrcState& geoSrc = this->getGeomSrc(); | 528 const GeometrySrcState& geoSrc = this->getGeomSrc(); |
| 528 GrAssert(kArray_GeometrySrcType == geoSrc.fIndexSrc); | 529 GrAssert(kArray_GeometrySrcType == geoSrc.fIndexSrc); |
| 529 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); | 530 size_t bytes = geoSrc.fIndexCount * sizeof(uint16_t); |
| 530 fIndexPool->putBack(bytes); | 531 fIndexPool->putBack(bytes); |
| 531 --fIndexPoolUseCnt; | 532 --fIndexPoolUseCnt; |
| 532 } | 533 } |
| OLD | NEW |