| 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.readsColor()) { | 764 if (init.fColorIgnored) { |
| 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; |
| 766 } | 768 } |
| 767 init.getOverrideColorIfSet(&fGeoData[0].fColor); | |
| 768 | 769 |
| 769 // setup batch properties | 770 // setup batch properties |
| 770 fBatch.fColorIgnored = !init.readsColor(); | 771 fBatch.fColorIgnored = init.fColorIgnored; |
| 771 fBatch.fColor = fGeoData[0].fColor; | 772 fBatch.fColor = fGeoData[0].fColor; |
| 772 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 773 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; |
| 773 fBatch.fCoverageIgnored = !init.readsCoverage(); | 774 fBatch.fCoverageIgnored = init.fCoverageIgnored; |
| 774 fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSe
gmentMasks(); | 775 fBatch.fLinesOnly = SkPath::kLine_SegmentMask == fGeoData[0].fPath.getSe
gmentMasks(); |
| 775 fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); | 776 fBatch.fCanTweakAlphaForCoverage = init.fCanTweakAlphaForCoverage; |
| 776 } | 777 } |
| 777 | 778 |
| 778 void generateGeometryLinesOnly(GrBatchTarget* batchTarget, const GrPipeline*
pipeline) { | 779 void generateGeometryLinesOnly(GrBatchTarget* batchTarget, const GrPipeline*
pipeline) { |
| 779 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); | 780 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
| 780 | 781 |
| 781 SkMatrix invert; | 782 SkMatrix invert; |
| 782 if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) { | 783 if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) { |
| 783 SkDebugf("Could not invert viewmatrix\n"); | 784 SkDebugf("Could not invert viewmatrix\n"); |
| 784 return; | 785 return; |
| 785 } | 786 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1018 BATCH_TEST_DEFINE(AAConvexPathBatch) { |
| 1018 AAConvexPathBatch::Geometry geometry; | 1019 AAConvexPathBatch::Geometry geometry; |
| 1019 geometry.fColor = GrRandomColor(random); | 1020 geometry.fColor = GrRandomColor(random); |
| 1020 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1021 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
| 1021 geometry.fPath = GrTest::TestPathConvex(random); | 1022 geometry.fPath = GrTest::TestPathConvex(random); |
| 1022 | 1023 |
| 1023 return AAConvexPathBatch::Create(geometry); | 1024 return AAConvexPathBatch::Create(geometry); |
| 1024 } | 1025 } |
| 1025 | 1026 |
| 1026 #endif | 1027 #endif |
| OLD | NEW |