Return true iff stroking is enabled rather than filling on this
sk_paint_t.
*/
-SK_API bool sk_paint_is_stroke(const sk_paint_t*);
+SK_API sk_paint_style_t sk_paint_get_style(const sk_paint_t*);
/**
Set to true to enable stroking rather than filling with this
sk_paint_t.
*/
-SK_API void sk_paint_set_stroke(sk_paint_t*, bool);
+SK_API void sk_paint_set_style(sk_paint_t*, sk_paint_style_t);
/**
Return the width for stroking. A value of 0 strokes in hairline mode.
*/
LARGE_SK_PATH_ARC_SIZE,
} sk_path_arc_size_t;
+typedef enum {
+ FILL_SK_PAINT_STYLE,
+ STROKE_SK_PAINT_STYLE,
+ STROKE_AND_FILL_SK_PAINT_STYLE,
+} sk_paint_style_t;
+
typedef struct sk_colortable_t sk_colortable_t;
typedef struct sk_pixelref_factory_t sk_pixelref_factory_t;
static_assert ((int)SkPath1DPathEffect::Style::kRotate_Style == (int)ROTATE_SK_PATH_EFFECT_1D_STYLE, ASSERT_MSG(SkPath1DPathEffect::Style, sk_path_effect_1d_style_t));
static_assert ((int)SkPath1DPathEffect::Style::kMorph_Style == (int)MORPH_SK_PATH_EFFECT_1D_STYLE, ASSERT_MSG(SkPath1DPathEffect::Style, sk_path_effect_1d_style_t));
+// sk_path_effect_1d_style_t
+static_assert ((int)SkPaint::Style::kFill_Style == (int)FILL_SK_PAINT_STYLE, ASSERT_MSG(SkPaint::Style, sk_paint_style_t));
+static_assert ((int)SkPaint::Style::kStrokeAndFill_Style == (int)STROKE_AND_FILL_SK_PAINT_STYLE, ASSERT_MSG(SkPaint::Style, sk_paint_style_t));
+static_assert ((int)SkPaint::Style::kStroke_Style == (int)STROKE_SK_PAINT_STYLE, ASSERT_MSG(SkPaint::Style, sk_paint_style_t));
+
// sk_point_mode_t
static_assert ((int)SkCanvas::PointMode::kPoints_PointMode == (int)POINTS_SK_POINT_MODE, ASSERT_MSG(SkCanvas::PointMode, sk_point_mode_t));
static_assert ((int)SkCanvas::PointMode::kLines_PointMode == (int)LINES_SK_POINT_MODE, ASSERT_MSG(SkCanvas::PointMode, sk_point_mode_t));
AsPaint(cpaint)->setMaskFilter(sk_ref_sp(AsMaskFilter(cfilter)));
}
-bool sk_paint_is_stroke(const sk_paint_t* cpaint) {
- return AsPaint(*cpaint).getStyle() != SkPaint::kFill_Style;
+sk_paint_style_t sk_paint_get_style(const sk_paint_t* cpaint) {
+ return (sk_paint_style_t)AsPaint(*cpaint).getStyle();
}
-void sk_paint_set_stroke(sk_paint_t* cpaint, bool doStroke) {
- AsPaint(cpaint)->setStyle(doStroke ? SkPaint::kStroke_Style : SkPaint::kFill_Style);
+void sk_paint_set_style(sk_paint_t* cpaint, sk_paint_style_t style) {
+ AsPaint(cpaint)->setStyle((SkPaint::Style)style);
}
float sk_paint_get_stroke_width(const sk_paint_t* cpaint) {