 |
Skia
2D Graphics Library
|
Go to the documentation of this file.
8 #ifndef SkStrokeRec_DEFINED
9 #define SkStrokeRec_DEFINED
12 #include "include/private/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;
@ kFill_Style
Definition: SkStrokeRec.h:29
@ kMiter_Join
extends to miter limit
Definition: SkPaint.h:390
SkPaint::Cap getCap() const
Definition: SkStrokeRec.h:39
Cap
Definition: SkPaint.h:364
SkScalar getResScale() const
Definition: SkStrokeRec.h:66
SkStrokeRec(const SkPaint &, SkPaint::Style, SkScalar resScale=1)
Join
Definition: SkPaint.h:389
void setResScale(SkScalar rs)
Definition: SkStrokeRec.h:70
static SkScalar GetInflationRadius(SkPaint::Join, SkScalar miterLimit, SkPaint::Cap, SkScalar strokeWidth)
#define SK_API
Definition: SkTypes.h:181
#define SkASSERT(cond)
Definition: SkTypes.h:460
Definition: SkStrokeRec.h:17
bool hasEqualEffect(const SkStrokeRec &other) const
Compare if two SkStrokeRecs have an equal effect on a path.
Definition: SkStrokeRec.h:125
bool applyToPath(SkPath *dst, const SkPath &src) const
Apply these stroke parameters to the src path, returning the result in dst.
SkStrokeRec(InitStyle style)
bool needToApply() const
Returns true if this specifes any thick stroking, i.e.
Definition: SkStrokeRec.h:79
void applyToPaint(SkPaint *paint) const
Apply these stroke parameters to a paint.
void setStrokeStyle(SkScalar width, bool strokeAndFill=false)
Specify the strokewidth, and optionally if you want stroke + fill.
SkScalar getWidth() const
Definition: SkStrokeRec.h:37
bool isHairlineStyle() const
Definition: SkStrokeRec.h:42
void setStrokeParams(SkPaint::Cap cap, SkPaint::Join join, SkScalar miterLimit)
Definition: SkStrokeRec.h:60
float SkScalar
Definition: SkScalar.h:16
static SkScalar GetInflationRadius(const SkPaint &, SkPaint::Style)
Equivalent to: SkStrokeRec rec(paint, style); rec.getInflationRadius(); This does not account for oth...
@ kHairline_Style
Definition: SkStrokeRec.h:28
SkScalar getInflationRadius() const
Gives a conservative value for the outset that should applied to a geometries bounds to account for a...
SkPaint::Join getJoin() const
Definition: SkStrokeRec.h:40
Style
Definition: SkStrokeRec.h:27
SkScalar getMiter() const
Definition: SkStrokeRec.h:38
SkStrokeRec(const SkPaint &, SkScalar resScale=1)
@ kHairline_InitStyle
Definition: SkStrokeRec.h:20
Style
Definition: SkPaint.h:225
bool isFillStyle() const
Definition: SkStrokeRec.h:46
@ kStroke_Style
Definition: SkStrokeRec.h:30
InitStyle
Definition: SkStrokeRec.h:19
static bool SkScalarIsFinite(SkScalar x)
Returns true if x is not NaN and not infinite.
Definition: SkScalar.h:71