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 "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 const SkMatrix* toSrc = NULL; | 752 const SkMatrix* toSrc = NULL; |
753 SkMatrix ivm; | 753 SkMatrix ivm; |
754 | 754 |
755 if (viewM.hasPerspective()) { | 755 if (viewM.hasPerspective()) { |
756 if (viewM.invert(&ivm)) { | 756 if (viewM.invert(&ivm)) { |
757 toSrc = &ivm; | 757 toSrc = &ivm; |
758 } | 758 } |
759 } | 759 } |
760 devBounds->set(lines.begin(), lines.count()); | 760 devBounds->set(lines.begin(), lines.count()); |
761 for (int i = 0; i < lineCnt; ++i) { | 761 for (int i = 0; i < lineCnt; ++i) { |
762 add_line(&lines[2*i], toSrc, drawState->getCoverageColor(), &verts); | 762 add_line(&lines[2*i], toSrc, drawState->getCoverage(), &verts); |
763 } | 763 } |
764 // All the verts computed by add_line are within sqrt(1^2 + 0.5^2) of the en
d points. | 764 // All the verts computed by add_line are within sqrt(1^2 + 0.5^2) of the en
d points. |
765 static const SkScalar kSqrtOfOneAndAQuarter = SkFloatToScalar(1.118f); | 765 static const SkScalar kSqrtOfOneAndAQuarter = SkFloatToScalar(1.118f); |
766 // Add a little extra to account for vector normalization precision. | 766 // Add a little extra to account for vector normalization precision. |
767 static const SkScalar kOutset = kSqrtOfOneAndAQuarter + SK_Scalar1 / 20; | 767 static const SkScalar kOutset = kSqrtOfOneAndAQuarter + SK_Scalar1 / 20; |
768 devBounds->outset(kOutset, kOutset); | 768 devBounds->outset(kOutset, kOutset); |
769 | 769 |
770 return true; | 770 return true; |
771 } | 771 } |
772 | 772 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1028 &devBounds); | 1028 &devBounds); |
1029 conics += n; | 1029 conics += n; |
1030 } | 1030 } |
1031 } | 1031 } |
1032 } | 1032 } |
1033 | 1033 |
1034 target->resetIndexSource(); | 1034 target->resetIndexSource(); |
1035 | 1035 |
1036 return true; | 1036 return true; |
1037 } | 1037 } |
OLD | NEW |