| 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 "GrBatchTarget.h" | 10 #include "GrBatchTarget.h" |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 const char* name() const override { return "AAHairlineBatch"; } | 687 const char* name() const override { return "AAHairlineBatch"; } |
| 688 | 688 |
| 689 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 689 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 690 // When this is called on a batch, there is only one geometry bundle | 690 // When this is called on a batch, there is only one geometry bundle |
| 691 out->setKnownFourComponents(fGeoData[0].fColor); | 691 out->setKnownFourComponents(fGeoData[0].fColor); |
| 692 } | 692 } |
| 693 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 693 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 694 out->setUnknownSingleComponent(); | 694 out->setUnknownSingleComponent(); |
| 695 } | 695 } |
| 696 | 696 |
| 697 void initBatchTracker(const GrPipelineInfo& init) override { | 697 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
| 698 // Handle any color overrides | 698 // Handle any color overrides |
| 699 if (!init.readsColor()) { | 699 if (!opt.readsColor()) { |
| 700 fGeoData[0].fColor = GrColor_ILLEGAL; | 700 fGeoData[0].fColor = GrColor_ILLEGAL; |
| 701 } | 701 } |
| 702 init.getOverrideColorIfSet(&fGeoData[0].fColor); | 702 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
| 703 | 703 |
| 704 // setup batch properties | 704 // setup batch properties |
| 705 fBatch.fColorIgnored = !init.readsColor(); | 705 fBatch.fColorIgnored = !opt.readsColor(); |
| 706 fBatch.fColor = fGeoData[0].fColor; | 706 fBatch.fColor = fGeoData[0].fColor; |
| 707 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 707 fBatch.fUsesLocalCoords = opt.readsLocalCoords(); |
| 708 fBatch.fCoverageIgnored = !init.readsCoverage(); | 708 fBatch.fCoverageIgnored = !opt.readsCoverage(); |
| 709 fBatch.fCoverage = fGeoData[0].fCoverage; | 709 fBatch.fCoverage = fGeoData[0].fCoverage; |
| 710 } | 710 } |
| 711 | 711 |
| 712 void generateGeometry(GrBatchTarget* batchTarget) override; | 712 void generateGeometry(GrBatchTarget* batchTarget) override; |
| 713 | 713 |
| 714 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } | 714 SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; } |
| 715 | 715 |
| 716 private: | 716 private: |
| 717 typedef SkTArray<SkPoint, true> PtArray; | 717 typedef SkTArray<SkPoint, true> PtArray; |
| 718 typedef SkTArray<int, true> IntArray; | 718 typedef SkTArray<int, true> IntArray; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 GrColor color = GrRandomColor(random); | 990 GrColor color = GrRandomColor(random); |
| 991 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 991 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 992 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 992 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
| 993 SkPath path = GrTest::TestPath(random); | 993 SkPath path = GrTest::TestPath(random); |
| 994 SkIRect devClipBounds; | 994 SkIRect devClipBounds; |
| 995 devClipBounds.setEmpty(); | 995 devClipBounds.setEmpty(); |
| 996 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 996 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
| 997 } | 997 } |
| 998 | 998 |
| 999 #endif | 999 #endif |
| OLD | NEW |