Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: src/gpu/GrBatchTarget.h

Issue 1132323003: Revert of Preliminary attempt to remove batch tracker (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup5
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
107 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } 113 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); }
108 114
109 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re sourceProvider(); } 115 GrResourceProvider* resourceProvider() const { return fGpu->getContext()->re sourceProvider(); }
110 116
111 void* makeVertSpace(size_t vertexSize, int vertexCount, 117 void* makeVertSpace(size_t vertexSize, int vertexCount,
112 const GrVertexBuffer** buffer, int* startVertex); 118 const GrVertexBuffer** buffer, int* startVertex);
113 uint16_t* makeIndexSpace(int indexCount, 119 uint16_t* makeIndexSpace(int indexCount,
114 const GrIndexBuffer** buffer, int* startIndex); 120 const GrIndexBuffer** buffer, int* startIndex);
115 121
116 // A helper for draws which overallocate and then return data to the pool 122 // 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
159 FlushBuffer::Iter fIter; 165 FlushBuffer::Iter fIter;
160 int fNumberOfDraws; 166 int fNumberOfDraws;
161 BatchToken fCurrentToken; 167 BatchToken fCurrentToken;
162 BatchToken fLastFlushedToken; // The next token to be flushed 168 BatchToken fLastFlushedToken; // The next token to be flushed
163 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads; 169 SkTArray<SkAutoTUnref<Uploader>, true> fAsapUploads;
164 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads; 170 SkTArray<SkAutoTUnref<Uploader>, true> fInlineUploads;
165 int fInlineUpdatesIndex; 171 int fInlineUpdatesIndex;
166 }; 172 };
167 173
168 #endif 174 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698