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 // TODO This goes away when everything uses batch | |
108 GrBatchTracker* currentBatchTracker() { | |
109 SkASSERT(!fFlushBuffer.empty()); | |
110 return &fFlushBuffer.back().fBatchTracker; | |
111 } | |
112 | |
113 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } | 107 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } |
114 | 108 |
115 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re
sourceProvider(); } | 109 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re
sourceProvider(); } |
116 | 110 |
117 void* makeVertSpace(size_t vertexSize, int vertexCount, | 111 void* makeVertSpace(size_t vertexSize, int vertexCount, |
118 const GrVertexBuffer** buffer, int* startVertex); | 112 const GrVertexBuffer** buffer, int* startVertex); |
119 uint16_t* makeIndexSpace(int indexCount, | 113 uint16_t* makeIndexSpace(int indexCount, |
120 const GrIndexBuffer** buffer, int* startIndex); | 114 const GrIndexBuffer** buffer, int* startIndex); |
121 | 115 |
122 // 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 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 FlushBuffer::Iter fIter; | 159 FlushBuffer::Iter fIter; |
166 int fNumberOfDraws; | 160 int fNumberOfDraws; |
167 BatchToken fCurrentToken; | 161 BatchToken fCurrentToken; |
168 BatchToken fLastFlushedToken; // The next token to be flushed | 162 BatchToken fLastFlushedToken; // The next token to be flushed |
169 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; | 163 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; |
170 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; | 164 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; |
171 int fInlineUpdatesIndex; | 165 int fInlineUpdatesIndex; |
172 }; | 166 }; |
173 | 167 |
174 #endif | 168 #endif |
OLD | NEW |