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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 GrVertices fVertices; | 44 GrVertices fVertices; |
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; |
49 | 49 |
50 /** A specialization of InstanceHelper for quad rendering. */ | 50 /** A specialization of InstanceHelper for quad rendering. */ |
51 class QuadHelper : private InstancedHelper { | 51 class QuadHelper : private InstancedHelper { |
52 public: | 52 public: |
53 QuadHelper() : INHERITED() {} | 53 QuadHelper() : INHERITED() {} |
54 /** Finds the cached quad index buffer and reserves vertex space. Return
s NULL on failure | 54 /** Finds the cached quad index buffer and reserves vertex space. Return
s nullptr on failure |
55 and on sucess a pointer to the vertex data that the caller should po
pulate before | 55 and on sucess a pointer to the vertex data that the caller should po
pulate before |
56 calling issueDraws(). */ | 56 calling issueDraws(). */ |
57 void* init(Target* batchTarget, size_t vertexStride, int quadsToDraw); | 57 void* init(Target* batchTarget, size_t vertexStride, int quadsToDraw); |
58 | 58 |
59 using InstancedHelper::recordDraw; | 59 using InstancedHelper::recordDraw; |
60 private: | 60 private: |
61 typedef InstancedHelper INHERITED; | 61 typedef InstancedHelper INHERITED; |
62 }; | 62 }; |
63 | 63 |
64 private: | 64 private: |
(...skipping 14 matching lines...) Expand all Loading... |
79 // may use a different primitive processor. | 79 // may use a different primitive processor. |
80 SkTLList<DrawArray> fDrawArrays; | 80 SkTLList<DrawArray> fDrawArrays; |
81 | 81 |
82 // What is this? | 82 // What is this? |
83 GrBatchTracker fBatchTracker; | 83 GrBatchTracker fBatchTracker; |
84 | 84 |
85 typedef GrDrawBatch INHERITED; | 85 typedef GrDrawBatch INHERITED; |
86 }; | 86 }; |
87 | 87 |
88 #endif | 88 #endif |
OLD | NEW |