| 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 GrAAStrokeRectBatch_DEFINED | 8 #ifndef GrAAStrokeRectBatch_DEFINED |
| 9 #define GrAAStrokeRectBatch_DEFINED | 9 #define GrAAStrokeRectBatch_DEFINED |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 36 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 37 // When this is called on a batch, there is only one geometry bundle | 37 // When this is called on a batch, there is only one geometry bundle |
| 38 out->setKnownFourComponents(fGeoData[0].fColor); | 38 out->setKnownFourComponents(fGeoData[0].fColor); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 41 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 42 out->setUnknownSingleComponent(); | 42 out->setUnknownSingleComponent(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void initBatchTracker(const GrPipelineOptimizations&) override; | |
| 46 | |
| 47 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 45 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
| 48 | 46 |
| 49 private: | 47 private: |
| 50 void onPrepareDraws(Target*) override; | 48 void onPrepareDraws(Target*) override; |
| 49 void initBatchTracker(const GrPipelineOptimizations&) override; |
| 51 | 50 |
| 52 GrAAStrokeRectBatch(const Geometry& geometry, const SkMatrix& viewMatrix) { | 51 GrAAStrokeRectBatch(const Geometry& geometry, const SkMatrix& viewMatrix) { |
| 53 this->initClassID<GrAAStrokeRectBatch>(); | 52 this->initClassID<GrAAStrokeRectBatch>(); |
| 54 fBatch.fViewMatrix = viewMatrix; | 53 fBatch.fViewMatrix = viewMatrix; |
| 55 fGeoData.push_back(geometry); | 54 fGeoData.push_back(geometry); |
| 56 | 55 |
| 57 // If we have miterstroke then we inset devOutside and outset devOutside
Assist, so we need | 56 // If we have miterstroke then we inset devOutside and outset devOutside
Assist, so we need |
| 58 // the join for proper bounds | 57 // the join for proper bounds |
| 59 fBounds = geometry.fDevOutside; | 58 fBounds = geometry.fDevOutside; |
| 60 fBounds.join(geometry.fDevOutsideAssist); | 59 fBounds.join(geometry.fDevOutsideAssist); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 bool fMiterStroke; | 102 bool fMiterStroke; |
| 104 bool fCanTweakAlphaForCoverage; | 103 bool fCanTweakAlphaForCoverage; |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 BatchTracker fBatch; | 106 BatchTracker fBatch; |
| 108 SkSTArray<1, Geometry, true> fGeoData; | 107 SkSTArray<1, Geometry, true> fGeoData; |
| 109 }; | 108 }; |
| 110 | 109 |
| 111 | 110 |
| 112 #endif | 111 #endif |
| OLD | NEW |