| 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 "GrBatchTarget.h" | 10 #include "GrBatchTarget.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 const char* name() const override { return "DefaultPathBatch"; } | 229 const char* name() const override { return "DefaultPathBatch"; } |
| 230 | 230 |
| 231 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 231 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 232 // 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 |
| 233 out->setKnownFourComponents(fGeoData[0].fColor); | 233 out->setKnownFourComponents(fGeoData[0].fColor); |
| 234 } | 234 } |
| 235 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 235 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 236 out->setKnownSingleComponent(this->coverage()); | 236 out->setKnownSingleComponent(this->coverage()); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void initBatchTracker(const GrPipelineInfo& init) override { | 239 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
| 240 // Handle any color overrides | 240 // Handle any color overrides |
| 241 if (!init.readsColor()) { | 241 if (!opt.readsColor()) { |
| 242 fGeoData[0].fColor = GrColor_ILLEGAL; | 242 fGeoData[0].fColor = GrColor_ILLEGAL; |
| 243 } | 243 } |
| 244 init.getOverrideColorIfSet(&fGeoData[0].fColor); | 244 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
| 245 | 245 |
| 246 // setup batch properties | 246 // setup batch properties |
| 247 fBatch.fColorIgnored = !init.readsColor(); | 247 fBatch.fColorIgnored = !opt.readsColor(); |
| 248 fBatch.fColor = fGeoData[0].fColor; | 248 fBatch.fColor = fGeoData[0].fColor; |
| 249 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 249 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); |
| 250 fBatch.fCoverageIgnored = !init.readsCoverage(); | 250 fBatch.fCoverageIgnored = !opt.readsCoverage(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void generateGeometry(GrBatchTarget* batchTarget) override { | 253 void generateGeometry(GrBatchTarget* batchTarget) override { |
| 254 SkAutoTUnref<const GrGeometryProcessor> gp; | 254 SkAutoTUnref<const GrGeometryProcessor> gp; |
| 255 { | 255 { |
| 256 using namespace GrDefaultGeoProcFactory; | 256 using namespace GrDefaultGeoProcFactory; |
| 257 Color color(this->color()); | 257 Color color(this->color()); |
| 258 Coverage coverage(this->coverage()); | 258 Coverage coverage(this->coverage()); |
| 259 if (this->coverageIgnored()) { | 259 if (this->coverageIgnored()) { |
| 260 coverage.fType = Coverage::kNone_Type; | 260 coverage.fType = Coverage::kNone_Type; |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 geometry.fColor = color; | 754 geometry.fColor = color; |
| 755 geometry.fPath = path; | 755 geometry.fPath = path; |
| 756 geometry.fTolerance = srcSpaceTol; | 756 geometry.fTolerance = srcSpaceTol; |
| 757 | 757 |
| 758 viewMatrix.mapRect(&bounds); | 758 viewMatrix.mapRect(&bounds); |
| 759 uint8_t coverage = GrRandomCoverage(random); | 759 uint8_t coverage = GrRandomCoverage(random); |
| 760 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 760 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
| 761 } | 761 } |
| 762 | 762 |
| 763 #endif | 763 #endif |
| OLD | NEW |