| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 "GrAADistanceFieldPathRenderer.h" | 9 #include "GrAADistanceFieldPathRenderer.h" |
| 10 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 150 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 151 out->setKnownFourComponents(fBatch.fColor); | 151 out->setKnownFourComponents(fBatch.fColor); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 154 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 155 out->setUnknownSingleComponent(); | 155 out->setUnknownSingleComponent(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void initBatchTracker(const GrPipelineInfo& init) override { | 158 void initBatchTracker(const GrPipelineInfo& init) override { |
| 159 // Handle any color overrides | 159 // Handle any color overrides |
| 160 if (init.fColorIgnored) { | 160 if (!init.readsColor()) { |
| 161 fBatch.fColor = GrColor_ILLEGAL; | 161 fBatch.fColor = GrColor_ILLEGAL; |
| 162 } else if (GrColor_ILLEGAL != init.fOverrideColor) { | |
| 163 fBatch.fColor = init.fOverrideColor; | |
| 164 } | 162 } |
| 163 init.getOverrideColorIfSet(&fBatch.fColor); |
| 165 | 164 |
| 166 // setup batch properties | 165 // setup batch properties |
| 167 fBatch.fColorIgnored = init.fColorIgnored; | 166 fBatch.fColorIgnored = !init.readsColor(); |
| 168 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; | 167 fBatch.fUsesLocalCoords = init.readsLocalCoords(); |
| 169 fBatch.fCoverageIgnored = init.fCoverageIgnored; | 168 fBatch.fCoverageIgnored = !init.readsCoverage(); |
| 170 } | 169 } |
| 171 | 170 |
| 172 struct FlushInfo { | 171 struct FlushInfo { |
| 173 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 172 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
| 174 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 173 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
| 175 int fVertexOffset; | 174 int fVertexOffset; |
| 176 int fInstancesToFlush; | 175 int fInstancesToFlush; |
| 177 }; | 176 }; |
| 178 | 177 |
| 179 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { | 178 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 geometry.fPath = GrTest::TestPath(random); | 651 geometry.fPath = GrTest::TestPath(random); |
| 653 geometry.fAntiAlias = random->nextBool(); | 652 geometry.fAntiAlias = random->nextBool(); |
| 654 | 653 |
| 655 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, | 654 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, |
| 656 gTestStruct.fAtlas, | 655 gTestStruct.fAtlas, |
| 657 &gTestStruct.fPathCache, | 656 &gTestStruct.fPathCache, |
| 658 &gTestStruct.fPathList); | 657 &gTestStruct.fPathList); |
| 659 } | 658 } |
| 660 | 659 |
| 661 #endif | 660 #endif |
| OLD | NEW |