| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 class AAHairlineBatch : public GrVertexBatch { | 673 class AAHairlineBatch : public GrVertexBatch { |
| 674 public: | 674 public: |
| 675 struct Geometry { | 675 struct Geometry { |
| 676 GrColor fColor; | 676 GrColor fColor; |
| 677 uint8_t fCoverage; | 677 uint8_t fCoverage; |
| 678 SkMatrix fViewMatrix; | 678 SkMatrix fViewMatrix; |
| 679 SkPath fPath; | 679 SkPath fPath; |
| 680 SkIRect fDevClipBounds; | 680 SkIRect fDevClipBounds; |
| 681 }; | 681 }; |
| 682 | 682 |
| 683 static GrDrawBatch* Create(const Geometry& geometry) { | 683 static GrDrawBatch* Create(const Geometry& geometry) { return new AAHairline
Batch(geometry); } |
| 684 return SkNEW_ARGS(AAHairlineBatch, (geometry)); | |
| 685 } | |
| 686 | 684 |
| 687 const char* name() const override { return "AAHairlineBatch"; } | 685 const char* name() const override { return "AAHairlineBatch"; } |
| 688 | 686 |
| 689 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 687 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
| 690 // When this is called on a batch, there is only one geometry bundle | 688 // When this is called on a batch, there is only one geometry bundle |
| 691 out->setKnownFourComponents(fGeoData[0].fColor); | 689 out->setKnownFourComponents(fGeoData[0].fColor); |
| 692 } | 690 } |
| 693 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { | 691 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override { |
| 694 out->setUnknownSingleComponent(); | 692 out->setUnknownSingleComponent(); |
| 695 } | 693 } |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 GrColor color = GrRandomColor(random); | 989 GrColor color = GrRandomColor(random); |
| 992 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 990 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
| 993 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 991 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
| 994 SkPath path = GrTest::TestPath(random); | 992 SkPath path = GrTest::TestPath(random); |
| 995 SkIRect devClipBounds; | 993 SkIRect devClipBounds; |
| 996 devClipBounds.setEmpty(); | 994 devClipBounds.setEmpty(); |
| 997 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 995 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
| 998 } | 996 } |
| 999 | 997 |
| 1000 #endif | 998 #endif |
| OLD | NEW |