| OLD | NEW |
| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 public: | 608 public: |
| 609 struct Geometry { | 609 struct Geometry { |
| 610 GrColor fColor; | 610 GrColor fColor; |
| 611 SkMatrix fViewMatrix; | 611 SkMatrix fViewMatrix; |
| 612 SkScalar fInnerRadius; | 612 SkScalar fInnerRadius; |
| 613 SkScalar fOuterRadius; | 613 SkScalar fOuterRadius; |
| 614 bool fStroke; | 614 bool fStroke; |
| 615 SkRect fDevBounds; | 615 SkRect fDevBounds; |
| 616 }; | 616 }; |
| 617 | 617 |
| 618 BATCH_CLASS_ID |
| 619 |
| 618 static GrDrawBatch* Create(const Geometry& geometry) { return new CircleBatc
h(geometry); } | 620 static GrDrawBatch* Create(const Geometry& geometry) { return new CircleBatc
h(geometry); } |
| 619 | 621 |
| 620 const char* name() const override { return "CircleBatch"; } | 622 const char* name() const override { return "CircleBatch"; } |
| 621 | 623 |
| 622 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 624 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 623 // When this is called on a batch, there is only one geometry bundle | 625 // When this is called on a batch, there is only one geometry bundle |
| 624 out->setKnownFourComponents(fGeoData[0].fColor); | 626 out->setKnownFourComponents(fGeoData[0].fColor); |
| 625 } | 627 } |
| 626 | 628 |
| 627 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 629 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 GrColor fColor; | 827 GrColor fColor; |
| 826 SkMatrix fViewMatrix; | 828 SkMatrix fViewMatrix; |
| 827 SkScalar fXRadius; | 829 SkScalar fXRadius; |
| 828 SkScalar fYRadius; | 830 SkScalar fYRadius; |
| 829 SkScalar fInnerXRadius; | 831 SkScalar fInnerXRadius; |
| 830 SkScalar fInnerYRadius; | 832 SkScalar fInnerYRadius; |
| 831 bool fStroke; | 833 bool fStroke; |
| 832 SkRect fDevBounds; | 834 SkRect fDevBounds; |
| 833 }; | 835 }; |
| 834 | 836 |
| 837 BATCH_CLASS_ID |
| 838 |
| 835 static GrDrawBatch* Create(const Geometry& geometry) { return new EllipseBat
ch(geometry); } | 839 static GrDrawBatch* Create(const Geometry& geometry) { return new EllipseBat
ch(geometry); } |
| 836 | 840 |
| 837 const char* name() const override { return "EllipseBatch"; } | 841 const char* name() const override { return "EllipseBatch"; } |
| 838 | 842 |
| 839 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 843 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 840 // When this is called on a batch, there is only one geometry bundle | 844 // When this is called on a batch, there is only one geometry bundle |
| 841 out->setKnownFourComponents(fGeoData[0].fColor); | 845 out->setKnownFourComponents(fGeoData[0].fColor); |
| 842 } | 846 } |
| 843 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 847 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 844 out->setUnknownSingleComponent(); | 848 out->setUnknownSingleComponent(); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 SkScalar fXRadius; | 1095 SkScalar fXRadius; |
| 1092 SkScalar fYRadius; | 1096 SkScalar fYRadius; |
| 1093 SkScalar fInnerXRadius; | 1097 SkScalar fInnerXRadius; |
| 1094 SkScalar fInnerYRadius; | 1098 SkScalar fInnerYRadius; |
| 1095 SkScalar fGeoDx; | 1099 SkScalar fGeoDx; |
| 1096 SkScalar fGeoDy; | 1100 SkScalar fGeoDy; |
| 1097 DIEllipseEdgeEffect::Mode fMode; | 1101 DIEllipseEdgeEffect::Mode fMode; |
| 1098 SkRect fBounds; | 1102 SkRect fBounds; |
| 1099 }; | 1103 }; |
| 1100 | 1104 |
| 1105 BATCH_CLASS_ID |
| 1106 |
| 1101 static GrDrawBatch* Create(const Geometry& geometry, const SkRect& bounds) { | 1107 static GrDrawBatch* Create(const Geometry& geometry, const SkRect& bounds) { |
| 1102 return new DIEllipseBatch(geometry, bounds); | 1108 return new DIEllipseBatch(geometry, bounds); |
| 1103 } | 1109 } |
| 1104 | 1110 |
| 1105 const char* name() const override { return "DIEllipseBatch"; } | 1111 const char* name() const override { return "DIEllipseBatch"; } |
| 1106 | 1112 |
| 1107 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 1113 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 1108 // When this is called on a batch, there is only one geometry bundle | 1114 // When this is called on a batch, there is only one geometry bundle |
| 1109 out->setKnownFourComponents(fGeoData[0].fColor); | 1115 out->setKnownFourComponents(fGeoData[0].fColor); |
| 1110 } | 1116 } |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 public: | 1449 public: |
| 1444 struct Geometry { | 1450 struct Geometry { |
| 1445 GrColor fColor; | 1451 GrColor fColor; |
| 1446 SkMatrix fViewMatrix; | 1452 SkMatrix fViewMatrix; |
| 1447 SkScalar fInnerRadius; | 1453 SkScalar fInnerRadius; |
| 1448 SkScalar fOuterRadius; | 1454 SkScalar fOuterRadius; |
| 1449 bool fStroke; | 1455 bool fStroke; |
| 1450 SkRect fDevBounds; | 1456 SkRect fDevBounds; |
| 1451 }; | 1457 }; |
| 1452 | 1458 |
| 1459 BATCH_CLASS_ID |
| 1460 |
| 1453 static GrDrawBatch* Create(const Geometry& geometry) { | 1461 static GrDrawBatch* Create(const Geometry& geometry) { |
| 1454 return new RRectCircleRendererBatch(geometry); | 1462 return new RRectCircleRendererBatch(geometry); |
| 1455 } | 1463 } |
| 1456 | 1464 |
| 1457 const char* name() const override { return "RRectCircleBatch"; } | 1465 const char* name() const override { return "RRectCircleBatch"; } |
| 1458 | 1466 |
| 1459 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 1467 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 1460 // When this is called on a batch, there is only one geometry bundle | 1468 // When this is called on a batch, there is only one geometry bundle |
| 1461 out->setKnownFourComponents(fGeoData[0].fColor); | 1469 out->setKnownFourComponents(fGeoData[0].fColor); |
| 1462 } | 1470 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 GrColor fColor; | 1627 GrColor fColor; |
| 1620 SkMatrix fViewMatrix; | 1628 SkMatrix fViewMatrix; |
| 1621 SkScalar fXRadius; | 1629 SkScalar fXRadius; |
| 1622 SkScalar fYRadius; | 1630 SkScalar fYRadius; |
| 1623 SkScalar fInnerXRadius; | 1631 SkScalar fInnerXRadius; |
| 1624 SkScalar fInnerYRadius; | 1632 SkScalar fInnerYRadius; |
| 1625 bool fStroke; | 1633 bool fStroke; |
| 1626 SkRect fDevBounds; | 1634 SkRect fDevBounds; |
| 1627 }; | 1635 }; |
| 1628 | 1636 |
| 1637 BATCH_CLASS_ID |
| 1638 |
| 1629 static GrDrawBatch* Create(const Geometry& geometry) { | 1639 static GrDrawBatch* Create(const Geometry& geometry) { |
| 1630 return new RRectEllipseRendererBatch(geometry); | 1640 return new RRectEllipseRendererBatch(geometry); |
| 1631 } | 1641 } |
| 1632 | 1642 |
| 1633 const char* name() const override { return "RRectEllipseRendererBatch"; } | 1643 const char* name() const override { return "RRectEllipseRendererBatch"; } |
| 1634 | 1644 |
| 1635 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 1645 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 1636 // When this is called on a batch, there is only one geometry bundle | 1646 // When this is called on a batch, there is only one geometry bundle |
| 1637 out->setKnownFourComponents(fGeoData[0].fColor); | 1647 out->setKnownFourComponents(fGeoData[0].fColor); |
| 1638 } | 1648 } |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2012 } | 2022 } |
| 2013 | 2023 |
| 2014 DRAW_BATCH_TEST_DEFINE(RRectBatch) { | 2024 DRAW_BATCH_TEST_DEFINE(RRectBatch) { |
| 2015 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); | 2025 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); |
| 2016 GrColor color = GrRandomColor(random); | 2026 GrColor color = GrRandomColor(random); |
| 2017 const SkRRect& rrect = GrTest::TestRRectSimple(random); | 2027 const SkRRect& rrect = GrTest::TestRRectSimple(random); |
| 2018 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); | 2028 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra
ndom)); |
| 2019 } | 2029 } |
| 2020 | 2030 |
| 2021 #endif | 2031 #endif |
| OLD | NEW |