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 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 754 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
755 // When this is called on a batch, there is only one geometry bundle | 755 // When this is called on a batch, there is only one geometry bundle |
756 out->setKnownFourComponents(fGeoData[0].fColor); | 756 out->setKnownFourComponents(fGeoData[0].fColor); |
757 } | 757 } |
758 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 758 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
759 out->setUnknownSingleComponent(); | 759 out->setUnknownSingleComponent(); |
760 } | 760 } |
761 | 761 |
762 void initBatchTracker(const GrPipelineInfo& init) override { | 762 void initBatchTracker(const GrPipelineInfo& init) override { |
763 // Handle any color overrides | 763 // Handle any color overrides |
764 if (init.fColorIgnored) { | 764 if (!init.readsColor()) { |
765 fGeoData[0].fColor = GrColor_ILLEGAL; | 765 fGeoData[0].fColor = GrColor_ILLEGAL; |
766 } else if (GrColor_ILLEGAL != init.fOverrideColor) { | |
767 fGeoData[0].fColor = init.fOverrideColor; | |
768 } | 766 } |
| 767 init.getOverrideColorIfSet(&fGeoData[0].fColor); |
769 | 768 |
770 // setup batch properties | 769 // setup batch properties |
771 fBatch.fColorIgnored = init.fColorIgnored; | 770 fBatch.fColorIgnored = !init.readsColor(); |
772 fBatch.fColor = fGeoData[0].fColor; | 771 fBatch.fColor = fGeoData[0].fColor; |
773 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; | 772 fBatch.fUsesLocalCoords = init.readsLocalCoords(); |
774 fBatch.fCoverageIgnored = init.fCoverageIgnored; | 773 fBatch.fCoverageIgnored = !init.readsCoverage(); |
775 fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSe
gmentMasks(); | 774 fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSe
gmentMasks(); |
776 fBatch.fCanTweakAlphaForCoverage = init.fCanTweakAlphaForCoverage; | 775 fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); |
777 } | 776 } |
778 | 777 |
779 void generateGeometryLinesOnly(GrBatchTarget* batchTarget, const GrPipeline*
pipeline) { | 778 void generateGeometryLinesOnly(GrBatchTarget* batchTarget, const GrPipeline*
pipeline) { |
780 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); | 779 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
781 | 780 |
782 SkMatrix invert; | 781 SkMatrix invert; |
783 if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) { | 782 if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) { |
784 SkDebugf("Could not invert viewmatrix\n"); | 783 SkDebugf("Could not invert viewmatrix\n"); |
785 return; | 784 return; |
786 } | 785 } |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1017 BATCH_TEST_DEFINE(AAConvexPathBatch) { |
1019 AAConvexPathBatch::Geometry geometry; | 1018 AAConvexPathBatch::Geometry geometry; |
1020 geometry.fColor = GrRandomColor(random); | 1019 geometry.fColor = GrRandomColor(random); |
1021 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1020 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
1022 geometry.fPath = GrTest::TestPathConvex(random); | 1021 geometry.fPath = GrTest::TestPathConvex(random); |
1023 | 1022 |
1024 return AAConvexPathBatch::Create(geometry); | 1023 return AAConvexPathBatch::Create(geometry); |
1025 } | 1024 } |
1026 | 1025 |
1027 #endif | 1026 #endif |
OLD | NEW |