| 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 #ifndef GrDrawAtlasBatch_DEFINED | 8 #ifndef GrDrawAtlasBatch_DEFINED |
| 9 #define GrDrawAtlasBatch_DEFINED | 9 #define GrDrawAtlasBatch_DEFINED |
| 10 | 10 |
| 11 #include "GrBatch.h" | 11 #include "GrBatch.h" |
| 12 #include "GrColor.h" | 12 #include "GrColor.h" |
| 13 #include "GrDefaultGeoProcFactory.h" | 13 #include "GrDefaultGeoProcFactory.h" |
| 14 | 14 |
| 15 class GrDrawAtlasBatch : public GrBatch { | 15 class GrDrawAtlasBatch : public GrVertexBatch { |
| 16 public: | 16 public: |
| 17 struct Geometry { | 17 struct Geometry { |
| 18 GrColor fColor; | 18 GrColor fColor; |
| 19 SkTArray<uint8_t, true> fVerts; | 19 SkTArray<uint8_t, true> fVerts; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 static GrBatch* Create(const Geometry& geometry, const SkMatrix& viewMatrix,
int spriteCount, | 22 static GrDrawBatch* Create(const Geometry& geometry, const SkMatrix& viewMat
rix, |
| 23 const SkRSXform* xforms, const SkRect* rects, const S
kColor* colors) { | 23 int spriteCount, const SkRSXform* xforms, const S
kRect* rects, |
| 24 const SkColor* colors) { |
| 24 return SkNEW_ARGS(GrDrawAtlasBatch, (geometry, viewMatrix, spriteCount, | 25 return SkNEW_ARGS(GrDrawAtlasBatch, (geometry, viewMatrix, spriteCount, |
| 25 xforms, rects, colors)); | 26 xforms, rects, colors)); |
| 26 } | 27 } |
| 27 | 28 |
| 28 const char* name() const override { return "DrawAtlasBatch"; } | 29 const char* name() const override { return "DrawAtlasBatch"; } |
| 29 | 30 |
| 30 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 31 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 31 // When this is called on a batch, there is only one geometry bundle | 32 // When this is called on a batch, there is only one geometry bundle |
| 32 if (this->hasColors()) { | 33 if (this->hasColors()) { |
| 33 out->setUnknownFourComponents(); | 34 out->setUnknownFourComponents(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 61 | 62 |
| 62 SkMatrix fViewMatrix; | 63 SkMatrix fViewMatrix; |
| 63 GrColor fColor; | 64 GrColor fColor; |
| 64 int fQuadCount; | 65 int fQuadCount; |
| 65 bool fColorIgnored; | 66 bool fColorIgnored; |
| 66 bool fCoverageIgnored; | 67 bool fCoverageIgnored; |
| 67 bool fHasColors; | 68 bool fHasColors; |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 #endif | 71 #endif |
| OLD | NEW |