| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL | 8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL |
| 9 // DO NOT USE -- FOR INTERNAL TESTING ONLY | 9 // DO NOT USE -- FOR INTERNAL TESTING ONLY |
| 10 | 10 |
| 11 #ifndef sk_path_DEFINED | 11 #ifndef sk_path_DEFINED |
| 12 #define sk_path_DEFINED | 12 #define sk_path_DEFINED |
| 13 | 13 |
| 14 #include "sk_types.h" | 14 #include "sk_types.h" |
| 15 | 15 |
| 16 SK_C_PLUS_PLUS_BEGIN_GUARD | 16 SK_C_PLUS_PLUS_BEGIN_GUARD |
| 17 | 17 |
| 18 typedef enum { | 18 typedef enum { |
| 19 CW_SK_PATH_DIRECTION, | 19 CW_SK_PATH_DIRECTION, |
| 20 CCW_SK_PATH_DIRECTION, | 20 CCW_SK_PATH_DIRECTION, |
| 21 } sk_path_direction_t; | 21 } sk_path_direction_t; |
| 22 | 22 |
| 23 sk_path_t* sk_path_new(); | 23 SK_API sk_path_t* sk_path_new(); |
| 24 void sk_path_delete(sk_path_t*); | 24 SK_API void sk_path_delete(sk_path_t*); |
| 25 | 25 |
| 26 void sk_path_move_to(sk_path_t*, float x, float y); | 26 SK_API void sk_path_move_to(sk_path_t*, float x, float y); |
| 27 void sk_path_line_to(sk_path_t*, float x, float y); | 27 SK_API void sk_path_line_to(sk_path_t*, float x, float y); |
| 28 void sk_path_quad_to(sk_path_t*, float x0, float y0, float x1, float y1); | 28 SK_API void sk_path_quad_to(sk_path_t*, float x0, float y0, float x1, float y1); |
| 29 void sk_path_conic_to(sk_path_t*, float x0, float y0, float x1, float y1, float
w); | 29 SK_API void sk_path_conic_to(sk_path_t*, float x0, float y0, float x1, float y1,
float w); |
| 30 void sk_path_cubic_to(sk_path_t*, float x0, float y0, float x1, float y1, float
x2, float y2); | 30 SK_API void sk_path_cubic_to(sk_path_t*, |
| 31 void sk_path_close(sk_path_t*); | 31 float x0, float y0, |
| 32 float x1, float y1, |
| 33 float x2, float y2); |
| 34 SK_API void sk_path_close(sk_path_t*); |
| 32 | 35 |
| 33 void sk_path_add_rect(sk_path_t*, const sk_rect_t*, sk_path_direction_t); | 36 SK_API void sk_path_add_rect(sk_path_t*, const sk_rect_t*, sk_path_direction_t); |
| 34 void sk_path_add_oval(sk_path_t*, const sk_rect_t*, sk_path_direction_t); | 37 SK_API void sk_path_add_oval(sk_path_t*, const sk_rect_t*, sk_path_direction_t); |
| 35 | 38 |
| 36 /** | 39 /** |
| 37 * If the path is empty, return false and set the rect parameter to [0, 0, 0, 0
]. | 40 * If the path is empty, return false and set the rect parameter to [0, 0, 0, 0
]. |
| 38 * else return true and set the rect parameter to the bounds of the control-poi
nts | 41 * else return true and set the rect parameter to the bounds of the control-poi
nts |
| 39 * of the path. | 42 * of the path. |
| 40 */ | 43 */ |
| 41 bool sk_path_get_bounds(const sk_path_t*, sk_rect_t*); | 44 SK_API bool sk_path_get_bounds(const sk_path_t*, sk_rect_t*); |
| 42 | 45 |
| 43 SK_C_PLUS_PLUS_END_GUARD | 46 SK_C_PLUS_PLUS_END_GUARD |
| 44 | 47 |
| 45 #endif | 48 #endif |
| OLD | NEW |