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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 fIter = FlushBuffer::Iter(fFlushBuffer); | 97 fIter = FlushBuffer::Iter(fFlushBuffer); |
98 } | 98 } |
99 void flushNext(int n); | 99 void flushNext(int n); |
100 void postFlush() { | 100 void postFlush() { |
101 SkASSERT(!fIter.next()); | 101 SkASSERT(!fIter.next()); |
102 fFlushBuffer.reset(); | 102 fFlushBuffer.reset(); |
103 fAsapUploads.reset(); | 103 fAsapUploads.reset(); |
104 fInlineUploads.reset(); | 104 fInlineUploads.reset(); |
105 } | 105 } |
106 | 106 |
107 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } | 107 const GrCaps& caps() const { return *fGpu->caps(); } |
108 | 108 |
109 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re
sourceProvider(); } | 109 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re
sourceProvider(); } |
110 | 110 |
111 void* makeVertSpace(size_t vertexSize, int vertexCount, | 111 void* makeVertSpace(size_t vertexSize, int vertexCount, |
112 const GrVertexBuffer** buffer, int* startVertex); | 112 const GrVertexBuffer** buffer, int* startVertex); |
113 uint16_t* makeIndexSpace(int indexCount, | 113 uint16_t* makeIndexSpace(int indexCount, |
114 const GrIndexBuffer** buffer, int* startIndex); | 114 const GrIndexBuffer** buffer, int* startIndex); |
115 | 115 |
116 // A helper for draws which overallocate and then return data to the pool | 116 // A helper for draws which overallocate and then return data to the pool |
117 void putBackIndices(size_t indices) { fIndexPool->putBack(indices * sizeof(u
int16_t)); } | 117 void putBackIndices(size_t indices) { fIndexPool->putBack(indices * sizeof(u
int16_t)); } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 FlushBuffer::Iter fIter; | 159 FlushBuffer::Iter fIter; |
160 int fNumberOfDraws; | 160 int fNumberOfDraws; |
161 BatchToken fCurrentToken; | 161 BatchToken fCurrentToken; |
162 BatchToken fLastFlushedToken; // The next token to be flushed | 162 BatchToken fLastFlushedToken; // The next token to be flushed |
163 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; | 163 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; |
164 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; | 164 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; |
165 int fInlineUpdatesIndex; | 165 int fInlineUpdatesIndex; |
166 }; | 166 }; |
167 | 167 |
168 #endif | 168 #endif |
OLD | NEW |