| 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 /** |
| 146 * Returns an index buffer that can be used to render quads. | 165 * Returns an index buffer that can be used to render quads. |
| 147 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. | 166 * Six indices per quad: 0, 1, 2, 0, 2, 3, etc. |
| 148 * The max number of quads can be queried using GrIndexBuffer::maxQuads(). | 167 * The max number of quads can be queried using GrIndexBuffer::maxQuads(). |
| 149 * Draw with kTriangles_GrPrimitiveType | 168 * Draw with kTriangles_GrPrimitiveType |
| 150 * @ return the quad index buffer | 169 * @ return the quad index buffer |
| 151 */ | 170 */ |
| 152 const GrIndexBuffer* getQuadIndexBuffer() const; | 171 const GrIndexBuffer* getQuadIndexBuffer() const; |
| 153 | 172 |
| 154 /** | 173 /** |
| 155 * Resolves MSAA. | 174 * Resolves MSAA. |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 // counts number of uses of vertex/index pool in the geometry stack | 528 // counts number of uses of vertex/index pool in the geometry stack |
| 510 int fVertexP
oolUseCnt; | 529 int fVertexP
oolUseCnt; |
| 511 int fIndexPo
olUseCnt; | 530 int fIndexPo
olUseCnt; |
| 512 // these are mutable so they can be created on-demand | 531 // these are mutable so they can be created on-demand |
| 513 mutable GrIndexBuffer* fQuadInd
exBuffer; | 532 mutable GrIndexBuffer* fQuadInd
exBuffer; |
| 514 | 533 |
| 515 typedef GrDrawTarget INHERITED; | 534 typedef GrDrawTarget INHERITED; |
| 516 }; | 535 }; |
| 517 | 536 |
| 518 #endif | 537 #endif |
| OLD | NEW |