OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" | 8 #include "GrAAHairLinePathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 static GrDrawBatch* Create(const Geometry& geometry) { return new AAHairline
Batch(geometry); } | 685 static GrDrawBatch* Create(const Geometry& geometry) { return new AAHairline
Batch(geometry); } |
686 | 686 |
687 const char* name() const override { return "AAHairlineBatch"; } | 687 const char* name() const override { return "AAHairlineBatch"; } |
688 | 688 |
689 void computePipelineOptimizations(GrInitInvariantOutput* color, | 689 void computePipelineOptimizations(GrInitInvariantOutput* color, |
690 GrInitInvariantOutput* coverage, | 690 GrInitInvariantOutput* coverage, |
691 GrBatchToXPOverrides* overrides) const ove
rride { | 691 GrBatchToXPOverrides* overrides) const ove
rride { |
692 // When this is called on a batch, there is only one geometry bundle | 692 // When this is called on a batch, there is only one geometry bundle |
693 color->setKnownFourComponents(fGeoData[0].fColor); | 693 color->setKnownFourComponents(fGeoData[0].fColor); |
694 coverage->setUnknownSingleComponent(); | 694 coverage->setUnknownSingleComponent(); |
695 overrides->fUsePLSDstRead = false; | 695 overrides->fUsePLSDstRead = true; |
696 } | 696 } |
697 | 697 |
698 private: | 698 private: |
699 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { | 699 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { |
700 // Handle any color overrides | 700 // Handle any color overrides |
701 if (!overrides.readsColor()) { | 701 if (!overrides.readsColor()) { |
702 fGeoData[0].fColor = GrColor_ILLEGAL; | 702 fGeoData[0].fColor = GrColor_ILLEGAL; |
703 } | 703 } |
704 overrides.getOverrideColorIfSet(&fGeoData[0].fColor); | 704 overrides.getOverrideColorIfSet(&fGeoData[0].fColor); |
705 | 705 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 GrColor color = GrRandomColor(random); | 994 GrColor color = GrRandomColor(random); |
995 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 995 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
996 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 996 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
997 SkPath path = GrTest::TestPath(random); | 997 SkPath path = GrTest::TestPath(random); |
998 SkIRect devClipBounds; | 998 SkIRect devClipBounds; |
999 devClipBounds.setEmpty(); | 999 devClipBounds.setEmpty(); |
1000 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 1000 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
1001 } | 1001 } |
1002 | 1002 |
1003 #endif | 1003 #endif |
OLD | NEW |