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.readsColor()) { | 160 if (init.fColorIgnored) { |
161 fBatch.fColor = GrColor_ILLEGAL; | 161 fBatch.fColor = GrColor_ILLEGAL; |
| 162 } else if (GrColor_ILLEGAL != init.fOverrideColor) { |
| 163 fBatch.fColor = init.fOverrideColor; |
162 } | 164 } |
163 init.getOverrideColorIfSet(&fBatch.fColor); | |
164 | 165 |
165 // setup batch properties | 166 // setup batch properties |
166 fBatch.fColorIgnored = !init.readsColor(); | 167 fBatch.fColorIgnored = init.fColorIgnored; |
167 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 168 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; |
168 fBatch.fCoverageIgnored = !init.readsCoverage(); | 169 fBatch.fCoverageIgnored = init.fCoverageIgnored; |
169 } | 170 } |
170 | 171 |
171 struct FlushInfo { | 172 struct FlushInfo { |
172 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 173 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
173 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 174 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
174 int fVertexOffset; | 175 int fVertexOffset; |
175 int fInstancesToFlush; | 176 int fInstancesToFlush; |
176 }; | 177 }; |
177 | 178 |
178 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { | 179 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 geometry.fPath = GrTest::TestPath(random); | 652 geometry.fPath = GrTest::TestPath(random); |
652 geometry.fAntiAlias = random->nextBool(); | 653 geometry.fAntiAlias = random->nextBool(); |
653 | 654 |
654 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, | 655 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, |
655 gTestStruct.fAtlas, | 656 gTestStruct.fAtlas, |
656 &gTestStruct.fPathCache, | 657 &gTestStruct.fPathCache, |
657 &gTestStruct.fPathList); | 658 &gTestStruct.fPathList); |
658 } | 659 } |
659 | 660 |
660 #endif | 661 #endif |
OLD | NEW |