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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 init.fCoverageIgnored = fBatch.fCoverageIgnored; | 63 init.fCoverageIgnored = fBatch.fCoverageIgnored; |
64 init.fUsesLocalCoords = fBatch.fUsesLocalCoords; | 64 init.fUsesLocalCoords = fBatch.fUsesLocalCoords; |
65 fGeometryProcessor->initBatchTracker(batchTarget->currentBatchTracker(),
init); | 65 fGeometryProcessor->initBatchTracker(batchTarget->currentBatchTracker(),
init); |
66 | 66 |
67 this->onGenerateGeometry(batchTarget, pipeline); | 67 this->onGenerateGeometry(batchTarget, pipeline); |
68 } | 68 } |
69 | 69 |
70 protected: | 70 protected: |
71 GrTestBatch(const GrGeometryProcessor* gp) { | 71 GrTestBatch(const GrGeometryProcessor* gp) { |
72 fGeometryProcessor.reset(SkRef(gp)); | 72 fGeometryProcessor.reset(SkRef(gp)); |
| 73 |
| 74 this->setBoundsLargest(); |
73 } | 75 } |
74 | 76 |
75 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce
ssor; } | 77 const GrGeometryProcessor* geometryProcessor() const { return fGeometryProce
ssor; } |
76 | 78 |
77 private: | 79 private: |
78 virtual Geometry* geoData(int index) = 0; | 80 virtual Geometry* geoData(int index) = 0; |
79 | 81 |
80 bool onCombineIfPossible(GrBatch* t) override { | 82 bool onCombineIfPossible(GrBatch* t) override { |
81 return false; | 83 return false; |
82 } | 84 } |
83 | 85 |
84 virtual void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline
* pipeline) = 0; | 86 virtual void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline
* pipeline) = 0; |
85 | 87 |
86 struct BatchTracker { | 88 struct BatchTracker { |
87 GrColor fColor; | 89 GrColor fColor; |
88 bool fUsesLocalCoords; | 90 bool fUsesLocalCoords; |
89 bool fColorIgnored; | 91 bool fColorIgnored; |
90 bool fCoverageIgnored; | 92 bool fCoverageIgnored; |
91 }; | 93 }; |
92 | 94 |
93 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 95 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
94 BatchTracker fBatch; | 96 BatchTracker fBatch; |
95 }; | 97 }; |
96 | 98 |
97 #endif | 99 #endif |
OLD | NEW |