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 opt.getOverrideColorIfSet(&this->geoData(0)->fColor); | 43 opt.getOverrideColorIfSet(&this->geoData(0)->fColor); |
44 | 44 |
45 // setup batch properties | 45 // setup batch properties |
46 fBatch.fColorIgnored = !opt.readsColor(); | 46 fBatch.fColorIgnored = !opt.readsColor(); |
47 fBatch.fColor = this->geoData(0)->fColor; | 47 fBatch.fColor = this->geoData(0)->fColor; |
48 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); | 48 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); |
49 fBatch.fCoverageIgnored = !opt.readsCoverage(); | 49 fBatch.fCoverageIgnored = !opt.readsCoverage(); |
50 } | 50 } |
51 | 51 |
52 protected: | 52 protected: |
53 GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) { | 53 GrTestBatch(uint32_t classID, const GrGeometryProcessor* gp, const SkRect& b
ounds) |
| 54 : INHERITED(classID) { |
54 fGeometryProcessor.reset(SkRef(gp)); | 55 fGeometryProcessor.reset(SkRef(gp)); |
55 | 56 |
56 this->setBounds(bounds); | 57 this->setBounds(bounds); |
57 } | 58 } |
58 | 59 |
59 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce
ssor; } | 60 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce
ssor; } |
60 | 61 |
61 private: | 62 private: |
62 void onPrepareDraws(Target* target) override { | 63 void onPrepareDraws(Target* target) override { |
63 target->initDraw(fGeometryProcessor, this->pipeline()); | 64 target->initDraw(fGeometryProcessor, this->pipeline()); |
(...skipping 11 matching lines...) Expand all Loading... |
75 | 76 |
76 struct BatchTracker { | 77 struct BatchTracker { |
77 GrColor fColor; | 78 GrColor fColor; |
78 bool fUsesLocalCoords; | 79 bool fUsesLocalCoords; |
79 bool fColorIgnored; | 80 bool fColorIgnored; |
80 bool fCoverageIgnored; | 81 bool fCoverageIgnored; |
81 }; | 82 }; |
82 | 83 |
83 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 84 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
84 BatchTracker fBatch; | 85 BatchTracker fBatch; |
| 86 |
| 87 typedef GrVertexBatch INHERITED; |
85 }; | 88 }; |
86 | 89 |
87 #endif | 90 #endif |
OLD | NEW |