| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 static GrDrawBatch* Create(const Geometry& geometry, GrColor color, const Sk
Matrix& viewMatrix, | 149 static GrDrawBatch* Create(const Geometry& geometry, GrColor color, const Sk
Matrix& viewMatrix, |
| 150 GrBatchAtlas* atlas, PathCache* pathCache, PathDa
taList* pathList) { | 150 GrBatchAtlas* atlas, PathCache* pathCache, PathDa
taList* pathList) { |
| 151 return new AADistanceFieldPathBatch(geometry, color, viewMatrix, atlas,
pathCache, | 151 return new AADistanceFieldPathBatch(geometry, color, viewMatrix, atlas,
pathCache, |
| 152 pathList); | 152 pathList); |
| 153 } | 153 } |
| 154 | 154 |
| 155 const char* name() const override { return "AADistanceFieldPathBatch"; } | 155 const char* name() const override { return "AADistanceFieldPathBatch"; } |
| 156 | 156 |
| 157 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 157 void computePipelineOptimizations(GrInitInvariantOutput* color, |
| 158 out->setKnownFourComponents(fBatch.fColor); | 158 GrInitInvariantOutput* coverage, |
| 159 } | 159 GrBatchToXPOverrides* overrides) const ove
rride { |
| 160 | 160 color->setKnownFourComponents(fBatch.fColor); |
| 161 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 161 coverage->setUnknownSingleComponent(); |
| 162 out->setUnknownSingleComponent(); | 162 overrides->fUsePLSDstRead = false; |
| 163 } | 163 } |
| 164 | 164 |
| 165 private: | 165 private: |
| 166 void initBatchTracker(const GrPipelineOptimizations& opt) override { | 166 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { |
| 167 // Handle any color overrides | 167 // Handle any color overrides |
| 168 if (!opt.readsColor()) { | 168 if (!overrides.readsColor()) { |
| 169 fBatch.fColor = GrColor_ILLEGAL; | 169 fBatch.fColor = GrColor_ILLEGAL; |
| 170 } | 170 } |
| 171 opt.getOverrideColorIfSet(&fBatch.fColor); | 171 overrides.getOverrideColorIfSet(&fBatch.fColor); |
| 172 | 172 |
| 173 // setup batch properties | 173 // setup batch properties |
| 174 fBatch.fColorIgnored = !opt.readsColor(); | 174 fBatch.fColorIgnored = !overrides.readsColor(); |
| 175 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); | 175 fBatch.fUsesLocalCoords = overrides.readsLocalCoords(); |
| 176 fBatch.fCoverageIgnored = !opt.readsCoverage(); | 176 fBatch.fCoverageIgnored = !overrides.readsCoverage(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 struct FlushInfo { | 179 struct FlushInfo { |
| 180 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 180 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
| 181 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 181 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
| 182 int fVertexOffset; | 182 int fVertexOffset; |
| 183 int fInstancesToFlush; | 183 int fInstancesToFlush; |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 void onPrepareDraws(Target* target) override { | 186 void onPrepareDraws(Target* target) override { |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 geometry.fAntiAlias = random->nextBool(); | 635 geometry.fAntiAlias = random->nextBool(); |
| 636 geometry.fGenID = random->nextU(); | 636 geometry.fGenID = random->nextU(); |
| 637 | 637 |
| 638 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, | 638 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, |
| 639 gTestStruct.fAtlas, | 639 gTestStruct.fAtlas, |
| 640 &gTestStruct.fPathCache, | 640 &gTestStruct.fPathCache, |
| 641 &gTestStruct.fPathList); | 641 &gTestStruct.fPathList); |
| 642 } | 642 } |
| 643 | 643 |
| 644 #endif | 644 #endif |
| OLD | NEW |