Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: src/gpu/GrOvalRenderer.cpp

Issue 1541903002: added support for PLS path rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for ASAN failure Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrPLSGeometryProcessor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrOvalRenderer.h" 8 #include "GrOvalRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 string.append(INHERITED::dumpInfo()); 670 string.append(INHERITED::dumpInfo());
671 return string; 671 return string;
672 } 672 }
673 673
674 void computePipelineOptimizations(GrInitInvariantOutput* color, 674 void computePipelineOptimizations(GrInitInvariantOutput* color,
675 GrInitInvariantOutput* coverage, 675 GrInitInvariantOutput* coverage,
676 GrBatchToXPOverrides* overrides) const ove rride { 676 GrBatchToXPOverrides* overrides) const ove rride {
677 // When this is called on a batch, there is only one geometry bundle 677 // When this is called on a batch, there is only one geometry bundle
678 color->setKnownFourComponents(fGeoData[0].fColor); 678 color->setKnownFourComponents(fGeoData[0].fColor);
679 coverage->setUnknownSingleComponent(); 679 coverage->setUnknownSingleComponent();
680 overrides->fUsePLSDstRead = false;
681 } 680 }
682 681
683 private: 682 private:
684 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { 683 void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
685 // Handle any color overrides 684 // Handle any color overrides
686 if (!overrides.readsColor()) { 685 if (!overrides.readsColor()) {
687 fGeoData[0].fColor = GrColor_ILLEGAL; 686 fGeoData[0].fColor = GrColor_ILLEGAL;
688 } 687 }
689 overrides.getOverrideColorIfSet(&fGeoData[0].fColor); 688 overrides.getOverrideColorIfSet(&fGeoData[0].fColor);
690 689
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 static GrDrawBatch* Create(const Geometry& geometry) { return new EllipseBat ch(geometry); } 889 static GrDrawBatch* Create(const Geometry& geometry) { return new EllipseBat ch(geometry); }
891 890
892 const char* name() const override { return "EllipseBatch"; } 891 const char* name() const override { return "EllipseBatch"; }
893 892
894 void computePipelineOptimizations(GrInitInvariantOutput* color, 893 void computePipelineOptimizations(GrInitInvariantOutput* color,
895 GrInitInvariantOutput* coverage, 894 GrInitInvariantOutput* coverage,
896 GrBatchToXPOverrides* overrides) const ove rride { 895 GrBatchToXPOverrides* overrides) const ove rride {
897 // When this is called on a batch, there is only one geometry bundle 896 // When this is called on a batch, there is only one geometry bundle
898 color->setKnownFourComponents(fGeoData[0].fColor); 897 color->setKnownFourComponents(fGeoData[0].fColor);
899 coverage->setUnknownSingleComponent(); 898 coverage->setUnknownSingleComponent();
900 overrides->fUsePLSDstRead = false;
901 } 899 }
902 900
903 private: 901 private:
904 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { 902 void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
905 // Handle any color overrides 903 // Handle any color overrides
906 if (!overrides.readsCoverage()) { 904 if (!overrides.readsCoverage()) {
907 fGeoData[0].fColor = GrColor_ILLEGAL; 905 fGeoData[0].fColor = GrColor_ILLEGAL;
908 } 906 }
909 overrides.getOverrideColorIfSet(&fGeoData[0].fColor); 907 overrides.getOverrideColorIfSet(&fGeoData[0].fColor);
910 908
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 } 1160 }
1163 1161
1164 const char* name() const override { return "DIEllipseBatch"; } 1162 const char* name() const override { return "DIEllipseBatch"; }
1165 1163
1166 void computePipelineOptimizations(GrInitInvariantOutput* color, 1164 void computePipelineOptimizations(GrInitInvariantOutput* color,
1167 GrInitInvariantOutput* coverage, 1165 GrInitInvariantOutput* coverage,
1168 GrBatchToXPOverrides* overrides) const ove rride { 1166 GrBatchToXPOverrides* overrides) const ove rride {
1169 // When this is called on a batch, there is only one geometry bundle 1167 // When this is called on a batch, there is only one geometry bundle
1170 color->setKnownFourComponents(fGeoData[0].fColor); 1168 color->setKnownFourComponents(fGeoData[0].fColor);
1171 coverage->setUnknownSingleComponent(); 1169 coverage->setUnknownSingleComponent();
1172 overrides->fUsePLSDstRead = false;
1173 } 1170 }
1174 1171
1175 private: 1172 private:
1176 1173
1177 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { 1174 void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
1178 // Handle any color overrides 1175 // Handle any color overrides
1179 if (!overrides.readsColor()) { 1176 if (!overrides.readsColor()) {
1180 fGeoData[0].fColor = GrColor_ILLEGAL; 1177 fGeoData[0].fColor = GrColor_ILLEGAL;
1181 } 1178 }
1182 overrides.getOverrideColorIfSet(&fGeoData[0].fColor); 1179 overrides.getOverrideColorIfSet(&fGeoData[0].fColor);
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 } 1517 }
1521 1518
1522 const char* name() const override { return "RRectCircleBatch"; } 1519 const char* name() const override { return "RRectCircleBatch"; }
1523 1520
1524 void computePipelineOptimizations(GrInitInvariantOutput* color, 1521 void computePipelineOptimizations(GrInitInvariantOutput* color,
1525 GrInitInvariantOutput* coverage, 1522 GrInitInvariantOutput* coverage,
1526 GrBatchToXPOverrides* overrides) const ove rride { 1523 GrBatchToXPOverrides* overrides) const ove rride {
1527 // When this is called on a batch, there is only one geometry bundle 1524 // When this is called on a batch, there is only one geometry bundle
1528 color->setKnownFourComponents(fGeoData[0].fColor); 1525 color->setKnownFourComponents(fGeoData[0].fColor);
1529 coverage->setUnknownSingleComponent(); 1526 coverage->setUnknownSingleComponent();
1530 overrides->fUsePLSDstRead = false;
1531 } 1527 }
1532 1528
1533 private: 1529 private:
1534 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { 1530 void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
1535 // Handle any color overrides 1531 // Handle any color overrides
1536 if (!overrides.readsColor()) { 1532 if (!overrides.readsColor()) {
1537 fGeoData[0].fColor = GrColor_ILLEGAL; 1533 fGeoData[0].fColor = GrColor_ILLEGAL;
1538 } 1534 }
1539 overrides.getOverrideColorIfSet(&fGeoData[0].fColor); 1535 overrides.getOverrideColorIfSet(&fGeoData[0].fColor);
1540 1536
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 } 1696 }
1701 1697
1702 const char* name() const override { return "RRectEllipseRendererBatch"; } 1698 const char* name() const override { return "RRectEllipseRendererBatch"; }
1703 1699
1704 void computePipelineOptimizations(GrInitInvariantOutput* color, 1700 void computePipelineOptimizations(GrInitInvariantOutput* color,
1705 GrInitInvariantOutput* coverage, 1701 GrInitInvariantOutput* coverage,
1706 GrBatchToXPOverrides* overrides) const ove rride { 1702 GrBatchToXPOverrides* overrides) const ove rride {
1707 // When this is called on a batch, there is only one geometry bundle 1703 // When this is called on a batch, there is only one geometry bundle
1708 color->setKnownFourComponents(fGeoData[0].fColor); 1704 color->setKnownFourComponents(fGeoData[0].fColor);
1709 coverage->setUnknownSingleComponent(); 1705 coverage->setUnknownSingleComponent();
1710 overrides->fUsePLSDstRead = false;
1711 } 1706 }
1712 1707
1713 private: 1708 private:
1714 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { 1709 void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
1715 // Handle any color overrides 1710 // Handle any color overrides
1716 if (!overrides.readsColor()) { 1711 if (!overrides.readsColor()) {
1717 fGeoData[0].fColor = GrColor_ILLEGAL; 1712 fGeoData[0].fColor = GrColor_ILLEGAL;
1718 } 1713 }
1719 overrides.getOverrideColorIfSet(&fGeoData[0].fColor); 1714 overrides.getOverrideColorIfSet(&fGeoData[0].fColor);
1720 1715
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 } 2078 }
2084 2079
2085 DRAW_BATCH_TEST_DEFINE(RRectBatch) { 2080 DRAW_BATCH_TEST_DEFINE(RRectBatch) {
2086 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); 2081 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random);
2087 GrColor color = GrRandomColor(random); 2082 GrColor color = GrRandomColor(random);
2088 const SkRRect& rrect = GrTest::TestRRectSimple(random); 2083 const SkRRect& rrect = GrTest::TestRRectSimple(random);
2089 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom)); 2084 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom));
2090 } 2085 }
2091 2086
2092 #endif 2087 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrPLSGeometryProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698