1 /*
2  * Copyright 2014 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 // DO NOT USE -- FOR INTERNAL TESTING ONLY
10 
11 #ifndef sk_paint_DEFINED
12 #define sk_paint_DEFINED
13 
14 #include "sk_types.h"
15 
16 SK_C_PLUS_PLUS_BEGIN_GUARD
17 
18 sk_paint_t* sk_paint_new();
19 void sk_paint_delete(sk_paint_t*);
20 
21 bool sk_paint_is_antialias(const sk_paint_t*);
22 void sk_paint_set_antialias(sk_paint_t*, bool);
23 
24 sk_color_t sk_paint_get_color(const sk_paint_t*);
25 void sk_paint_set_color(sk_paint_t*, sk_color_t);
26 
27 /* stroke settings */
28 
29 bool sk_paint_is_stroke(const sk_paint_t*);
30 void sk_paint_set_stroke(sk_paint_t*, bool);
31 
32 float sk_paint_get_stroke_width(const sk_paint_t*);
33 void sk_paint_set_stroke_width(sk_paint_t*, float width);
34 
35 float sk_paint_get_stroke_miter(const sk_paint_t*);
36 void sk_paint_set_stroke_miter(sk_paint_t*, float miter);
37 
38 typedef enum {
39     BUTT_SK_STROKE_CAP,
40     ROUND_SK_STROKE_CAP,
41     SQUARE_SK_STROKE_CAP
42 } sk_stroke_cap_t;
43 
44 sk_stroke_cap_t sk_paint_get_stroke_cap(const sk_paint_t*);
45 void sk_paint_set_stroke_cap(sk_paint_t*, sk_stroke_cap_t);
46 
47 typedef enum {
48     MITER_SK_STROKE_JOIN,
49     ROUND_SK_STROKE_JOIN,
50     BEVEL_SK_STROKE_JOIN
51 } sk_stroke_join_t;
52 
53 sk_stroke_join_t sk_paint_get_stroke_join(const sk_paint_t*);
54 void sk_paint_set_stroke_join(sk_paint_t*, sk_stroke_join_t);
55 
56 /**
57  *  Set the paint's shader to the specified parameter. This will automatically call unref() on
58  *  any previous value, and call ref() on the new value.
59  */
60 void sk_paint_set_shader(sk_paint_t*, sk_shader_t*);
61 
62 /**
63  *  Set the paint's maskfilter to the specified parameter. This will automatically call unref() on
64  *  any previous value, and call ref() on the new value.
65  */
66 void sk_paint_set_maskfilter(sk_paint_t*, sk_maskfilter_t*);
67 
68 SK_C_PLUS_PLUS_END_GUARD
69 
70 #endif
71