| 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 "GrDrawVerticesBatch.h" | 8 #include "GrDrawVerticesBatch.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 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 : INHERITED(ClassID()) { | 49 this->initClassID<GrDrawVerticesBatch>(); |
| 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 Loading... |
| 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 |
| OLD | NEW |