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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 uint8_t fCoverage; | 675 uint8_t fCoverage; |
676 SkMatrix fViewMatrix; | 676 SkMatrix fViewMatrix; |
677 SkPath fPath; | 677 SkPath fPath; |
678 SkIRect fDevClipBounds; | 678 SkIRect fDevClipBounds; |
679 }; | 679 }; |
680 | 680 |
681 static GrDrawBatch* Create(const Geometry& geometry) { return new AAHairline
Batch(geometry); } | 681 static GrDrawBatch* Create(const Geometry& geometry) { return new AAHairline
Batch(geometry); } |
682 | 682 |
683 const char* name() const override { return "AAHairlineBatch"; } | 683 const char* name() const override { return "AAHairlineBatch"; } |
684 | 684 |
685 void computePipelineOptimizations(GrInitInvariantOutput* color, | 685 void computePipelineOptimizations(GrInitInvariantOutput* color, |
686 GrInitInvariantOutput* coverage, | 686 GrInitInvariantOutput* coverage, |
687 GrBatchToXPOverrides* overrides) const ove
rride { | 687 GrBatchToXPOverrides* overrides) const ove
rride { |
688 // 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 |
689 color->setKnownFourComponents(fGeoData[0].fColor); | 689 color->setKnownFourComponents(fGeoData[0].fColor); |
690 coverage->setUnknownSingleComponent(); | 690 coverage->setUnknownSingleComponent(); |
691 } | 691 } |
692 | 692 |
693 private: | 693 private: |
694 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { | 694 void initBatchTracker(const GrXPOverridesForBatch& overrides) override { |
695 // Handle any color overrides | 695 // Handle any color overrides |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 GrColor color = GrRandomColor(random); | 989 GrColor color = GrRandomColor(random); |
990 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 990 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
991 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 991 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
992 SkPath path = GrTest::TestPath(random); | 992 SkPath path = GrTest::TestPath(random); |
993 SkIRect devClipBounds; | 993 SkIRect devClipBounds; |
994 devClipBounds.setEmpty(); | 994 devClipBounds.setEmpty(); |
995 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 995 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
996 } | 996 } |
997 | 997 |
998 #endif | 998 #endif |
OLD | NEW |