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 GrBatchBuffer_DEFINED | 8 #ifndef GrBatchBuffer_DEFINED |
9 #define GrBatchBuffer_DEFINED | 9 #define GrBatchBuffer_DEFINED |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 GrBatchTracker* currentBatchTracker() { | 114 GrBatchTracker* currentBatchTracker() { |
115 SkASSERT(!fFlushBuffer.empty()); | 115 SkASSERT(!fFlushBuffer.empty()); |
116 return &fFlushBuffer.back().fBatchTracker; | 116 return &fFlushBuffer.back().fBatchTracker; |
117 } | 117 } |
118 | 118 |
119 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } | 119 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } |
120 | 120 |
121 GrVertexBufferAllocPool* vertexPool() { return fVertexPool; } | 121 GrVertexBufferAllocPool* vertexPool() { return fVertexPool; } |
122 GrIndexBufferAllocPool* indexPool() { return fIndexPool; } | 122 GrIndexBufferAllocPool* indexPool() { return fIndexPool; } |
123 | 123 |
124 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re
sourceProvider(); } | 124 const static int kVertsPerRect = 4; |
| 125 const static int kIndicesPerRect = 6; |
| 126 const GrIndexBuffer* quadIndexBuffer() const { return fGpu->getQuadIndexBuff
er(); } |
125 | 127 |
126 // A helper for draws which overallocate and then return data to the pool | 128 // A helper for draws which overallocate and then return data to the pool |
127 void putBackIndices(size_t indices) { fIndexPool->putBack(indices * sizeof(u
int16_t)); } | 129 void putBackIndices(size_t indices) { fIndexPool->putBack(indices * sizeof(u
int16_t)); } |
128 | 130 |
129 void putBackVertices(size_t vertices, size_t vertexStride) { | 131 void putBackVertices(size_t vertices, size_t vertexStride) { |
130 fVertexPool->putBack(vertices * vertexStride); | 132 fVertexPool->putBack(vertices * vertexStride); |
131 } | 133 } |
132 | 134 |
133 private: | 135 private: |
134 GrGpu* fGpu; | 136 GrGpu* fGpu; |
(...skipping 24 matching lines...) Expand all Loading... |
159 FlushBuffer::Iter fIter; | 161 FlushBuffer::Iter fIter; |
160 int fNumberOfDraws; | 162 int fNumberOfDraws; |
161 BatchToken fCurrentToken; | 163 BatchToken fCurrentToken; |
162 BatchToken fLastFlushedToken; // The next token to be flushed | 164 BatchToken fLastFlushedToken; // The next token to be flushed |
163 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; | 165 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; |
164 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; | 166 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; |
165 int fInlineUpdatesIndex; | 167 int fInlineUpdatesIndex; |
166 }; | 168 }; |
167 | 169 |
168 #endif | 170 #endif |
OLD | NEW |