OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 }; | 220 }; |
221 | 221 |
222 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage, | 222 static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage, |
223 const SkMatrix& viewMatrix, bool isHairline, | 223 const SkMatrix& viewMatrix, bool isHairline, |
224 const SkRect& devBounds) { | 224 const SkRect& devBounds) { |
225 return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline,
devBounds); | 225 return new DefaultPathBatch(geometry, coverage, viewMatrix, isHairline,
devBounds); |
226 } | 226 } |
227 | 227 |
228 const char* name() const override { return "DefaultPathBatch"; } | 228 const char* name() const override { return "DefaultPathBatch"; } |
229 | 229 |
230 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 230 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant
Output* coverage, |
| 231 bool* usePLSDstRead) const { |
231 // When this is called on a batch, there is only one geometry bundle | 232 // When this is called on a batch, there is only one geometry bundle |
232 out->setKnownFourComponents(fGeoData[0].fColor); | 233 color->setKnownFourComponents(fGeoData[0].fColor); |
233 } | 234 coverage->setKnownSingleComponent(this->coverage()); |
234 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 235 *usePLSDstRead = false; |
235 out->setKnownSingleComponent(this->coverage()); | |
236 } | 236 } |
237 | 237 |
238 private: | 238 private: |
239 void initBatchTracker(const GrPipelineOptimizations& opt) override { | 239 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
240 // Handle any color overrides | 240 // Handle any color overrides |
241 if (!opt.readsColor()) { | 241 if (!opt.readsColor()) { |
242 fGeoData[0].fColor = GrColor_ILLEGAL; | 242 fGeoData[0].fColor = GrColor_ILLEGAL; |
243 } | 243 } |
244 opt.getOverrideColorIfSet(&fGeoData[0].fColor); | 244 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
245 | 245 |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 geometry.fColor = color; | 762 geometry.fColor = color; |
763 geometry.fPath = path; | 763 geometry.fPath = path; |
764 geometry.fTolerance = srcSpaceTol; | 764 geometry.fTolerance = srcSpaceTol; |
765 | 765 |
766 viewMatrix.mapRect(&bounds); | 766 viewMatrix.mapRect(&bounds); |
767 uint8_t coverage = GrRandomCoverage(random); | 767 uint8_t coverage = GrRandomCoverage(random); |
768 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 768 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
769 } | 769 } |
770 | 770 |
771 #endif | 771 #endif |
OLD | NEW |