| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrAAStrokeRectBatch.h" | 8 #include "GrAAStrokeRectBatch.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 GrColor fColor; | 55 GrColor fColor; |
| 56 bool fDegenerate; | 56 bool fDegenerate; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 static AAStrokeRectBatch* Create(const SkMatrix& viewMatrix, bool miterStrok
e) { | 59 static AAStrokeRectBatch* Create(const SkMatrix& viewMatrix, bool miterStrok
e) { |
| 60 return new AAStrokeRectBatch(viewMatrix, miterStroke); | 60 return new AAStrokeRectBatch(viewMatrix, miterStroke); |
| 61 } | 61 } |
| 62 | 62 |
| 63 const char* name() const override { return "AAStrokeRect"; } | 63 const char* name() const override { return "AAStrokeRect"; } |
| 64 | 64 |
| 65 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 65 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant
Output* coverage, |
| 66 bool* usePLSDstRead) const { |
| 66 // When this is called on a batch, there is only one geometry bundle | 67 // When this is called on a batch, there is only one geometry bundle |
| 67 out->setKnownFourComponents(fGeoData[0].fColor); | 68 color->setKnownFourComponents(fGeoData[0].fColor); |
| 68 } | 69 coverage->setUnknownSingleComponent(); |
| 69 | 70 *usePLSDstRead = false; |
| 70 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | |
| 71 out->setUnknownSingleComponent(); | |
| 72 } | 71 } |
| 73 | 72 |
| 74 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 73 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
| 75 | 74 |
| 76 bool canAppend(const SkMatrix& viewMatrix, bool miterStroke) { | 75 bool canAppend(const SkMatrix& viewMatrix, bool miterStroke) { |
| 77 return fViewMatrix.cheapEqualTo(viewMatrix) && fMiterStroke == miterStro
ke; | 76 return fViewMatrix.cheapEqualTo(viewMatrix) && fMiterStroke == miterStro
ke; |
| 78 } | 77 } |
| 79 | 78 |
| 80 void append(GrColor color, const SkRect& devOutside, const SkRect& devOutsid
eAssist, | 79 void append(GrColor color, const SkRect& devOutside, const SkRect& devOutsid
eAssist, |
| 81 const SkRect& devInside, bool degenerate) { | 80 const SkRect& devInside, bool degenerate) { |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 SkRect inside = outside; | 655 SkRect inside = outside; |
| 657 inside.inset(strokeWidth, strokeWidth); | 656 inside.inset(strokeWidth, strokeWidth); |
| 658 | 657 |
| 659 GrColor color = GrRandomColor(random); | 658 GrColor color = GrRandomColor(random); |
| 660 | 659 |
| 661 return GrAAStrokeRectBatch::Create(color, GrTest::TestMatrix(random), outsid
e, outsideAssist, | 660 return GrAAStrokeRectBatch::Create(color, GrTest::TestMatrix(random), outsid
e, outsideAssist, |
| 662 inside, miterStroke, inside.isFinite() &&
inside.isEmpty()); | 661 inside, miterStroke, inside.isFinite() &&
inside.isEmpty()); |
| 663 } | 662 } |
| 664 | 663 |
| 665 #endif | 664 #endif |
| OLD | NEW |