38 path.setFillType(fill);
41 paint.setStyle(style);
53 constexpr FillAndName gFills[] = {
63 constexpr StyleAndName
gStyles[] = {
70 const char title[] =
"Empty Paths Drawn Into Rectangle Clips With "
71 "Indicated Style and Fill";
80 for (
size_t style = 0; style < std::size(
gStyles); ++style) {
81 for (
size_t fill = 0; fill < std::size(gFills); ++fill) {
95 this->drawEmpty(canvas,
color, rect,
109 labelFont, labelPaint);
111 labelFont, labelPaint);
118DEF_GM(
return new EmptyPathGM; )
134 return builder.detach();
140 builder.moveTo(p).close();
142 return builder.detach();
148 builder.moveTo(p).lineTo(p);
150 return builder.detach();
166 static constexpr SkPath (*kProcs[])() = {
183 for (
auto proc : kProcs) {
185 canvas->
drawPath(proc(), strokePaint);
190DEF_GM(
return new EmptyStrokeGM; )
SkStrokeRec::Style fStyle
constexpr SkColor SK_ColorRED
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 drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
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)
@ kPoints_PointMode
draw each point separately
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setStrokeCap(Cap cap)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
@ kStrokeAndFill_Style
sets to stroke and fill geometry
void setStrokeWidth(SkScalar width)
SkPathBuilder & lineTo(SkPoint pt)
SkPathBuilder & moveTo(SkPoint pt)
SkISize getISize() override
SkString getName() const override
void onDraw(SkCanvas *canvas) override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
SkString getName() const override
static SkPath make_path_move()
static constexpr SkPoint kPts[kPtsCount]
static SkPath make_path_move_close()
static SkPath make_path_move_mix()
static SkPath make_path_move_line()
static constexpr int kPtsCount
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkFontStyle gStyles[]