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

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

Issue 1352813003: add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks 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/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrStencilPathBatch.h » ('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 "GrDrawVerticesBatch.h" 8 #include "GrDrawVerticesBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 27 matching lines...) Expand all
38 *colorOffset = sizeof(SkPoint); 38 *colorOffset = sizeof(SkPoint);
39 } 39 }
40 return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewM atrix); 40 return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewM atrix);
41 } 41 }
42 42
43 GrDrawVerticesBatch::GrDrawVerticesBatch(const Geometry& geometry, GrPrimitiveTy pe primitiveType, 43 GrDrawVerticesBatch::GrDrawVerticesBatch(const Geometry& geometry, GrPrimitiveTy pe primitiveType,
44 const SkMatrix& viewMatrix, 44 const SkMatrix& viewMatrix,
45 const SkPoint* positions, int vertexCou nt, 45 const SkPoint* positions, int vertexCou nt,
46 const uint16_t* indices, int indexCount , 46 const uint16_t* indices, int indexCount ,
47 const GrColor* colors, const SkPoint* l ocalCoords, 47 const GrColor* colors, const SkPoint* l ocalCoords,
48 const SkRect& bounds) { 48 const SkRect& bounds)
49 this->initClassID<GrDrawVerticesBatch>(); 49 : INHERITED(ClassID()) {
50 SkASSERT(positions); 50 SkASSERT(positions);
51 51
52 fBatch.fViewMatrix = viewMatrix; 52 fBatch.fViewMatrix = viewMatrix;
53 Geometry& installedGeo = fGeoData.push_back(geometry); 53 Geometry& installedGeo = fGeoData.push_back(geometry);
54 54
55 installedGeo.fPositions.append(vertexCount, positions); 55 installedGeo.fPositions.append(vertexCount, positions);
56 if (indices) { 56 if (indices) {
57 installedGeo.fIndices.append(indexCount, indices); 57 installedGeo.fIndices.append(indexCount, indices);
58 fBatch.fHasIndices = true; 58 fBatch.fHasIndices = true;
59 } else { 59 } else {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 geometry.fColor = GrRandomColor(random); 340 geometry.fColor = GrRandomColor(random);
341 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, 341 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix,
342 positions.begin(), vertexCount, 342 positions.begin(), vertexCount,
343 indices.begin(), hasIndices ? vertexCount : 0, 343 indices.begin(), hasIndices ? vertexCount : 0,
344 colors.begin(), 344 colors.begin(),
345 texCoords.begin(), 345 texCoords.begin(),
346 bounds); 346 bounds);
347 } 347 }
348 348
349 #endif 349 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrStencilPathBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698