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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->getCoverageColor(), &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 = 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 |
773 bool GrAAHairLinePathRenderer::createBezierGeom( | 773 bool GrAAHairLinePathRenderer::createBezierGeom( |
774 const SkPath& path, | 774 const SkPath& path, |
775 GrDrawTarget* target, | 775 GrDrawTarget* target, |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 &devBounds); | 1042 &devBounds); |
1043 conics += n; | 1043 conics += n; |
1044 } | 1044 } |
1045 } | 1045 } |
1046 } | 1046 } |
1047 | 1047 |
1048 target->resetIndexSource(); | 1048 target->resetIndexSource(); |
1049 | 1049 |
1050 return true; | 1050 return true; |
1051 } | 1051 } |
OLD | NEW |