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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 Color gpColor(color); | 44 Color gpColor(color); |
45 if (hasColors) { | 45 if (hasColors) { |
46 gpColor.fType = Color::kAttribute_Type; | 46 gpColor.fType = Color::kAttribute_Type; |
47 } | 47 } |
48 | 48 |
49 Coverage coverage(coverageIgnored ? Coverage::kNone_Type : Coverage::kSolid_
Type); | 49 Coverage coverage(coverageIgnored ? Coverage::kNone_Type : Coverage::kSolid_
Type); |
50 LocalCoords localCoords(LocalCoords::kHasExplicit_Type); | 50 LocalCoords localCoords(LocalCoords::kHasExplicit_Type); |
51 return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewM
atrix); | 51 return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewM
atrix); |
52 } | 52 } |
53 | 53 |
54 void GrDrawAtlasBatch::onPrepareDraws(Target* target) { | 54 void GrDrawAtlasBatch::onPrepareDraws(Target* target) const { |
55 // Setup geometry processor | 55 // Setup geometry processor |
56 SkAutoTUnref<const GrGeometryProcessor> gp(set_vertex_attributes(this->hasCo
lors(), | 56 SkAutoTUnref<const GrGeometryProcessor> gp(set_vertex_attributes(this->hasCo
lors(), |
57 this->color
(), | 57 this->color
(), |
58 this->viewM
atrix(), | 58 this->viewM
atrix(), |
59 this->cover
ageIgnored())); | 59 this->cover
ageIgnored())); |
60 | 60 |
61 target->initDraw(gp, this->pipeline()); | 61 target->initDraw(gp, this->pipeline()); |
62 | 62 |
63 int instanceCount = fGeoData.count(); | 63 int instanceCount = fGeoData.count(); |
64 size_t vertexStride = gp->getVertexStride(); | 64 size_t vertexStride = gp->getVertexStride(); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 259 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
260 | 260 |
261 GrDrawAtlasBatch::Geometry geometry; | 261 GrDrawAtlasBatch::Geometry geometry; |
262 geometry.fColor = GrRandomColor(random); | 262 geometry.fColor = GrRandomColor(random); |
263 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be
gin(), | 263 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be
gin(), |
264 texRects.begin(), hasColors ? colors.begin()
: nullptr); | 264 texRects.begin(), hasColors ? colors.begin()
: nullptr); |
265 } | 265 } |
266 | 266 |
267 #endif | 267 #endif |
OLD | NEW |