8 #ifndef SkStrokeRec_DEFINED
9 #define SkStrokeRec_DEFINED
15 SK_BEGIN_REQUIRE_DENSE
33 kStyleCount = kStrokeAndFill_Style + 1
36 Style getStyle()
const;
37 SkScalar getWidth()
const {
return fWidth; }
38 SkScalar getMiter()
const {
return fMiterLimit; }
42 bool isHairlineStyle()
const {
43 return kHairline_Style == this->getStyle();
46 bool isFillStyle()
const {
47 return kFill_Style == this->getStyle();
51 void setHairlineStyle();
63 fMiterLimit = miterLimit;
66 SkScalar getResScale()
const {
70 void setResScale(SkScalar rs) {
71 SkASSERT(rs > 0 && SkScalarIsFinite(rs));
80 Style style = this->getStyle();
81 return (kStroke_Style == style) || (kStrokeAndFill_Style == style);
124 return this->getStyle() == other.getStyle();
126 return fWidth == other.fWidth &&
127 fMiterLimit == other.fMiterLimit &&
128 fCap == other.fCap &&
129 fJoin == other.fJoin &&
130 fStrokeAndFill == other.fStrokeAndFill;
138 SkScalar fMiterLimit;
147 uint32_t fStrokeAndFill : 1;
The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line...
Definition: SkPath.h:25
Definition: SkStrokeRec.h:16
Cap
Cap enum specifies the settings for the paint's strokecap.
Definition: SkPaint.h:392
The SkPaint class holds the style and color information about how to draw geometries, text and bitmaps.
Definition: SkPaint.h:45
bool applyToPath(SkPath *dst, const SkPath &src) const
Apply these stroke parameters to the src path, returning the result in dst.
Join
Join enum specifies the settings for the paint's strokejoin.
Definition: SkPaint.h:405
void setStrokeStyle(SkScalar width, bool strokeAndFill=false)
Specify the strokewidth, and optionally if you want stroke + fill.
bool needToApply() const
Returns true if this specifes any thick stroking, i.e.
Definition: SkStrokeRec.h:79
static SkScalar GetInflationRadius(const SkPaint &, SkPaint::Style)
Equivalent to: SkStrokeRec rec(paint, style); rec.getInflationRadius(); This does not account for oth...
Style
Styles apply to rect, oval, path, and text.
Definition: SkPaint.h:289
SkScalar getInflationRadius() const
Gives a conservative value for the outset that should applied to a geometries bounds to account for a...
void applyToPaint(SkPaint *paint) const
Apply these stroke parameters to a paint.
bool hasEqualEffect(const SkStrokeRec &other) const
Compare if two SkStrokeRecs have an equal effect on a path.
Definition: SkStrokeRec.h:122