| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 : INHERITED(classID) { | 53 : INHERITED(classID) { |
| 54 fGeometryProcessor.reset(SkRef(gp)); | 54 fGeometryProcessor.reset(SkRef(gp)); |
| 55 | 55 |
| 56 this->setBounds(bounds); | 56 this->setBounds(bounds); |
| 57 } | 57 } |
| 58 | 58 |
| 59 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce
ssor; } | 59 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce
ssor; } |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 void onPrepareDraws(Target* target) const override { | 62 void onPrepareDraws(Target* target) const override { |
| 63 target->initDraw(fGeometryProcessor, this->pipeline()); | 63 target->initDraw(fGeometryProcessor); |
| 64 this->generateGeometry(target); | 64 this->generateGeometry(target); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual Geometry* geoData(int index) = 0; | 67 virtual Geometry* geoData(int index) = 0; |
| 68 virtual const Geometry* geoData(int index) const = 0; | 68 virtual const Geometry* geoData(int index) const = 0; |
| 69 | 69 |
| 70 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override { | 70 bool onCombineIfPossible(GrBatch* t, const GrCaps&) override { |
| 71 return false; | 71 return false; |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual void generateGeometry(Target*) const = 0; | 74 virtual void generateGeometry(Target*) const = 0; |
| 75 | 75 |
| 76 struct BatchTracker { | 76 struct BatchTracker { |
| 77 GrColor fColor; | 77 GrColor fColor; |
| 78 bool fUsesLocalCoords; | 78 bool fUsesLocalCoords; |
| 79 bool fColorIgnored; | 79 bool fColorIgnored; |
| 80 bool fCoverageIgnored; | 80 bool fCoverageIgnored; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 83 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
| 84 BatchTracker fBatch; | 84 BatchTracker fBatch; |
| 85 | 85 |
| 86 typedef GrVertexBatch INHERITED; | 86 typedef GrVertexBatch INHERITED; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 #endif | 89 #endif |
| OLD | NEW |