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 const static int kVertsPerRect = 4; | 124 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re
sourceProvider(); } |
125 const static int kIndicesPerRect = 6; | |
126 const GrIndexBuffer* quadIndexBuffer() const { return fGpu->getQuadIndexBuff
er(); } | |
127 | 125 |
128 // A helper for draws which overallocate and then return data to the pool | 126 // A helper for draws which overallocate and then return data to the pool |
129 void putBackIndices(size_t indices) { fIndexPool->putBack(indices * sizeof(u
int16_t)); } | 127 void putBackIndices(size_t indices) { fIndexPool->putBack(indices * sizeof(u
int16_t)); } |
130 | 128 |
131 void putBackVertices(size_t vertices, size_t vertexStride) { | 129 void putBackVertices(size_t vertices, size_t vertexStride) { |
132 fVertexPool->putBack(vertices * vertexStride); | 130 fVertexPool->putBack(vertices * vertexStride); |
133 } | 131 } |
134 | 132 |
135 private: | 133 private: |
136 GrGpu* fGpu; | 134 GrGpu* fGpu; |
(...skipping 24 matching lines...) Expand all Loading... |
161 FlushBuffer::Iter fIter; | 159 FlushBuffer::Iter fIter; |
162 int fNumberOfDraws; | 160 int fNumberOfDraws; |
163 BatchToken fCurrentToken; | 161 BatchToken fCurrentToken; |
164 BatchToken fLastFlushedToken; // The next token to be flushed | 162 BatchToken fLastFlushedToken; // The next token to be flushed |
165 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; | 163 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; |
166 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; | 164 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; |
167 int fInlineUpdatesIndex; | 165 int fInlineUpdatesIndex; |
168 }; | 166 }; |
169 | 167 |
170 #endif | 168 #endif |
OLD | NEW |