| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 const char* name() const override { return "AADistanceFieldPathBatch"; } | 132 const char* name() const override { return "AADistanceFieldPathBatch"; } |
| 133 | 133 |
| 134 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 134 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 135 out->setKnownFourComponents(fBatch.fColor); | 135 out->setKnownFourComponents(fBatch.fColor); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 138 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 139 out->setUnknownSingleComponent(); | 139 out->setUnknownSingleComponent(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 private: |
| 142 void initBatchTracker(const GrPipelineOptimizations& opt) override { | 143 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
| 143 // Handle any color overrides | 144 // Handle any color overrides |
| 144 if (!opt.readsColor()) { | 145 if (!opt.readsColor()) { |
| 145 fBatch.fColor = GrColor_ILLEGAL; | 146 fBatch.fColor = GrColor_ILLEGAL; |
| 146 } | 147 } |
| 147 opt.getOverrideColorIfSet(&fBatch.fColor); | 148 opt.getOverrideColorIfSet(&fBatch.fColor); |
| 148 | 149 |
| 149 // setup batch properties | 150 // setup batch properties |
| 150 fBatch.fColorIgnored = !opt.readsColor(); | 151 fBatch.fColorIgnored = !opt.readsColor(); |
| 151 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); | 152 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 args.fPath, | 267 args.fPath, |
| 267 args.fPathData); | 268 args.fPathData); |
| 268 flushInfo.fInstancesToFlush++; | 269 flushInfo.fInstancesToFlush++; |
| 269 } | 270 } |
| 270 | 271 |
| 271 this->flush(target, &flushInfo); | 272 this->flush(target, &flushInfo); |
| 272 } | 273 } |
| 273 | 274 |
| 274 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 275 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
| 275 | 276 |
| 276 private: | |
| 277 AADistanceFieldPathBatch(const Geometry& geometry, GrColor color, const SkMa
trix& viewMatrix, | 277 AADistanceFieldPathBatch(const Geometry& geometry, GrColor color, const SkMa
trix& viewMatrix, |
| 278 GrBatchAtlas* atlas, | 278 GrBatchAtlas* atlas, |
| 279 PathCache* pathCache, PathDataList* pathList) { | 279 PathCache* pathCache, PathDataList* pathList) { |
| 280 this->initClassID<AADistanceFieldPathBatch>(); | 280 this->initClassID<AADistanceFieldPathBatch>(); |
| 281 fBatch.fColor = color; | 281 fBatch.fColor = color; |
| 282 fBatch.fViewMatrix = viewMatrix; | 282 fBatch.fViewMatrix = viewMatrix; |
| 283 fGeoData.push_back(geometry); | 283 fGeoData.push_back(geometry); |
| 284 fGeoData.back().fPathData = NULL; | 284 fGeoData.back().fPathData = NULL; |
| 285 | 285 |
| 286 fAtlas = atlas; | 286 fAtlas = atlas; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 geometry.fPath = GrTest::TestPath(random); | 617 geometry.fPath = GrTest::TestPath(random); |
| 618 geometry.fAntiAlias = random->nextBool(); | 618 geometry.fAntiAlias = random->nextBool(); |
| 619 | 619 |
| 620 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, | 620 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, |
| 621 gTestStruct.fAtlas, | 621 gTestStruct.fAtlas, |
| 622 &gTestStruct.fPathCache, | 622 &gTestStruct.fPathCache, |
| 623 &gTestStruct.fPathList); | 623 &gTestStruct.fPathList); |
| 624 } | 624 } |
| 625 | 625 |
| 626 #endif | 626 #endif |
| OLD | NEW |