OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 #define __STDC_LIMIT_MACROS | 7 #define __STDC_LIMIT_MACROS |
8 | 8 |
9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
10 #include "SkBlitter.h" | 10 #include "SkBlitter.h" |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 SkPath path; | 999 SkPath path; |
1000 path.addRRect(rrect); | 1000 path.addRRect(rrect); |
1001 this->drawPath(path, paint, nullptr, true); | 1001 this->drawPath(path, paint, nullptr, true); |
1002 } | 1002 } |
1003 | 1003 |
1004 SkScalar SkDraw::ComputeResScaleForStroking(const SkMatrix& matrix) { | 1004 SkScalar SkDraw::ComputeResScaleForStroking(const SkMatrix& matrix) { |
1005 if (!matrix.hasPerspective()) { | 1005 if (!matrix.hasPerspective()) { |
1006 SkScalar sx = SkPoint::Length(matrix[SkMatrix::kMScaleX], matrix[SkMatri
x::kMSkewY]); | 1006 SkScalar sx = SkPoint::Length(matrix[SkMatrix::kMScaleX], matrix[SkMatri
x::kMSkewY]); |
1007 SkScalar sy = SkPoint::Length(matrix[SkMatrix::kMSkewX], matrix[SkMatri
x::kMScaleY]); | 1007 SkScalar sy = SkPoint::Length(matrix[SkMatrix::kMSkewX], matrix[SkMatri
x::kMScaleY]); |
1008 if (SkScalarsAreFinite(sx, sy)) { | 1008 if (SkScalarsAreFinite(sx, sy)) { |
1009 return SkTMax(sx, sy); | 1009 SkScalar scale = SkTMax(sx, sy); |
| 1010 if (scale > 0) { |
| 1011 return scale; |
| 1012 } |
1010 } | 1013 } |
1011 } | 1014 } |
1012 return 1; | 1015 return 1; |
1013 } | 1016 } |
1014 | 1017 |
1015 void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC
overage, | 1018 void SkDraw::drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawC
overage, |
1016 SkBlitter* customBlitter, bool doFill) const { | 1019 SkBlitter* customBlitter, bool doFill) const { |
1017 SkBlitter* blitter = nullptr; | 1020 SkBlitter* blitter = nullptr; |
1018 SkAutoBlitterChoose blitterStorage; | 1021 SkAutoBlitterChoose blitterStorage; |
1019 if (nullptr == customBlitter) { | 1022 if (nullptr == customBlitter) { |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 mask->fImage = SkMask::AllocImage(size); | 2084 mask->fImage = SkMask::AllocImage(size); |
2082 memset(mask->fImage, 0, mask->computeImageSize()); | 2085 memset(mask->fImage, 0, mask->computeImageSize()); |
2083 } | 2086 } |
2084 | 2087 |
2085 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2088 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2086 draw_into_mask(*mask, devPath, style); | 2089 draw_into_mask(*mask, devPath, style); |
2087 } | 2090 } |
2088 | 2091 |
2089 return true; | 2092 return true; |
2090 } | 2093 } |
OLD | NEW |