| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const char* name() const override { return "AADistanceFieldPathBatch"; } | 140 const char* name() const override { return "AADistanceFieldPathBatch"; } |
| 141 | 141 |
| 142 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 142 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 143 out->setKnownFourComponents(fBatch.fColor); | 143 out->setKnownFourComponents(fBatch.fColor); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 146 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 147 out->setUnknownSingleComponent(); | 147 out->setUnknownSingleComponent(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void initBatchTracker(const GrPipelineInfo& init) override { | 150 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
| 151 // Handle any color overrides | 151 // Handle any color overrides |
| 152 if (!init.readsColor()) { | 152 if (!opt.readsColor()) { |
| 153 fBatch.fColor = GrColor_ILLEGAL; | 153 fBatch.fColor = GrColor_ILLEGAL; |
| 154 } | 154 } |
| 155 init.getOverrideColorIfSet(&fBatch.fColor); | 155 opt.getOverrideColorIfSet(&fBatch.fColor); |
| 156 | 156 |
| 157 // setup batch properties | 157 // setup batch properties |
| 158 fBatch.fColorIgnored = !init.readsColor(); | 158 fBatch.fColorIgnored = !opt.readsColor(); |
| 159 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 159 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); |
| 160 fBatch.fCoverageIgnored = !init.readsCoverage(); | 160 fBatch.fCoverageIgnored = !opt.readsCoverage(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 struct FlushInfo { | 163 struct FlushInfo { |
| 164 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 164 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
| 165 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 165 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
| 166 int fVertexOffset; | 166 int fVertexOffset; |
| 167 int fInstancesToFlush; | 167 int fInstancesToFlush; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 void generateGeometry(GrBatchTarget* batchTarget) override { | 170 void generateGeometry(GrBatchTarget* batchTarget) override { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 geometry.fPath = GrTest::TestPath(random); | 625 geometry.fPath = GrTest::TestPath(random); |
| 626 geometry.fAntiAlias = random->nextBool(); | 626 geometry.fAntiAlias = random->nextBool(); |
| 627 | 627 |
| 628 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, | 628 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, |
| 629 gTestStruct.fAtlas, | 629 gTestStruct.fAtlas, |
| 630 &gTestStruct.fPathCache, | 630 &gTestStruct.fPathCache, |
| 631 &gTestStruct.fPathList); | 631 &gTestStruct.fPathList); |
| 632 } | 632 } |
| 633 | 633 |
| 634 #endif | 634 #endif |
| OLD | NEW |