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