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