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 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 } | 71 } |
72 | 72 |
73 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 73 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
74 | 74 |
75 bool canAppend(const SkMatrix& viewMatrix, bool miterStroke) { | 75 bool canAppend(const SkMatrix& viewMatrix, bool miterStroke) { |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 SkRect inside = outside; | 654 SkRect inside = outside; |
655 inside.inset(strokeWidth, strokeWidth); | 655 inside.inset(strokeWidth, strokeWidth); |
656 | 656 |
657 GrColor color = GrRandomColor(random); | 657 GrColor color = GrRandomColor(random); |
658 | 658 |
659 return GrAAStrokeRectBatch::Create(color, GrTest::TestMatrix(random), outsid
e, outsideAssist, | 659 return GrAAStrokeRectBatch::Create(color, GrTest::TestMatrix(random), outsid
e, outsideAssist, |
660 inside, miterStroke, inside.isFinite() &&
inside.isEmpty()); | 660 inside, miterStroke, inside.isFinite() &&
inside.isEmpty()); |
661 } | 661 } |
662 | 662 |
663 #endif | 663 #endif |
OLD | NEW |