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 "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 693 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
694 // When this is called on a batch, there is only one geometry bundle | 694 // When this is called on a batch, there is only one geometry bundle |
695 out->setKnownFourComponents(fGeoData[0].fColor); | 695 out->setKnownFourComponents(fGeoData[0].fColor); |
696 } | 696 } |
697 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 697 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
698 out->setUnknownSingleComponent(); | 698 out->setUnknownSingleComponent(); |
699 } | 699 } |
700 | 700 |
701 void initBatchTracker(const GrPipelineInfo& init) override { | 701 void initBatchTracker(const GrPipelineInfo& init) override { |
702 // Handle any color overrides | 702 // Handle any color overrides |
703 if (init.fColorIgnored) { | 703 if (!init.readsColor()) { |
704 fGeoData[0].fColor = GrColor_ILLEGAL; | 704 fGeoData[0].fColor = GrColor_ILLEGAL; |
705 } else if (GrColor_ILLEGAL != init.fOverrideColor) { | |
706 fGeoData[0].fColor = init.fOverrideColor; | |
707 } | 705 } |
| 706 init.getOverrideColorIfSet(&fGeoData[0].fColor); |
708 | 707 |
709 // setup batch properties | 708 // setup batch properties |
710 fBatch.fColorIgnored = init.fColorIgnored; | 709 fBatch.fColorIgnored = !init.readsColor(); |
711 fBatch.fColor = fGeoData[0].fColor; | 710 fBatch.fColor = fGeoData[0].fColor; |
712 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; | 711 fBatch.fUsesLocalCoords = init.readsLocalCoords(); |
713 fBatch.fCoverageIgnored = init.fCoverageIgnored; | 712 fBatch.fCoverageIgnored = !init.readsCoverage(); |
714 fBatch.fCoverage = fGeoData[0].fCoverage; | 713 fBatch.fCoverage = fGeoData[0].fCoverage; |
715 } | 714 } |
716 | 715 |
717 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override; | 716 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override; |
718 | 717 |
719 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 718 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
720 | 719 |
721 private: | 720 private: |
722 typedef SkTArray<SkPoint, true> PtArray; | 721 typedef SkTArray<SkPoint, true> PtArray; |
723 typedef SkTArray<int, true> IntArray; | 722 typedef SkTArray<int, true> IntArray; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 GrColor color = GrRandomColor(random); | 996 GrColor color = GrRandomColor(random); |
998 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 997 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
999 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 998 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
1000 SkPath path = GrTest::TestPath(random); | 999 SkPath path = GrTest::TestPath(random); |
1001 SkIRect devClipBounds; | 1000 SkIRect devClipBounds; |
1002 devClipBounds.setEmpty(); | 1001 devClipBounds.setEmpty(); |
1003 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 1002 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
1004 } | 1003 } |
1005 | 1004 |
1006 #endif | 1005 #endif |
OLD | NEW |