Chromium Code Reviews| Index: src/gpu/batches/GrTInstanceBatch.h |
| diff --git a/src/gpu/batches/GrTInstanceBatch.h b/src/gpu/batches/GrTInstanceBatch.h |
| index 014ec125fe6ae894d2a1317839046298b79615bb..318595462a731b4fb30743a78a21578e0ba7d643 100644 |
| --- a/src/gpu/batches/GrTInstanceBatch.h |
| +++ b/src/gpu/batches/GrTInstanceBatch.h |
| @@ -26,6 +26,8 @@ |
| * |
| * void SetBounds(const Geometry& seedGeometry, SkRect* outBounds) |
| * |
|
robertphillips
2015/09/18 17:42:26
UpdateBoundsForAppend ?
joshualitt
2015/09/18 18:34:10
Acknowledged.
|
| + * void UpdateBounds(const Geometry& lastGeometry, SkRect* currentBounds) |
| + * |
| * bool CanCombine(const Geometry& mine, const Geometry& theirs, |
| * const GrPipelineOptimizations&) |
| * |
| @@ -64,21 +66,20 @@ public: |
| SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
| - // to avoid even the initial copy of the struct, we have a getter for the first item which |
| - // is used to seed the batch with its initial geometry. After seeding, the client should call |
| - // init() so the Batch can initialize itself |
| - Geometry* geometry() { return &fGeoData[0]; } |
| + // After seeding, the client should call init() so the Batch can initialize itself |
| void init() { |
| const Geometry& geo = fGeoData[0]; |
| Impl::SetBounds(geo, &fBounds); |
| } |
|
robertphillips
2015/09/18 17:42:26
updateBoundsAfterAppend ?
updateBoundsForAppend ?
joshualitt
2015/09/18 18:34:11
Acknowledged.
|
| -private: |
| - GrTInstanceBatch() : INHERITED(ClassID()) { |
| - // Push back an initial geometry |
| - fGeoData.push_back(); |
| + void updateBounds() { |
| + const Geometry& geo = fGeoData.back(); |
| + Impl::UpdateBounds(geo, &fBounds); |
| } |
| +private: |
| + GrTInstanceBatch() : INHERITED(ClassID()) {} |
| + |
| void onPrepareDraws(Target* target) override { |
| SkAutoTUnref<const GrGeometryProcessor> gp(Impl::CreateGP(this->seedGeometry(), fOpts)); |
| if (!gp) { |