8 #ifndef SkStrokeRec_DEFINED
9 #define SkStrokeRec_DEFINED
12 #include "include/private/base/SkMacros.h"
16 SK_BEGIN_REQUIRE_DENSE
34 static constexpr
int kStyleCount = kStrokeAndFill_Style + 1;
43 return kHairline_Style == this->getStyle();
47 return kFill_Style == this->getStyle();
63 fMiterLimit = miterLimit;
80 Style style = this->getStyle();
81 return (kStroke_Style == style) || (kStrokeAndFill_Style == style);
126 if (!this->needToApply()) {
127 return this->getStyle() == other.
getStyle();
129 return fWidth == other.fWidth &&
131 fCap == other.fCap &&
132 fJoin == other.fJoin &&
133 fStrokeAndFill == other.fStrokeAndFill;
150 uint32_t fStrokeAndFill : 1;
static bool SkScalarIsFinite(SkScalar x)
Returns true if x is not NaN and not infinite.
Definition: SkScalar.h:68
float SkScalar
Definition: SkScalar.h:14
SkPaint controls options applied when drawing.
Definition: SkPaint.h:44
Cap
Definition: SkPaint.h:333
Style
Definition: SkPaint.h:192
Join
Definition: SkPaint.h:358
@ kMiter_Join
extends to miter limit
Definition: SkPaint.h:359
SkPath contain geometry.
Definition: SkPath.h:58
Definition: SkStrokeRec.h:17
InitStyle
Definition: SkStrokeRec.h:19
@ kHairline_InitStyle
Definition: SkStrokeRec.h:20
bool needToApply() const
Returns true if this specifes any thick stroking, i.e.
Definition: SkStrokeRec.h:79
SkStrokeRec(const SkPaint &, SkScalar resScale=1)
Style
Definition: SkStrokeRec.h:27
@ kHairline_Style
Definition: SkStrokeRec.h:28
@ kFill_Style
Definition: SkStrokeRec.h:29
@ kStroke_Style
Definition: SkStrokeRec.h:30
void setStrokeStyle(SkScalar width, bool strokeAndFill=false)
Specify the strokewidth, and optionally if you want stroke + fill.
static SkScalar GetInflationRadius(const SkPaint &, SkPaint::Style)
Equivalent to: SkStrokeRec rec(paint, style); rec.getInflationRadius(); This does not account for oth...
static SkScalar GetInflationRadius(SkPaint::Join, SkScalar miterLimit, SkPaint::Cap, SkScalar strokeWidth)
SkScalar getInflationRadius() const
Gives a conservative value for the outset that should applied to a geometries bounds to account for a...
bool hasEqualEffect(const SkStrokeRec &other) const
Compare if two SkStrokeRecs have an equal effect on a path.
Definition: SkStrokeRec.h:125
bool isHairlineStyle() const
Definition: SkStrokeRec.h:42
SkStrokeRec(InitStyle style)
bool applyToPath(SkPath *dst, const SkPath &src) const
Apply these stroke parameters to the src path, returning the result in dst.
SkScalar getWidth() const
Definition: SkStrokeRec.h:37
void setStrokeParams(SkPaint::Cap cap, SkPaint::Join join, SkScalar miterLimit)
Definition: SkStrokeRec.h:60
SkPaint::Join getJoin() const
Definition: SkStrokeRec.h:40
SkPaint::Cap getCap() const
Definition: SkStrokeRec.h:39
SkScalar getResScale() const
Definition: SkStrokeRec.h:66
SkStrokeRec(const SkPaint &, SkPaint::Style, SkScalar resScale=1)
void setResScale(SkScalar rs)
Definition: SkStrokeRec.h:70
bool isFillStyle() const
Definition: SkStrokeRec.h:46
void applyToPaint(SkPaint *paint) const
Apply these stroke parameters to a paint.
SkScalar getMiter() const
Definition: SkStrokeRec.h:38