| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrGpu_DEFINED | 8 #ifndef GrGpu_DEFINED |
| 9 #define GrGpu_DEFINED | 9 #define GrGpu_DEFINED |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 * @param size size in bytes of the index buffer | 136 * @param size size in bytes of the index buffer |
| 137 * @param dynamic hints whether the data will be frequently changed | 137 * @param dynamic hints whether the data will be frequently changed |
| 138 * by either GrIndexBuffer::map() or | 138 * by either GrIndexBuffer::map() or |
| 139 * GrIndexBuffer::updateData(). | 139 * GrIndexBuffer::updateData(). |
| 140 * | 140 * |
| 141 * @return The index buffer if successful, otherwise NULL. | 141 * @return The index buffer if successful, otherwise NULL. |
| 142 */ | 142 */ |
| 143 GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic); | 143 GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic); |
| 144 | 144 |
| 145 /** | 145 /** |
| 146 * Creates an index buffer for instance drawing with a specific pattern. | |
| 147 * | |
| 148 * @param pattern the pattern to repeat | |
| 149 * @param patternSize size in bytes of the pattern | |
| 150 * @param reps number of times to repeat the pattern | |
| 151 * @param vertCount number of vertices the pattern references | |
| 152 * @param dynamic hints whether the data will be frequently changed | |
| 153 * by either GrIndexBuffer::map() or | |
| 154 * GrIndexBuffer::updateData(). | |
| 155 * | |
| 156 * @return The index buffer if successful, otherwise NULL. | |
| 157 */ | |
| 158 GrIndexBuffer* createInstancedIndexBuffer(const uint16_t* pattern, | |
| 159 int patternSize, | |
| 160 int reps, | |
| 161 int vertCount, | |
| 162 bool isDynamic = false); | |
| 163 | |
| 164 /** | |
| 165 * Returns an index buffer that can be used to render quads. | 146 * Returns an index buffer that can be used to render quads. |
| 166 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. | 147 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. |
| 167 * The max number of quads can be queried using GrIndexBuffer::maxQuads(). | 148 * The max number of quads can be queried using GrIndexBuffer::maxQuads(). |
| 168 * Draw with kTriangles_GrPrimitiveType | 149 * Draw with kTriangles_GrPrimitiveType |
| 169 * @ return the quad index buffer | 150 * @ return the quad index buffer |
| 170 */ | 151 */ |
| 171 const GrIndexBuffer* getQuadIndexBuffer() const; | 152 const GrIndexBuffer* getQuadIndexBuffer() const; |
| 172 | 153 |
| 173 /** | 154 /** |
| 174 * Resolves MSAA. | 155 * Resolves MSAA. |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 // counts number of uses of vertex/index pool in the geometry stack | 509 // counts number of uses of vertex/index pool in the geometry stack |
| 529 int fVertexP
oolUseCnt; | 510 int fVertexP
oolUseCnt; |
| 530 int fIndexPo
olUseCnt; | 511 int fIndexPo
olUseCnt; |
| 531 // these are mutable so they can be created on-demand | 512 // these are mutable so they can be created on-demand |
| 532 mutable GrIndexBuffer* fQuadInd
exBuffer; | 513 mutable GrIndexBuffer* fQuadInd
exBuffer; |
| 533 | 514 |
| 534 typedef GrDrawTarget INHERITED; | 515 typedef GrDrawTarget INHERITED; |
| 535 }; | 516 }; |
| 536 | 517 |
| 537 #endif | 518 #endif |
| OLD | NEW |