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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 const SkMatrix* geometryProcessorLocalM = &invert; | 805 const SkMatrix* geometryProcessorLocalM = &invert; |
806 const SkMatrix* toDevice = NULL; | 806 const SkMatrix* toDevice = NULL; |
807 const SkMatrix* toSrc = NULL; | 807 const SkMatrix* toSrc = NULL; |
808 if (hasPerspective) { | 808 if (hasPerspective) { |
809 geometryProcessorViewM = &this->viewMatrix(); | 809 geometryProcessorViewM = &this->viewMatrix(); |
810 geometryProcessorLocalM = &SkMatrix::I(); | 810 geometryProcessorLocalM = &SkMatrix::I(); |
811 toDevice = &this->viewMatrix(); | 811 toDevice = &this->viewMatrix(); |
812 toSrc = &invert; | 812 toSrc = &invert; |
813 } | 813 } |
814 | 814 |
815 // Setup geometry processors for worst case | 815 SkAutoTUnref<const GrGeometryProcessor> lineGP; |
816 uint32_t gpFlags = GrDefaultGeoProcFactory::kPosition_GPType | | 816 { |
817 GrDefaultGeoProcFactory::kCoverage_GPType; | 817 using namespace GrDefaultGeoProcFactory; |
818 | 818 |
819 SkAutoTUnref<const GrGeometryProcessor> lineGP( | 819 Color color(this->color()); |
820 GrDefaultGeoProcFactory::Create(gpFlags, | 820 Coverage coverage(this->coverageIgnored() ? Coverage::kNone_Type : |
821 this->color(), | 821 Coverage::kAttribute_Type); |
822 this->usesLocalCoords(), | 822 LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUsePosit
ion_Type : |
823 this->coverageIgnored(), | 823 LocalCoords::kUnused_T
ype); |
824 *geometryProcessorViewM, | 824 localCoords.fMatrix = &invert; |
825 *geometryProcessorLocalM, | 825 lineGP.reset(GrDefaultGeoProcFactory::Create(color, coverage, localCoord
s)); |
826 this->coverage())); | 826 } |
827 | 827 |
828 SkAutoTUnref<const GrGeometryProcessor> quadGP( | 828 SkAutoTUnref<const GrGeometryProcessor> quadGP( |
829 GrQuadEffect::Create(this->color(), | 829 GrQuadEffect::Create(this->color(), |
830 *geometryProcessorViewM, | 830 *geometryProcessorViewM, |
831 kHairlineAA_GrProcessorEdgeType, | 831 kHairlineAA_GrProcessorEdgeType, |
832 batchTarget->caps(), | 832 batchTarget->caps(), |
833 *geometryProcessorLocalM, | 833 *geometryProcessorLocalM, |
834 this->usesLocalCoords(), | 834 this->usesLocalCoords(), |
835 this->coverage())); | 835 this->coverage())); |
836 | 836 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 GrColor color = GrRandomColor(random); | 1000 GrColor color = GrRandomColor(random); |
1001 SkMatrix viewMatrix = GrTest::TestMatrix(random); | 1001 SkMatrix viewMatrix = GrTest::TestMatrix(random); |
1002 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); | 1002 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); |
1003 SkPath path = GrTest::TestPath(random); | 1003 SkPath path = GrTest::TestPath(random); |
1004 SkIRect devClipBounds; | 1004 SkIRect devClipBounds; |
1005 devClipBounds.setEmpty(); | 1005 devClipBounds.setEmpty(); |
1006 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; | 1006 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds)
; |
1007 } | 1007 } |
1008 | 1008 |
1009 #endif | 1009 #endif |
OLD | NEW |