| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
| 10 | 10 |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 struct Geometry { | 745 struct Geometry { |
| 746 GrColor fColor; | 746 GrColor fColor; |
| 747 SkMatrix fViewMatrix; | 747 SkMatrix fViewMatrix; |
| 748 SkPath fPath; | 748 SkPath fPath; |
| 749 }; | 749 }; |
| 750 | 750 |
| 751 static GrDrawBatch* Create(const Geometry& geometry) { return new AAConvexPa
thBatch(geometry); } | 751 static GrDrawBatch* Create(const Geometry& geometry) { return new AAConvexPa
thBatch(geometry); } |
| 752 | 752 |
| 753 const char* name() const override { return "AAConvexBatch"; } | 753 const char* name() const override { return "AAConvexBatch"; } |
| 754 | 754 |
| 755 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 755 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant
Output* coverage, |
| 756 bool* usePLSDstRead) const { |
| 756 // When this is called on a batch, there is only one geometry bundle | 757 // When this is called on a batch, there is only one geometry bundle |
| 757 out->setKnownFourComponents(fGeoData[0].fColor); | 758 color->setKnownFourComponents(fGeoData[0].fColor); |
| 758 } | 759 coverage->setUnknownSingleComponent(); |
| 759 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 760 *usePLSDstRead = false; |
| 760 out->setUnknownSingleComponent(); | |
| 761 } | 761 } |
| 762 | 762 |
| 763 private: | 763 private: |
| 764 void initBatchTracker(const GrPipelineOptimizations& opt) override { | 764 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
| 765 // Handle any color overrides | 765 // Handle any color overrides |
| 766 if (!opt.readsColor()) { | 766 if (!opt.readsColor()) { |
| 767 fGeoData[0].fColor = GrColor_ILLEGAL; | 767 fGeoData[0].fColor = GrColor_ILLEGAL; |
| 768 } | 768 } |
| 769 opt.getOverrideColorIfSet(&fGeoData[0].fColor); | 769 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
| 770 | 770 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1014 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { |
| 1015 AAConvexPathBatch::Geometry geometry; | 1015 AAConvexPathBatch::Geometry geometry; |
| 1016 geometry.fColor = GrRandomColor(random); | 1016 geometry.fColor = GrRandomColor(random); |
| 1017 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 1017 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
| 1018 geometry.fPath = GrTest::TestPathConvex(random); | 1018 geometry.fPath = GrTest::TestPathConvex(random); |
| 1019 | 1019 |
| 1020 return AAConvexPathBatch::Create(geometry); | 1020 return AAConvexPathBatch::Create(geometry); |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 #endif | 1023 #endif |
| OLD | NEW |