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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 GrBatchTracker* currentBatchTracker() { | 73 GrBatchTracker* currentBatchTracker() { |
74 SkASSERT(!fFlushBuffer.empty()); | 74 SkASSERT(!fFlushBuffer.empty()); |
75 return &fFlushBuffer.back().fBatchTracker; | 75 return &fFlushBuffer.back().fBatchTracker; |
76 } | 76 } |
77 | 77 |
78 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } | 78 const GrDrawTargetCaps& caps() const { return *fGpu->caps(); } |
79 | 79 |
80 GrVertexBufferAllocPool* vertexPool() { return fVertexPool; } | 80 GrVertexBufferAllocPool* vertexPool() { return fVertexPool; } |
81 GrIndexBufferAllocPool* indexPool() { return fIndexPool; } | 81 GrIndexBufferAllocPool* indexPool() { return fIndexPool; } |
82 | 82 |
| 83 const GrIndexBuffer* quadIndexBuffer() const { return fGpu->getQuadIndexBuff
er(); } |
| 84 |
83 private: | 85 private: |
84 GrGpu* fGpu; | 86 GrGpu* fGpu; |
85 GrVertexBufferAllocPool* fVertexPool; | 87 GrVertexBufferAllocPool* fVertexPool; |
86 GrIndexBufferAllocPool* fIndexPool; | 88 GrIndexBufferAllocPool* fIndexPool; |
87 | 89 |
88 typedef void* TBufferAlign; // This wouldn't be enough align if a command us
ed long double. | 90 typedef void* TBufferAlign; // This wouldn't be enough align if a command us
ed long double. |
89 | 91 |
90 struct BufferedFlush { | 92 struct BufferedFlush { |
91 BufferedFlush(const GrPrimitiveProcessor* primProc, const GrPipeline* pi
peline) | 93 BufferedFlush(const GrPrimitiveProcessor* primProc, const GrPipeline* pi
peline) |
92 : fPrimitiveProcessor(primProc) | 94 : fPrimitiveProcessor(primProc) |
(...skipping 11 matching lines...) Expand all Loading... |
104 | 106 |
105 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer; | 107 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer; |
106 | 108 |
107 FlushBuffer fFlushBuffer; | 109 FlushBuffer fFlushBuffer; |
108 // TODO this is temporary | 110 // TODO this is temporary |
109 FlushBuffer::Iter fIter; | 111 FlushBuffer::Iter fIter; |
110 int fNumberOfDraws; | 112 int fNumberOfDraws; |
111 }; | 113 }; |
112 | 114 |
113 #endif | 115 #endif |
OLD | NEW |