Skip to content

Commit

Permalink
Adding sk_path_add_rect_start to the c api.
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmes committed Apr 8, 2016
1 parent 7d7ebdf commit 15d4e8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/c/sk_path.h
Expand Up @@ -94,6 +94,11 @@ SK_API void sk_path_close(sk_path_t*);
Add a closed rectangle contour to the path.
*/
SK_API void sk_path_add_rect(sk_path_t*, const sk_rect_t*, sk_path_direction_t);
/**
Add a closed rectangle contour to the path with an initial point of the contour
(startIndex) expressed as a corner index (0-3)
*/
SK_API void sk_path_add_rect_start(sk_path_t* cpath, const sk_rect_t* crect, sk_path_direction_t cdir, uint32_t startIndex);
/**
Add a closed oval contour to the path
*/
Expand Down
8 changes: 8 additions & 0 deletions src/c/sk_surface.cpp
Expand Up @@ -140,6 +140,14 @@ void sk_path_add_rect(sk_path_t* cpath, const sk_rect_t* crect, sk_path_directio
as_path(cpath)->addRect(AsRect(*crect), dir);
}

void sk_path_add_rect_start(sk_path_t* cpath, const sk_rect_t* crect, sk_path_direction_t cdir, uint32_t startIndex) {
SkPath::Direction dir;
if (!find_sk(cdir, &dir)) {
return;
}
as_path(cpath)->addRect(AsRect(*crect), dir, startIndex);
}

void sk_path_add_oval(sk_path_t* cpath, const sk_rect_t* crect, sk_path_direction_t cdir) {
SkPath::Direction dir;
if (!find_sk(cdir, &dir)) {
Expand Down

0 comments on commit 15d4e8e

Please sign in to comment.