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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 const char* name() const override { return "AAStrokeRect"; } | 63 const char* name() const override { return "AAStrokeRect"; } |
64 | 64 |
65 void computePipelineOptimizations(GrInitInvariantOutput* color, | 65 void computePipelineOptimizations(GrInitInvariantOutput* color, |
66 GrInitInvariantOutput* coverage, | 66 GrInitInvariantOutput* coverage, |
67 GrBatchToXPOverrides* overrides) const ove
rride { | 67 GrBatchToXPOverrides* overrides) const ove
rride { |
68 // When this is called on a batch, there is only one geometry bundle | 68 // When this is called on a batch, there is only one geometry bundle |
69 color->setKnownFourComponents(fGeoData[0].fColor); | 69 color->setKnownFourComponents(fGeoData[0].fColor); |
70 coverage->setUnknownSingleComponent(); | 70 coverage->setUnknownSingleComponent(); |
71 overrides->fUsePLSDstRead = false; | |
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 |