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

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

Issue 1126613003: Revert of Move instanced index buffer creation to flush time (Closed) Base URL: https://skia.googlesource.com/skia.git@master
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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