| 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 | 7 |
| 8 #ifndef SkStroke_DEFINED | 8 #ifndef SkStroke_DEFINED |
| 9 #define SkStroke_DEFINED | 9 #define SkStroke_DEFINED |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #if QUAD_STROKE_APPROXIMATION | 46 #if QUAD_STROKE_APPROXIMATION |
| 47 void setError(SkScalar); | 47 void setError(SkScalar); |
| 48 #endif | 48 #endif |
| 49 void setMiterLimit(SkScalar); | 49 void setMiterLimit(SkScalar); |
| 50 void setWidth(SkScalar); | 50 void setWidth(SkScalar); |
| 51 | 51 |
| 52 bool getDoFill() const { return SkToBool(fDoFill); } | 52 bool getDoFill() const { return SkToBool(fDoFill); } |
| 53 void setDoFill(bool doFill) { fDoFill = SkToU8(doFill); } | 53 void setDoFill(bool doFill) { fDoFill = SkToU8(doFill); } |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * ResScale is the "intended" resolution for the output. |
| 57 * Default is 1.0. |
| 58 * Larger values (res > 1) indicate that the result should be more prec
ise, since it will |
| 59 * be zoomed up, and small errors will be magnified. |
| 60 * Smaller values (0 < res < 1) indicate that the result can be less pr
ecise, since it will |
| 61 * be zoomed down, and small errors may be invisible. |
| 62 */ |
| 63 SkScalar getResScale() const { return fResScale; } |
| 64 void setResScale(SkScalar rs) { |
| 65 SkASSERT(rs > 0 && SkScalarIsFinite(rs)); |
| 66 fResScale = rs; |
| 67 } |
| 68 |
| 69 /** |
| 56 * Stroke the specified rect, winding it in the specified direction.. | 70 * Stroke the specified rect, winding it in the specified direction.. |
| 57 */ | 71 */ |
| 58 void strokeRect(const SkRect& rect, SkPath* result, | 72 void strokeRect(const SkRect& rect, SkPath* result, |
| 59 SkPath::Direction = SkPath::kCW_Direction) const; | 73 SkPath::Direction = SkPath::kCW_Direction) const; |
| 60 void strokePath(const SkPath& path, SkPath*) const; | 74 void strokePath(const SkPath& path, SkPath*) const; |
| 61 | 75 |
| 62 //////////////////////////////////////////////////////////////// | 76 //////////////////////////////////////////////////////////////// |
| 63 | 77 |
| 64 private: | 78 private: |
| 65 #if QUAD_STROKE_APPROXIMATION | 79 #if QUAD_STROKE_APPROXIMATION |
| 66 SkScalar fError; | 80 SkScalar fError; |
| 67 #endif | 81 #endif |
| 68 SkScalar fWidth, fMiterLimit; | 82 SkScalar fWidth, fMiterLimit; |
| 83 SkScalar fResScale; |
| 69 uint8_t fCap, fJoin; | 84 uint8_t fCap, fJoin; |
| 70 SkBool8 fDoFill; | 85 SkBool8 fDoFill; |
| 71 | 86 |
| 72 friend class SkPaint; | 87 friend class SkPaint; |
| 73 }; | 88 }; |
| 74 | 89 |
| 75 #endif | 90 #endif |
| OLD | NEW |