| 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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 const SkMatrix* geometryProcessorLocalM = &invert; | 800 const SkMatrix* geometryProcessorLocalM = &invert; |
| 801 const SkMatrix* toDevice = NULL; | 801 const SkMatrix* toDevice = NULL; |
| 802 const SkMatrix* toSrc = NULL; | 802 const SkMatrix* toSrc = NULL; |
| 803 if (hasPerspective) { | 803 if (hasPerspective) { |
| 804 geometryProcessorViewM = &this->viewMatrix(); | 804 geometryProcessorViewM = &this->viewMatrix(); |
| 805 geometryProcessorLocalM = &SkMatrix::I(); | 805 geometryProcessorLocalM = &SkMatrix::I(); |
| 806 toDevice = &this->viewMatrix(); | 806 toDevice = &this->viewMatrix(); |
| 807 toSrc = &invert; | 807 toSrc = &invert; |
| 808 } | 808 } |
| 809 | 809 |
| 810 SkAutoTUnref<const GrGeometryProcessor> lineGP; | 810 // Setup geometry processors for worst case |
| 811 { | 811 uint32_t gpFlags = GrDefaultGeoProcFactory::kPosition_GPType | |
| 812 using namespace GrDefaultGeoProcFactory; | 812 GrDefaultGeoProcFactory::kCoverage_GPType; |
| 813 | 813 |
| 814 Color color(this->color()); | 814 SkAutoTUnref<const GrGeometryProcessor> lineGP( |
| 815 Coverage coverage(Coverage::kAttribute_Type); | 815 GrDefaultGeoProcFactory::Create(gpFlags, |
| 816 LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUsePosit
ion_Type : | 816 this->color(), |
| 817 LocalCoords::kUnused_T
ype); | 817 this->usesLocalCoords(), |
| 818 localCoords.fMatrix = geometryProcessorLocalM; | 818 this->coverageIgnored(), |
| 819 lineGP.reset(GrDefaultGeoProcFactory::Create(color, coverage, localCoord
s, | 819 *geometryProcessorViewM, |
| 820 *geometryProcessorViewM)); | 820 *geometryProcessorLocalM, |
| 821 } | 821 this->coverage())); |
| 822 | 822 |
| 823 SkAutoTUnref<const GrGeometryProcessor> quadGP( | 823 SkAutoTUnref<const GrGeometryProcessor> quadGP( |
| 824 GrQuadEffect::Create(this->color(), | 824 GrQuadEffect::Create(this->color(), |
| 825 *geometryProcessorViewM, | 825 *geometryProcessorViewM, |
| 826 kHairlineAA_GrProcessorEdgeType, | 826 kHairlineAA_GrProcessorEdgeType, |
| 827 batchTarget->caps(), | 827 batchTarget->caps(), |
| 828 *geometryProcessorLocalM, | 828 *geometryProcessorLocalM, |
| 829 this->usesLocalCoords(), | 829 this->usesLocalCoords(), |
| 830 this->coverage())); | 830 this->coverage())); |
| 831 | 831 |
| (...skipping 157 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 |