OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrVertexBatch_DEFINED | 8 #ifndef GrVertexBatch_DEFINED |
9 #define GrVertexBatch_DEFINED | 9 #define GrVertexBatch_DEFINED |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 protected: | 29 protected: |
30 /** Helper for rendering instances using an instanced index index buffer. Th
is class creates the | 30 /** Helper for rendering instances using an instanced index index buffer. Th
is class creates the |
31 space for the vertices and flushes the draws to the batch target. */ | 31 space for the vertices and flushes the draws to the batch target. */ |
32 class InstancedHelper { | 32 class InstancedHelper { |
33 public: | 33 public: |
34 InstancedHelper() {} | 34 InstancedHelper() {} |
35 /** Returns the allocated storage for the vertices. The caller should po
pulate the before | 35 /** Returns the allocated storage for the vertices. The caller should po
pulate the before |
36 vertices before calling issueDraws(). */ | 36 vertices before calling issueDraws(). */ |
37 void* init(Target*, GrPrimitiveType, size_t vertexStride, | 37 void* init(Target*, GrPrimitiveType, size_t vertexStride, |
38 const GrIndexBuffer*, int verticesPerInstance, int indicesPer
Instance, | 38 const GrBuffer*, int verticesPerInstance, int indicesPerInsta
nce, |
39 int instancesToDraw); | 39 int instancesToDraw); |
40 | 40 |
41 /** Call after init() to issue draws to the batch target.*/ | 41 /** Call after init() to issue draws to the batch target.*/ |
42 void recordDraw(Target* target); | 42 void recordDraw(Target* target); |
43 private: | 43 private: |
44 GrMesh fMesh; | 44 GrMesh fMesh; |
45 }; | 45 }; |
46 | 46 |
47 static const int kVerticesPerQuad = 4; | 47 static const int kVerticesPerQuad = 4; |
48 static const int kIndicesPerQuad = 6; | 48 static const int kIndicesPerQuad = 6; |
(...skipping 28 matching lines...) Expand all Loading... |
77 | 77 |
78 // Array of DrawArray. There may be inline uploads between each DrawArray an
d each DrawArray | 78 // Array of DrawArray. There may be inline uploads between each DrawArray an
d each DrawArray |
79 // may use a different primitive processor. | 79 // may use a different primitive processor. |
80 typedef SkTLList<DrawArray, 4> DrawArrayList; | 80 typedef SkTLList<DrawArray, 4> DrawArrayList; |
81 DrawArrayList fDrawArrays; | 81 DrawArrayList fDrawArrays; |
82 | 82 |
83 typedef GrDrawBatch INHERITED; | 83 typedef GrDrawBatch INHERITED; |
84 }; | 84 }; |
85 | 85 |
86 #endif | 86 #endif |
OLD | NEW |