| 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 24 matching lines...) Expand all Loading... |
| 35 * const GrIndexBuffer* GetIndexBuffer(GrResourceProvider*) | 35 * const GrIndexBuffer* GetIndexBuffer(GrResourceProvider*) |
| 36 * | 36 * |
| 37 * Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo, | 37 * Tesselate(intptr_t vertices, size_t vertexStride, const Geometry& geo, |
| 38 * const GrPipelineOptimizations& opts) | 38 * const GrPipelineOptimizations& opts) |
| 39 */ | 39 */ |
| 40 template <typename Impl> | 40 template <typename Impl> |
| 41 class GrTInstanceBatch : public GrVertexBatch { | 41 class GrTInstanceBatch : public GrVertexBatch { |
| 42 public: | 42 public: |
| 43 typedef typename Impl::Geometry Geometry; | 43 typedef typename Impl::Geometry Geometry; |
| 44 | 44 |
| 45 BATCH_CLASS_ID |
| 46 |
| 45 static GrTInstanceBatch* Create() { return new GrTInstanceBatch; } | 47 static GrTInstanceBatch* Create() { return new GrTInstanceBatch; } |
| 46 | 48 |
| 47 const char* name() const override { return Impl::Name(); } | 49 const char* name() const override { return Impl::Name(); } |
| 48 | 50 |
| 49 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 51 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 50 // When this is called on a batch, there is only one geometry bundle | 52 // When this is called on a batch, there is only one geometry bundle |
| 51 out->setKnownFourComponents(fGeoData[0].fColor); | 53 out->setKnownFourComponents(fGeoData[0].fColor); |
| 52 } | 54 } |
| 53 | 55 |
| 54 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 56 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin())
; | 134 fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin())
; |
| 133 this->joinBounds(that->bounds()); | 135 this->joinBounds(that->bounds()); |
| 134 return true; | 136 return true; |
| 135 } | 137 } |
| 136 | 138 |
| 137 GrPipelineOptimizations fOpts; | 139 GrPipelineOptimizations fOpts; |
| 138 SkSTArray<1, Geometry, true> fGeoData; | 140 SkSTArray<1, Geometry, true> fGeoData; |
| 139 }; | 141 }; |
| 140 | 142 |
| 141 #endif | 143 #endif |
| OLD | NEW |