| 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 GrTestBatch_DEFINED | 8 #ifndef GrTestBatch_DEFINED |
| 9 #define GrTestBatch_DEFINED | 9 #define GrTestBatch_DEFINED |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // setup batch properties | 43 // setup batch properties |
| 44 fBatch.fColorIgnored = init.fColorIgnored; | 44 fBatch.fColorIgnored = init.fColorIgnored; |
| 45 fBatch.fColor = this->geoData(0)->fColor; | 45 fBatch.fColor = this->geoData(0)->fColor; |
| 46 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; | 46 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; |
| 47 fBatch.fCoverageIgnored = init.fCoverageIgnored; | 47 fBatch.fCoverageIgnored = init.fCoverageIgnored; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { | 50 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { |
| 51 batchTarget->initDraw(fGeometryProcessor, pipeline); | 51 batchTarget->initDraw(fGeometryProcessor, pipeline); |
| 52 | 52 |
| 53 // TODO this is hacky, but the only way we have to initialize the GP is
to use the |
| 54 // GrPipelineInfo struct so we can generate the correct shader. Once we
have GrBatch |
| 55 // everywhere we can remove this nastiness |
| 56 GrPipelineInfo init; |
| 57 init.fColorIgnored = fBatch.fColorIgnored; |
| 58 init.fOverrideColor = GrColor_ILLEGAL; |
| 59 init.fCoverageIgnored = fBatch.fCoverageIgnored; |
| 60 init.fUsesLocalCoords = fBatch.fUsesLocalCoords; |
| 61 fGeometryProcessor->initBatchTracker(batchTarget->currentBatchTracker(),
init); |
| 62 |
| 53 this->onGenerateGeometry(batchTarget, pipeline); | 63 this->onGenerateGeometry(batchTarget, pipeline); |
| 54 } | 64 } |
| 55 | 65 |
| 56 protected: | 66 protected: |
| 57 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) { | 67 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) { |
| 58 fGeometryProcessor.reset(SkRef(gp)); | 68 fGeometryProcessor.reset(SkRef(gp)); |
| 59 | 69 |
| 60 this->setBounds(bounds); | 70 this->setBounds(bounds); |
| 61 } | 71 } |
| 62 | 72 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 77 bool fUsesLocalCoords; | 87 bool fUsesLocalCoords; |
| 78 bool fColorIgnored; | 88 bool fColorIgnored; |
| 79 bool fCoverageIgnored; | 89 bool fCoverageIgnored; |
| 80 }; | 90 }; |
| 81 | 91 |
| 82 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 92 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
| 83 BatchTracker fBatch; | 93 BatchTracker fBatch; |
| 84 }; | 94 }; |
| 85 | 95 |
| 86 #endif | 96 #endif |
| OLD | NEW |