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 GrTInstanceBatch_DEFINED | 8 #ifndef GrTInstanceBatch_DEFINED |
9 #define GrTInstanceBatch_DEFINED | 9 #define GrTInstanceBatch_DEFINED |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class GrTInstanceBatch : public GrVertexBatch { | 43 class GrTInstanceBatch : public GrVertexBatch { |
44 public: | 44 public: |
45 DEFINE_BATCH_CLASS_ID | 45 DEFINE_BATCH_CLASS_ID |
46 | 46 |
47 typedef typename Impl::Geometry Geometry; | 47 typedef typename Impl::Geometry Geometry; |
48 | 48 |
49 static GrTInstanceBatch* Create() { return new GrTInstanceBatch; } | 49 static GrTInstanceBatch* Create() { return new GrTInstanceBatch; } |
50 | 50 |
51 const char* name() const override { return Impl::Name(); } | 51 const char* name() const override { return Impl::Name(); } |
52 | 52 |
| 53 SkString dumpInfo() const override { |
| 54 SkString str; |
| 55 for (int i = 0; i < fGeoData.count(); ++i) { |
| 56 str.append(Impl::DumpInfo(fGeoData[i])); |
| 57 } |
| 58 str.append(INHERITED::dumpInfo()); |
| 59 return str; |
| 60 } |
| 61 |
53 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 62 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
54 // When this is called on a batch, there is only one geometry bundle | 63 // When this is called on a batch, there is only one geometry bundle |
55 out->setKnownFourComponents(fGeoData[0].fColor); | 64 out->setKnownFourComponents(fGeoData[0].fColor); |
56 } | 65 } |
57 | 66 |
58 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 67 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
59 Impl::InitInvariantOutputCoverage(out); | 68 Impl::InitInvariantOutputCoverage(out); |
60 } | 69 } |
61 | 70 |
62 void initBatchTracker(const GrPipelineOptimizations& opt) override { | 71 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return true; | 144 return true; |
136 } | 145 } |
137 | 146 |
138 GrPipelineOptimizations fOpts; | 147 GrPipelineOptimizations fOpts; |
139 SkSTArray<1, Geometry, true> fGeoData; | 148 SkSTArray<1, Geometry, true> fGeoData; |
140 | 149 |
141 typedef GrVertexBatch INHERITED; | 150 typedef GrVertexBatch INHERITED; |
142 }; | 151 }; |
143 | 152 |
144 #endif | 153 #endif |
OLD | NEW |