blob: 6699fb4f6f7fdd206d813112289d8c6dbba1fdc9 [file] [log] [blame]
reed73c25012014-11-17 06:15:42 -08001/*
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
16SK_C_PLUS_PLUS_BEGIN_GUARD
17
halcanary219f18f2015-09-01 10:01:38 -070018SK_API sk_paint_t* sk_paint_new();
19SK_API void sk_paint_delete(sk_paint_t*);
reedafa278e2014-11-24 19:11:48 -080020
halcanary219f18f2015-09-01 10:01:38 -070021SK_API bool sk_paint_is_antialias(const sk_paint_t*);
22SK_API void sk_paint_set_antialias(sk_paint_t*, bool);
reedafa278e2014-11-24 19:11:48 -080023
halcanary219f18f2015-09-01 10:01:38 -070024SK_API sk_color_t sk_paint_get_color(const sk_paint_t*);
25SK_API void sk_paint_set_color(sk_paint_t*, sk_color_t);
reed73c25012014-11-17 06:15:42 -080026
reedf5872d22015-01-10 17:59:31 -080027/* stroke settings */
28
halcanary219f18f2015-09-01 10:01:38 -070029SK_API bool sk_paint_is_stroke(const sk_paint_t*);
30SK_API void sk_paint_set_stroke(sk_paint_t*, bool);
reedf5872d22015-01-10 17:59:31 -080031
halcanary219f18f2015-09-01 10:01:38 -070032SK_API float sk_paint_get_stroke_width(const sk_paint_t*);
33SK_API void sk_paint_set_stroke_width(sk_paint_t*, float width);
reedf5872d22015-01-10 17:59:31 -080034
halcanary219f18f2015-09-01 10:01:38 -070035SK_API float sk_paint_get_stroke_miter(const sk_paint_t*);
36SK_API void sk_paint_set_stroke_miter(sk_paint_t*, float miter);
reedf5872d22015-01-10 17:59:31 -080037
38typedef enum {
39 BUTT_SK_STROKE_CAP,
40 ROUND_SK_STROKE_CAP,
41 SQUARE_SK_STROKE_CAP
42} sk_stroke_cap_t;
43
halcanary219f18f2015-09-01 10:01:38 -070044SK_API sk_stroke_cap_t sk_paint_get_stroke_cap(const sk_paint_t*);
45SK_API void sk_paint_set_stroke_cap(sk_paint_t*, sk_stroke_cap_t);
reedf5872d22015-01-10 17:59:31 -080046
47typedef enum {
48 MITER_SK_STROKE_JOIN,
49 ROUND_SK_STROKE_JOIN,
50 BEVEL_SK_STROKE_JOIN
51} sk_stroke_join_t;
52
halcanary219f18f2015-09-01 10:01:38 -070053SK_API sk_stroke_join_t sk_paint_get_stroke_join(const sk_paint_t*);
54SK_API void sk_paint_set_stroke_join(sk_paint_t*, sk_stroke_join_t);
reedf5872d22015-01-10 17:59:31 -080055
reedafa278e2014-11-24 19:11:48 -080056/**
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 */
halcanary219f18f2015-09-01 10:01:38 -070060SK_API void sk_paint_set_shader(sk_paint_t*, sk_shader_t*);
reedafa278e2014-11-24 19:11:48 -080061
reed0eafc9b2014-12-23 14:11:11 -080062/**
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 */
halcanary219f18f2015-09-01 10:01:38 -070066SK_API void sk_paint_set_maskfilter(sk_paint_t*, sk_maskfilter_t*);
reed0eafc9b2014-12-23 14:11:11 -080067
halcanary7568d0b2015-07-31 13:38:06 -070068/**
69 * Set the paint's xfermode to the specified parameter.
70 */
halcanary219f18f2015-09-01 10:01:38 -070071SK_API void sk_paint_set_xfermode_mode(sk_paint_t*, sk_xfermode_mode_t);
halcanary7568d0b2015-07-31 13:38:06 -070072
reed73c25012014-11-17 06:15:42 -080073SK_C_PLUS_PLUS_END_GUARD
74
75#endif