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, bf->fBatchTracke
r); | 59 fGpu->buildProgramDesc(&desc, *primProc, *pipeline, pipeline->descIn
fo(), |
| 60 bf->fBatchTracker); |
60 | 61 |
61 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); | 62 GrGpu::DrawArgs args(primProc, pipeline, &desc, &bf->fBatchTracker); |
62 | 63 |
63 int drawCount = bf->fDraws.count(); | 64 int drawCount = bf->fDraws.count(); |
64 const SkSTArray<1, DrawInfo, true>& draws = bf->fDraws; | 65 const SkSTArray<1, DrawInfo, true>& draws = bf->fDraws; |
65 for (int i = 0; i < drawCount; i++) { | 66 for (int i = 0; i < drawCount; i++) { |
66 fGpu->draw(args, draws[i]); | 67 fGpu->draw(args, draws[i]); |
67 } | 68 } |
68 } | 69 } |
69 } | 70 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer; | 106 typedef GrTRecorder<BufferedFlush, TBufferAlign> FlushBuffer; |
106 | 107 |
107 FlushBuffer fFlushBuffer; | 108 FlushBuffer fFlushBuffer; |
108 // TODO this is temporary | 109 // TODO this is temporary |
109 FlushBuffer::Iter fIter; | 110 FlushBuffer::Iter fIter; |
110 int fNumberOfDraws; | 111 int fNumberOfDraws; |
111 }; | 112 }; |
112 | 113 |
113 #endif | 114 #endif |
OLD | NEW |