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

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

Issue 958433004: fix for msan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | src/gpu/GrBatchTarget.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
11 #include "GrBufferAllocPool.h"
11 #include "GrPendingProgramElement.h" 12 #include "GrPendingProgramElement.h"
12 #include "GrPipeline.h" 13 #include "GrPipeline.h"
13 #include "GrGpu.h" 14 #include "GrGpu.h"
14 #include "GrTRecorder.h" 15 #include "GrTRecorder.h"
15 16
16 /* 17 /*
17 * GrBatch instances use this object to allocate space for their geometry and to issue the draws 18 * GrBatch instances use this object to allocate space for their geometry and to issue the draws
18 * that render their batch. 19 * that render their batch.
19 */ 20 */
20 21
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return &fFlushBuffer.back().fBatchTracker; 76 return &fFlushBuffer.back().fBatchTracker;
76 } 77 }
77 78
78 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } 79 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); }
79 80
80 GrVertexBufferAllocPool* vertexPool() { return fVertexPool; } 81 GrVertexBufferAllocPool* vertexPool() { return fVertexPool; }
81 GrIndexBufferAllocPool* indexPool() { return fIndexPool; } 82 GrIndexBufferAllocPool* indexPool() { return fIndexPool; }
82 83
83 const GrIndexBuffer* quadIndexBuffer() const { return fGpu->getQuadIndexBuff er(); } 84 const GrIndexBuffer* quadIndexBuffer() const { return fGpu->getQuadIndexBuff er(); }
84 85
86 // A helper for draws which overallocate and then return data to the pool
87 void putBackIndices(size_t indices) {
bsalomon 2015/02/24 21:05:17 oneliners?
88 fIndexPool->putBack(indices * sizeof(uint16_t));
89 }
90
91 void putBackVertices(size_t vertices, size_t vertexStride) {
92 fVertexPool->putBack(vertices * vertexStride);
93 }
94
85 private: 95 private:
86 GrGpu* fGpu; 96 GrGpu* fGpu;
87 GrVertexBufferAllocPool* fVertexPool; 97 GrVertexBufferAllocPool* fVertexPool;
88 GrIndexBufferAllocPool* fIndexPool; 98 GrIndexBufferAllocPool* fIndexPool;
89 99
90 typedef void* TBufferAlign; // This wouldn't be enough align if a command us ed long double. 100 typedef void* TBufferAlign; // This wouldn't be enough align if a command us ed long double.
91 101
92 struct BufferedFlush { 102 struct BufferedFlush {
93 BufferedFlush(const GrPrimitiveProcessor* primProc, const GrPipeline* pi peline) 103 BufferedFlush(const GrPrimitiveProcessor* primProc, const GrPipeline* pi peline)
94 : fPrimitiveProcessor(primProc) 104 : fPrimitiveProcessor(primProc)
(...skipping 11 matching lines...) Expand all
106 116
107 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer; 117 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer;
108 118
109 FlushBuffer fFlushBuffer; 119 FlushBuffer fFlushBuffer;
110 // TODO this is temporary 120 // TODO this is temporary
111 FlushBuffer::Iter fIter; 121 FlushBuffer::Iter fIter;
112 int fNumberOfDraws; 122 int fNumberOfDraws;
113 }; 123 };
114 124
115 #endif 125 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrBatchTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698