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 #include "GrVertexBatch.h" | 8 #include "GrVertexBatch.h" |
9 #include "GrBatchFlushState.h" | 9 #include "GrBatchFlushState.h" |
10 #include "GrResourceProvider.h" | 10 #include "GrResourceProvider.h" |
11 | 11 |
12 GrVertexBatch::GrVertexBatch(uint32_t classID) : INHERITED(classID), fDrawArrays
(1) {} | 12 GrVertexBatch::GrVertexBatch() : fDrawArrays(1) {} |
13 | 13 |
14 void GrVertexBatch::onPrepare(GrBatchFlushState* state) { | 14 void GrVertexBatch::onPrepare(GrBatchFlushState* state) { |
15 Target target(state, this); | 15 Target target(state, this); |
16 this->onPrepareDraws(&target); | 16 this->onPrepareDraws(&target); |
17 } | 17 } |
18 | 18 |
19 void* GrVertexBatch::InstancedHelper::init(Target* target, GrPrimitiveType primT
ype, | 19 void* GrVertexBatch::InstancedHelper::init(Target* target, GrPrimitiveType primT
ype, |
20 size_t vertexStride, const GrIndexBuf
fer* indexBuffer, | 20 size_t vertexStride, const GrIndexBuf
fer* indexBuffer, |
21 int verticesPerInstance, int indicesP
erInstance, | 21 int verticesPerInstance, int indicesP
erInstance, |
22 int instancesToDraw) { | 22 int instancesToDraw) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const GrPrimitiveProcessor* primProc = drawArray.fPrimitiveProcessor.get
(); | 77 const GrPrimitiveProcessor* primProc = drawArray.fPrimitiveProcessor.get
(); |
78 state->gpu()->buildProgramDesc(&desc, *primProc, *pipeline); | 78 state->gpu()->buildProgramDesc(&desc, *primProc, *pipeline); |
79 GrGpu::DrawArgs args(primProc, pipeline, &desc); | 79 GrGpu::DrawArgs args(primProc, pipeline, &desc); |
80 | 80 |
81 int drawCount = drawArray.fDraws.count(); | 81 int drawCount = drawArray.fDraws.count(); |
82 for (int i = 0; i < drawCount; i++) { | 82 for (int i = 0; i < drawCount; i++) { |
83 state->gpu()->draw(args, drawArray.fDraws[i]); | 83 state->gpu()->draw(args, drawArray.fDraws[i]); |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |
OLD | NEW |