aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/c
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2014-12-23 14:11:11 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-23 14:11:11 -0800
commit0eafc9b06cbfd47e9c3471c82580790cef0fdae5 (patch)
treedeecffd9c2d96453dd8f4ba348762718ec61d077 /include/c
parent0e9ab4e3db33d91c8c8ab4d1af5fb8e56602189f (diff)
add maskfilter to c api
BUG=skia: TBR= Review URL: https://codereview.chromium.org/822053002
Diffstat (limited to 'include/c')
-rw-r--r--include/c/sk_maskfilter.h32
-rw-r--r--include/c/sk_paint.h6
-rw-r--r--include/c/sk_types.h1
3 files changed, 39 insertions, 0 deletions
diff --git a/include/c/sk_maskfilter.h b/include/c/sk_maskfilter.h
new file mode 100644
index 0000000000..ce38605a85
--- /dev/null
+++ b/include/c/sk_maskfilter.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
+// DO NOT USE -- FOR INTERNAL TESTING ONLY
+
+#ifndef sk_maskfilter_DEFINED
+#define sk_maskfilter_DEFINED
+
+#include "sk_types.h"
+
+typedef enum {
+ NORMAL_SK_BLUR_STYLE, //!< fuzzy inside and outside
+ SOLID_SK_BLUR_STYLE, //!< solid inside, fuzzy outside
+ OUTER_SK_BLUR_STYLE, //!< nothing inside, fuzzy outside
+ INNER_SK_BLUR_STYLE, //!< fuzzy inside, nothing outside
+} sk_blurstyle_t;
+
+SK_C_PLUS_PLUS_BEGIN_GUARD
+
+void sk_maskfilter_ref(sk_maskfilter_t*);
+void sk_maskfilter_unref(sk_maskfilter_t*);
+
+sk_maskfilter_t* sk_maskfilter_new_blur(sk_blurstyle_t, float sigma);
+
+SK_C_PLUS_PLUS_END_GUARD
+
+#endif
diff --git a/include/c/sk_paint.h b/include/c/sk_paint.h
index 92ac5d57ba..e6b5cbdb82 100644
--- a/include/c/sk_paint.h
+++ b/include/c/sk_paint.h
@@ -30,6 +30,12 @@ void sk_paint_set_color(sk_paint_t*, sk_color_t);
*/
void sk_paint_set_shader(sk_paint_t*, sk_shader_t*);
+/**
+ * Set the paint's maskfilter to the specified parameter. This will automatically call unref() on
+ * any previous value, and call ref() on the new value.
+ */
+void sk_paint_set_maskfilter(sk_paint_t*, sk_maskfilter_t*);
+
SK_C_PLUS_PLUS_END_GUARD
#endif
diff --git a/include/c/sk_types.h b/include/c/sk_types.h
index f5f4b578fc..67a29dcb5e 100644
--- a/include/c/sk_types.h
+++ b/include/c/sk_types.h
@@ -80,6 +80,7 @@ typedef struct {
typedef struct sk_canvas_t sk_canvas_t;
typedef struct sk_image_t sk_image_t;
+typedef struct sk_maskfilter_t sk_maskfilter_t;
typedef struct sk_paint_t sk_paint_t;
typedef struct sk_picture_t sk_picture_t;
typedef struct sk_picture_recorder_t sk_picture_recorder_t;