39 path.setFillType(fill);
41 paint.setStrokeCap(cap);
43 paint.setStrokeJoin(join);
45 paint.setStyle(style);
57 constexpr FillAndName gFills[] = {
67 constexpr StyleAndName
gStyles[] = {
77 constexpr CapAndName gCaps[] = {
90 path.fName =
"moveTo-quad";
96 const char title[] =
"Quad Drawn Into Rectangle Clips With "
97 "Indicated Style, Fill and Linecaps, with stroke width 10";
98 canvas->
drawString(title, 20.0f, 20.0f, font, titlePaint);
105 for (
size_t cap = 0; cap < std::size(gCaps); ++cap) {
110 for (
size_t fill = 0; fill < std::size(gFills); ++fill) {
115 for (
size_t style = 0; style < std::size(
gStyles); ++style) {
122 gCaps[cap].fCap, gCaps[cap].fJoin,
gStyles[style].fStyle,
135 labelFont, labelPaint);
137 labelFont, labelPaint);
139 labelFont, labelPaint);
150 using INHERITED =
GM;
166 path.setFillType(fill);
168 paint.setStrokeCap(cap);
170 paint.setStrokeJoin(join);
172 paint.setStyle(style);
184 constexpr FillAndName gFills[] = {
190 struct StyleAndName {
194 constexpr StyleAndName
gStyles[] = {
204 constexpr CapAndName gCaps[] = {
218 path.fName =
"moveTo-quad-close";
223 const char title[] =
"Quad Closed Drawn Into Rectangle Clips With "
224 "Indicated Style, Fill and Linecaps, with stroke width 10";
225 canvas->
drawString(title, 20.0f, 20.0f, font, titlePaint);
232 for (
size_t cap = 0; cap < std::size(gCaps); ++cap) {
237 for (
size_t fill = 0; fill < std::size(gFills); ++fill) {
242 for (
size_t style = 0; style < std::size(
gStyles); ++style) {
249 gCaps[cap].fCap, gCaps[cap].fJoin,
gStyles[style].fStyle,
262 labelFont, labelPaint);
264 labelFont, labelPaint);
266 labelFont, labelPaint);
277 using INHERITED =
GM;
282DEF_GM(
return new QuadPathGM; )
284DEF_GM(
return new QuadClosePathGM; )
SkStrokeRec::Style fStyle
static const int strokeWidth
constexpr SkColor SK_ColorBLACK
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
@ kButt_Cap
no stroke extension
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
@ kBevel_Join
connects outside edges
void setStrokeWidth(SkScalar width)
void onDraw(SkCanvas *canvas) override
SkString getName() const override
void drawPath(SkPath &path, SkCanvas *canvas, SkColor color, const SkRect &clip, SkPaint::Cap cap, SkPaint::Join join, SkPaint::Style style, SkPathFillType fill, SkScalar strokeWidth)
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
SkISize getISize() override
void drawPath(SkPath &path, SkCanvas *canvas, SkColor color, const SkRect &clip, SkPaint::Cap cap, SkPaint::Join join, SkPaint::Style style, SkPathFillType fill, SkScalar strokeWidth)
static constexpr SkISize Make(int32_t w, int32_t h)
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkFontStyle gStyles[]