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

Side by Side Diff: src/gpu/batches/GrVertexBatch.cpp

Issue 1344373005: Reland of add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « src/gpu/batches/GrVertexBatch.h ('k') | src/gpu/effects/GrDashingEffect.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 #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() : fDrawArrays(1) {} 12 GrVertexBatch::GrVertexBatch(uint32_t classID) : INHERITED(classID), 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
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 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrVertexBatch.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698