2 * Copyright 2014 Google Inc.
3 * Copyright 2015 Xamarin Inc.
4 * Copyright 2017 Microsoft Corporation. All rights reserved.
6 * Use of this source code is governed by a BSD-style license that can be
7 * found in the LICENSE file.
10 #ifndef sk_shader_DEFINED
11 #define sk_shader_DEFINED
15 SK_C_PLUS_PLUS_BEGIN_GUARD
17 SK_C_API void sk_shader_ref(sk_shader_t*);
18 SK_C_API void sk_shader_unref(sk_shader_t*);
19 SK_C_API sk_shader_t* sk_shader_new_linear_gradient(const sk_point_t points[2],
20 const sk_color_t colors[],
21 const float colorPos[],
23 sk_shader_tilemode_t tileMode,
24 const sk_matrix_t* localMatrix);
25 SK_C_API sk_shader_t* sk_shader_new_radial_gradient(const sk_point_t* center,
27 const sk_color_t colors[],
28 const float colorPos[],
30 sk_shader_tilemode_t tileMode,
31 const sk_matrix_t* localMatrix);
32 SK_C_API sk_shader_t* sk_shader_new_sweep_gradient(const sk_point_t* center,
33 const sk_color_t colors[],
34 const float colorPos[],
36 const sk_matrix_t* localMatrix);
37 SK_C_API sk_shader_t* sk_shader_new_two_point_conical_gradient(
38 const sk_point_t* start,
40 const sk_point_t* end,
42 const sk_color_t colors[],
43 const float colorPos[],
45 sk_shader_tilemode_t tileMode,
46 const sk_matrix_t* localMatrix);
47 SK_C_API sk_shader_t* sk_shader_new_empty(void);
48 SK_C_API sk_shader_t* sk_shader_new_color(sk_color_t color);
49 SK_C_API sk_shader_t* sk_shader_new_bitmap(const sk_bitmap_t* src,
50 sk_shader_tilemode_t tmx,
51 sk_shader_tilemode_t tmy,
52 const sk_matrix_t* localMatrix);
53 SK_C_API sk_shader_t* sk_shader_new_picture(sk_picture_t* src,
54 sk_shader_tilemode_t tmx,
55 sk_shader_tilemode_t tmy,
56 const sk_matrix_t* localMatrix,
57 const sk_rect_t* tile);
58 SK_C_API sk_shader_t* sk_shader_new_local_matrix(sk_shader_t* proxy, const sk_matrix_t* localMatrix);
59 SK_C_API sk_shader_t* sk_shader_new_color_filter(sk_shader_t* proxy, sk_colorfilter_t* filter);
60 SK_C_API sk_shader_t* sk_shader_new_perlin_noise_fractal_noise(
65 const sk_isize_t* tileSize);
66 SK_C_API sk_shader_t* sk_shader_new_perlin_noise_turbulence(
71 const sk_isize_t* tileSize);
72 SK_C_API sk_shader_t* sk_shader_new_compose(
74 sk_shader_t* shaderB);
75 SK_C_API sk_shader_t* sk_shader_new_compose_with_mode(
80 SK_C_PLUS_PLUS_END_GUARD