| 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 "GrDrawAtlasBatch.h" | 8 #include "GrDrawAtlasBatch.h" |
| 9 #include "GrBatchFlushState.h" | 9 #include "GrBatchFlushState.h" |
| 10 #include "GrBatchTest.h" | 10 #include "GrBatchTest.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 size_t allocSize = args.fVerts.count(); | 71 size_t allocSize = args.fVerts.count(); |
| 72 memcpy(vertPtr, args.fVerts.begin(), allocSize); | 72 memcpy(vertPtr, args.fVerts.begin(), allocSize); |
| 73 vertPtr += allocSize; | 73 vertPtr += allocSize; |
| 74 } | 74 } |
| 75 helper.recordDraw(target); | 75 helper.recordDraw(target); |
| 76 } | 76 } |
| 77 | 77 |
| 78 GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie
wMatrix, | 78 GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie
wMatrix, |
| 79 int spriteCount, const SkRSXform* xforms, con
st SkRect* rects, | 79 int spriteCount, const SkRSXform* xforms, con
st SkRect* rects, |
| 80 const SkColor* colors) { | 80 const SkColor* colors) |
| 81 this->initClassID<GrDrawAtlasBatch>(); | 81 : INHERITED(ClassID()) { |
| 82 SkASSERT(xforms); | 82 SkASSERT(xforms); |
| 83 SkASSERT(rects); | 83 SkASSERT(rects); |
| 84 | 84 |
| 85 fViewMatrix = viewMatrix; | 85 fViewMatrix = viewMatrix; |
| 86 Geometry& installedGeo = fGeoData.push_back(geometry); | 86 Geometry& installedGeo = fGeoData.push_back(geometry); |
| 87 | 87 |
| 88 // Figure out stride and offsets | 88 // Figure out stride and offsets |
| 89 // Order within the vertex is: position [color] texCoord | 89 // Order within the vertex is: position [color] texCoord |
| 90 size_t texOffset = sizeof(SkPoint); | 90 size_t texOffset = sizeof(SkPoint); |
| 91 size_t vertexStride = 2*sizeof(SkPoint); | 91 size_t vertexStride = 2*sizeof(SkPoint); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 250 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 251 | 251 |
| 252 GrDrawAtlasBatch::Geometry geometry; | 252 GrDrawAtlasBatch::Geometry geometry; |
| 253 geometry.fColor = GrRandomColor(random); | 253 geometry.fColor = GrRandomColor(random); |
| 254 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be
gin(), | 254 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be
gin(), |
| 255 texRects.begin(), hasColors ? colors.begin()
: nullptr); | 255 texRects.begin(), hasColors ? colors.begin()
: nullptr); |
| 256 } | 256 } |
| 257 | 257 |
| 258 #endif | 258 #endif |
| OLD | NEW |