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(), | 93 SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeom
etry(), |
94 fOverrides)); | 94 fOverrides)); |
95 if (!gp) { | 95 if (!gp) { |
96 SkDebugf("Couldn't create GrGeometryProcessor\n"); | 96 SkDebugf("Couldn't create GrGeometryProcessor\n"); |
97 return; | 97 return; |
98 } | 98 } |
99 | 99 |
100 target->initDraw(gp, this->pipeline()); | 100 target->initDraw(gp, this->pipeline()); |
101 | 101 |
102 size_t vertexStride = gp->getVertexStride(); | 102 size_t vertexStride = gp->getVertexStride(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 return true; | 145 return true; |
146 } | 146 } |
147 | 147 |
148 GrXPOverridesForBatch fOverrides; | 148 GrXPOverridesForBatch fOverrides; |
149 SkSTArray<1, Geometry, true> fGeoData; | 149 SkSTArray<1, Geometry, true> fGeoData; |
150 | 150 |
151 typedef GrVertexBatch INHERITED; | 151 typedef GrVertexBatch INHERITED; |
152 }; | 152 }; |
153 | 153 |
154 #endif | 154 #endif |
OLD | NEW |