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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
755 SkScalar spare; | 755 SkScalar spare; |
756 { | 756 { |
757 SkScalar w = devRect.width() - dx; | 757 SkScalar w = devRect.width() - dx; |
758 SkScalar h = devRect.height() - dy; | 758 SkScalar h = devRect.height() - dy; |
759 spare = SkTMin(w, h); | 759 spare = SkTMin(w, h); |
760 } | 760 } |
761 | 761 |
762 SkRect devOutside(devRect); | 762 SkRect devOutside(devRect); |
763 devOutside.outset(rx, ry); | 763 devOutside.outset(rx, ry); |
764 | 764 |
765 bool miterStroke = true; | 765 bool miterStroke = true; |
robertphillips
2014/07/28 19:31:30
I think you comment might be better stated as:
//
| |
766 // bevel or round hairline rects show the same as miter haireline rects. | |
766 // small miter limit means right angles show bevel... | 767 // small miter limit means right angles show bevel... |
767 if (stroke.getJoin() != SkPaint::kMiter_Join || stroke.getMiter() < SK_Scala rSqrt2) { | 768 if ((width > 0) && (stroke.getJoin() != SkPaint::kMiter_Join || |
769 stroke.getMiter() < SK_ScalarSqrt2)) { | |
768 miterStroke = false; | 770 miterStroke = false; |
769 } | 771 } |
770 | 772 |
771 if (spare <= 0 && miterStroke) { | 773 if (spare <= 0 && miterStroke) { |
772 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), | 774 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), |
773 devOutside, useVertexCoverage); | 775 devOutside, useVertexCoverage); |
774 return; | 776 return; |
775 } | 777 } |
776 | 778 |
777 SkRect devInside(devRect); | 779 SkRect devInside(devRect); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
924 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ; | 926 combinedMatrix.mapPoints((SkPoint*)&devInside, (const SkPoint*)&rects[1], 2) ; |
925 | 927 |
926 if (devInside.isEmpty()) { | 928 if (devInside.isEmpty()) { |
927 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use VertexCoverage); | 929 this->fillAARect(gpu, target, devOutside, SkMatrix::I(), devOutside, use VertexCoverage); |
928 return; | 930 return; |
929 } | 931 } |
930 | 932 |
931 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, | 933 this->geometryStrokeAARect(gpu, target, devOutside, devOutsideAssist, |
932 devInside, useVertexCoverage, true); | 934 devInside, useVertexCoverage, true); |
933 } | 935 } |
OLD | NEW |