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

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

Issue 1116943004: Move instanced index buffer creation to flush time (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix missing assignment of keys to index buffers 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 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
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
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