| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrAARectRenderer.h" | 8 #include "GrAARectRenderer.h" |
| 9 #include "GrBatch.h" | 9 #include "GrBatch.h" |
| 10 #include "GrBatchTarget.h" | 10 #include "GrBatchTarget.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 out->setKnownFourComponents(fGeoData[0].fColor); | 70 out->setKnownFourComponents(fGeoData[0].fColor); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 73 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 74 out->setUnknownSingleComponent(); | 74 out->setUnknownSingleComponent(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void initBatchTracker(const GrPipelineInfo& init) override { | 77 void initBatchTracker(const GrPipelineInfo& init) override { |
| 78 // Handle any color overrides | 78 // Handle any color overrides |
| 79 if (!init.readsColor()) { | 79 if (!init.readsColor()) { |
| 80 fBatch.fColor = GrColor_ILLEGAL; | 80 fGeoData[0].fColor = GrColor_ILLEGAL; |
| 81 } | 81 } |
| 82 init.getOverrideColorIfSet(&fBatch.fColor); | 82 init.getOverrideColorIfSet(&fGeoData[0].fColor); |
| 83 | 83 |
| 84 // setup batch properties | 84 // setup batch properties |
| 85 fBatch.fColorIgnored = !init.readsColor(); | 85 fBatch.fColorIgnored = !init.readsColor(); |
| 86 fBatch.fColor = fGeoData[0].fColor; |
| 86 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 87 fBatch.fUsesLocalCoords = init.readsLocalCoords(); |
| 87 fBatch.fCoverageIgnored = !init.readsCoverage(); | 88 fBatch.fCoverageIgnored = !init.readsCoverage(); |
| 88 fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); | 89 fBatch.fCanTweakAlphaForCoverage = init.canTweakAlphaForCoverage(); |
| 89 } | 90 } |
| 90 | 91 |
| 91 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { | 92 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { |
| 92 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); | 93 bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage(); |
| 93 | 94 |
| 94 SkMatrix localMatrix; | 95 SkMatrix localMatrix; |
| 95 if (this->usesLocalCoords() && !this->viewMatrix().invert(&localMatrix))
{ | 96 if (this->usesLocalCoords() && !this->viewMatrix().invert(&localMatrix))
{ |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 geo.fColor = GrRandomColor(random); | 841 geo.fColor = GrRandomColor(random); |
| 841 geo.fDevOutside = outside; | 842 geo.fDevOutside = outside; |
| 842 geo.fDevOutsideAssist = outsideAssist; | 843 geo.fDevOutsideAssist = outsideAssist; |
| 843 geo.fDevInside = inside; | 844 geo.fDevInside = inside; |
| 844 geo.fMiterStroke = miterStroke; | 845 geo.fMiterStroke = miterStroke; |
| 845 | 846 |
| 846 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random)); | 847 return AAStrokeRectBatch::Create(geo, GrTest::TestMatrix(random)); |
| 847 } | 848 } |
| 848 | 849 |
| 849 #endif | 850 #endif |
| OLD | NEW |