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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
619 SkScalar fInnerRadius; | 619 SkScalar fInnerRadius; |
620 SkScalar fOuterRadius; | 620 SkScalar fOuterRadius; |
621 GrColor fColor; | 621 GrColor fColor; |
622 bool fStroke; | 622 bool fStroke; |
623 }; | 623 }; |
624 | 624 |
625 static GrDrawBatch* Create(const Geometry& geometry) { return new CircleBatc h(geometry); } | 625 static GrDrawBatch* Create(const Geometry& geometry) { return new CircleBatc h(geometry); } |
626 | 626 |
627 const char* name() const override { return "CircleBatch"; } | 627 const char* name() const override { return "CircleBatch"; } |
628 | 628 |
629 SkString dumpInfo() const override { | |
630 SkString string; | |
631 for (int i = 0; i < fGeoData.count(); ++i) { | |
632 string.appendf("Color: 0x%08x Rect [L: %.2f, T: %.2f, R: %.2f, B: %. 2f], InnerRad: %.2f, OuterRad: %.2f\n", | |
joshualitt
2015/11/13 19:43:23
line wrap
robertphillips
2015/11/16 14:16:06
Done.
| |
633 fGeoData[i].fColor, | |
634 fGeoData[i].fDevBounds.fLeft, fGeoData[i].fDevBounds. fTop, | |
635 fGeoData[i].fDevBounds.fRight, fGeoData[i].fDevBounds .fBottom, | |
636 fGeoData[i].fInnerRadius, | |
637 fGeoData[i].fOuterRadius); | |
638 } | |
639 string.append(INHERITED::dumpInfo()); | |
640 return string; | |
641 } | |
642 | |
629 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 643 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
630 // When this is called on a batch, there is only one geometry bundle | 644 // When this is called on a batch, there is only one geometry bundle |
631 out->setKnownFourComponents(fGeoData[0].fColor); | 645 out->setKnownFourComponents(fGeoData[0].fColor); |
632 } | 646 } |
633 | 647 |
634 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 648 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
635 out->setUnknownSingleComponent(); | 649 out->setUnknownSingleComponent(); |
636 } | 650 } |
637 | 651 |
638 private: | 652 private: |
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2032 } | 2046 } |
2033 | 2047 |
2034 DRAW_BATCH_TEST_DEFINE(RRectBatch) { | 2048 DRAW_BATCH_TEST_DEFINE(RRectBatch) { |
2035 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); | 2049 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); |
2036 GrColor color = GrRandomColor(random); | 2050 GrColor color = GrRandomColor(random); |
2037 const SkRRect& rrect = GrTest::TestRRectSimple(random); | 2051 const SkRRect& rrect = GrTest::TestRRectSimple(random); |
2038 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom)); | 2052 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom)); |
2039 } | 2053 } |
2040 | 2054 |
2041 #endif | 2055 #endif |
OLD | NEW |