| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
| 10 | 10 |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 const char* name() const override { return "AAConvexBatch"; } | 754 const char* name() const override { return "AAConvexBatch"; } |
| 755 | 755 |
| 756 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 756 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 757 // When this is called on a batch, there is only one geometry bundle | 757 // When this is called on a batch, there is only one geometry bundle |
| 758 out->setKnownFourComponents(fGeoData[0].fColor); | 758 out->setKnownFourComponents(fGeoData[0].fColor); |
| 759 } | 759 } |
| 760 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 760 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 761 out->setUnknownSingleComponent(); | 761 out->setUnknownSingleComponent(); |
| 762 } | 762 } |
| 763 | 763 |
| 764 void initBatchTracker(const GrPipelineInfo& init) override { | 764 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
| 765 // Handle any color overrides | 765 // Handle any color overrides |
| 766 if (!init.readsColor()) { | 766 if (!opt.readsColor()) { |
| 767 fGeoData[0].fColor = GrColor_ILLEGAL; | 767 fGeoData[0].fColor = GrColor_ILLEGAL; |
| 768 } | 768 } |
| 769 init.getOverrideColorIfSet(&fGeoData[0].fColor); | 769 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
| 770 | 770 |
| 771 // setup batch properties | 771 // setup batch properties |
| 772 fBatch.fColorIgnored = !init.readsColor(); | 772 fBatch.fColorIgnored = !opt.readsColor(); |
| 773 fBatch.fColor = fGeoData[0].fColor; | 773 fBatch.fColor = fGeoData[0].fColor; |
| 774 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 774 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); |
| 775 fBatch.fCoverageIgnored = !init.readsCoverage(); | 775 fBatch.fCoverageIgnored = !opt.readsCoverage(); |
| 776 fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSe
gmentMasks(); | 776 fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSe
gmentMasks(); |
| 777 fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); | 777 fBatch.fCanTweakAlphaForCoverage = opt.canTweakAlphaForCoverage(); |
| 778 } | 778 } |
| 779 | 779 |
| 780 void generateGeometryLinesOnly(GrBatchTarget* batchTarget) { | 780 void generateGeometryLinesOnly(GrBatchTarget* batchTarget) { |
| 781 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); | 781 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
| 782 | 782 |
| 783 // Setup GrGeometryProcessor | 783 // Setup GrGeometryProcessor |
| 784 SkAutoTUnref<const GrGeometryProcessor> gp(create_fill_gp(canTweakAlphaF
orCoverage, | 784 SkAutoTUnref<const GrGeometryProcessor> gp(create_fill_gp(canTweakAlphaF
orCoverage, |
| 785 this->viewMatr
ix(), | 785 this->viewMatr
ix(), |
| 786 this->usesLoca
lCoords(), | 786 this->usesLoca
lCoords(), |
| 787 this->coverage
Ignored())); | 787 this->coverage
Ignored())); |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1015 BATCH_TEST_DEFINE(AAConvexPathBatch) { |
| 1016 AAConvexPathBatch::Geometry geometry; | 1016 AAConvexPathBatch::Geometry geometry; |
| 1017 geometry.fColor = GrRandomColor(random); | 1017 geometry.fColor = GrRandomColor(random); |
| 1018 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1018 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
| 1019 geometry.fPath = GrTest::TestPathConvex(random); | 1019 geometry.fPath = GrTest::TestPathConvex(random); |
| 1020 | 1020 |
| 1021 return AAConvexPathBatch::Create(geometry); | 1021 return AAConvexPathBatch::Create(geometry); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 #endif | 1024 #endif |
| OLD | NEW |