| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 int numberOfDraws() const { return fNumberOfDraws; } | 49 int numberOfDraws() const { return fNumberOfDraws; } |
| 50 void preFlush() { fIter = FlushBuffer::Iter(fFlushBuffer); } | 50 void preFlush() { fIter = FlushBuffer::Iter(fFlushBuffer); } |
| 51 void flushNext(int n) { | 51 void flushNext(int n) { |
| 52 for (; n > 0; n--) { | 52 for (; n > 0; n--) { |
| 53 SkDEBUGCODE(bool verify =) fIter.next(); | 53 SkDEBUGCODE(bool verify =) fIter.next(); |
| 54 SkASSERT(verify); | 54 SkASSERT(verify); |
| 55 GrProgramDesc desc; | 55 GrProgramDesc desc; |
| 56 BufferedFlush* bf = fIter.get(); | 56 BufferedFlush* bf = fIter.get(); |
| 57 const GrPipeline* pipeline = bf->fPipeline; | 57 const GrPipeline* pipeline = bf->fPipeline; |
| 58 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get()
; | 58 const GrPrimitiveProcessor* primProc = bf->fPrimitiveProcessor.get()
; |
| 59 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, pipeline->descIn
fo(), | 59 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, bf->fBatchTracke
r); |
| 60 bf->fBatchTracker); | |
| 61 | 60 |
| 62 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); | 61 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); |
| 63 | 62 |
| 64 int drawCount = bf->fDraws.count(); | 63 int drawCount = bf->fDraws.count(); |
| 65 const SkSTArray<1, DrawInfo, true>& draws = bf->fDraws; | 64 const SkSTArray<1, DrawInfo, true>& draws = bf->fDraws; |
| 66 for (int i = 0; i < drawCount; i++) { | 65 for (int i = 0; i < drawCount; i++) { |
| 67 fGpu->draw(args, draws[i]); | 66 fGpu->draw(args, draws[i]); |
| 68 } | 67 } |
| 69 } | 68 } |
| 70 } | 69 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 104 |
| 106 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer; | 105 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer; |
| 107 | 106 |
| 108 FlushBuffer fFlushBuffer; | 107 FlushBuffer fFlushBuffer; |
| 109 // TODO this is temporary | 108 // TODO this is temporary |
| 110 FlushBuffer::Iter fIter; | 109 FlushBuffer::Iter fIter; |
| 111 int fNumberOfDraws; | 110 int fNumberOfDraws; |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 #endif | 113 #endif |
| OLD | NEW |