| 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 uint8_t fCoverage; | 679 uint8_t fCoverage; |
| 680 SkMatrix fViewMatrix; | 680 SkMatrix fViewMatrix; |
| 681 SkPath fPath; | 681 SkPath fPath; |
| 682 SkIRect fDevClipBounds; | 682 SkIRect fDevClipBounds; |
| 683 }; | 683 }; |
| 684 | 684 |
| 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 getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 689 void computeBatchToXPOverrides(GrInitInvariantOutput* color, GrInitInvariant
Output* coverage, |
| 690 bool* usePLSDstRead) const { |
| 690 // When this is called on a batch, there is only one geometry bundle | 691 // When this is called on a batch, there is only one geometry bundle |
| 691 out->setKnownFourComponents(fGeoData[0].fColor); | 692 color->setKnownFourComponents(fGeoData[0].fColor); |
| 692 } | 693 coverage->setUnknownSingleComponent(); |
| 693 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 694 *usePLSDstRead = true; |
| 694 out->setUnknownSingleComponent(); | |
| 695 } | 695 } |
| 696 | 696 |
| 697 private: | 697 private: |
| 698 void initBatchTracker(const GrPipelineOptimizations& opt) override { | 698 void initBatchTracker(const GrPipelineOptimizations& opt) override { |
| 699 // Handle any color overrides | 699 // Handle any color overrides |
| 700 if (!opt.readsColor()) { | 700 if (!opt.readsColor()) { |
| 701 fGeoData[0].fColor = GrColor_ILLEGAL; | 701 fGeoData[0].fColor = GrColor_ILLEGAL; |
| 702 } | 702 } |
| 703 opt.getOverrideColorIfSet(&fGeoData[0].fColor); | 703 opt.getOverrideColorIfSet(&fGeoData[0].fColor); |
| 704 | 704 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 GrColor color = GrRandomColor(random); | 992 GrColor color = GrRandomColor(random); |
| 993 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 993 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 994 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 994 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
| 995 SkPath path = GrTest::TestPath(random); | 995 SkPath path = GrTest::TestPath(random); |
| 996 SkIRect devClipBounds; | 996 SkIRect devClipBounds; |
| 997 devClipBounds.setEmpty(); | 997 devClipBounds.setEmpty(); |
| 998 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 998 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 #endif | 1001 #endif |
| OLD | NEW |