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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 | 83 |
84 void updateBoundsAfterAppend() { | 84 void updateBoundsAfterAppend() { |
85 const Geometry& geo = fGeoData.back(); | 85 const Geometry& geo = fGeoData.back(); |
86 Impl::UpdateBoundsAfterAppend(geo, &fBounds); | 86 Impl::UpdateBoundsAfterAppend(geo, &fBounds); |
87 } | 87 } |
88 | 88 |
89 private: | 89 private: |
90 GrTInstanceBatch() : INHERITED(ClassID()) {} | 90 GrTInstanceBatch() : INHERITED(ClassID()) {} |
91 | 91 |
92 void onPrepareDraws(Target* target) override { | 92 void onPrepareDraws(Target* target) const override { |
93 SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeom
etry(), fOpts)); | 93 SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeom
etry(), fOpts)); |
94 if (!gp) { | 94 if (!gp) { |
95 SkDebugf("Couldn't create GrGeometryProcessor\n"); | 95 SkDebugf("Couldn't create GrGeometryProcessor\n"); |
96 return; | 96 return; |
97 } | 97 } |
98 | 98 |
99 target->initDraw(gp, this->pipeline()); | 99 target->initDraw(gp, this->pipeline()); |
100 | 100 |
101 size_t vertexStride = gp->getVertexStride(); | 101 size_t vertexStride = gp->getVertexStride(); |
102 int instanceCount = fGeoData.count(); | 102 int instanceCount = fGeoData.count(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 GrPipelineOptimizations fOpts; | 147 GrPipelineOptimizations fOpts; |
148 SkSTArray<1, Geometry, true> fGeoData; | 148 SkSTArray<1, Geometry, true> fGeoData; |
149 | 149 |
150 typedef GrVertexBatch INHERITED; | 150 typedef GrVertexBatch INHERITED; |
151 }; | 151 }; |
152 | 152 |
153 #endif | 153 #endif |
OLD | NEW |