OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrAARectRenderer.h" | 8 #include "GrAARectRenderer.h" |
9 #include "GrGpu.h" | 9 #include "GrGpu.h" |
10 #include "gl/GrGLEffect.h" | 10 #include "gl/GrGLEffect.h" |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 { | 752 { |
753 SkScalar w = devRect.width() - dx; | 753 SkScalar w = devRect.width() - dx; |
754 SkScalar h = devRect.height() - dy; | 754 SkScalar h = devRect.height() - dy; |
755 spare = SkTMin(w, h); | 755 spare = SkTMin(w, h); |
756 } | 756 } |
757 | 757 |
758 SkRect devOutside(devRect); | 758 SkRect devOutside(devRect); |
759 devOutside.outset(rx, ry); | 759 devOutside.outset(rx, ry); |
760 | 760 |
761 bool miterStroke = true; | 761 bool miterStroke = true; |
| 762 // For hairlines, make bevel and round joins appear the same as mitered ones
. |
762 // small miter limit means right angles show bevel... | 763 // small miter limit means right angles show bevel... |
763 if (stroke.getJoin() != SkPaint::kMiter_Join || stroke.getMiter() < SK_Scala
rSqrt2) { | 764 if ((width > 0) && (stroke.getJoin() != SkPaint::kMiter_Join || |
| 765 stroke.getMiter() < SK_ScalarSqrt2)) { |
764 miterStroke = false; | 766 miterStroke = false; |
765 } | 767 } |
766 | 768 |
767 if (spare <= 0 && miterStroke) { | 769 if (spare <= 0 && miterStroke) { |
768 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), | 770 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), |
769 devOutside, useVertexCoverage); | 771 devOutside, useVertexCoverage); |
770 return; | 772 return; |
771 } | 773 } |
772 | 774 |
773 SkRect devInside(devRect); | 775 SkRect devInside(devRect); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; | 922 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2)
; |
921 | 923 |
922 if (devInside.isEmpty()) { | 924 if (devInside.isEmpty()) { |
923 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use
VertexCoverage); | 925 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use
VertexCoverage); |
924 return; | 926 return; |
925 } | 927 } |
926 | 928 |
927 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, | 929 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, |
928 devInside, useVertexCoverage, true); | 930 devInside, useVertexCoverage, true); |
929 } | 931 } |
OLD | NEW |