Skip to content

Commit

Permalink
Adding an overload for SkIRect intersection with SkRegion
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Jan 31, 2019
1 parent 5acec53 commit d0706c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/c/sk_region.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ SK_C_API sk_region_t* sk_region_new2(const sk_region_t* region);
SK_C_API void sk_region_delete(sk_region_t* cpath);
SK_C_API void sk_region_contains(sk_region_t* r, const sk_region_t* region);
SK_C_API void sk_region_contains2(sk_region_t* r, int x, int y);
SK_C_API bool sk_region_intersects_rect(sk_region_t* r, const sk_irect_t* rect);
SK_C_API bool sk_region_intersects(sk_region_t* r, const sk_region_t* src);
SK_C_API bool sk_region_set_path(sk_region_t* dst, const sk_path_t* t, const sk_region_t* clip);
SK_C_API bool sk_region_set_rect(sk_region_t* dst, const sk_irect_t* rect);
Expand Down
4 changes: 4 additions & 0 deletions src/c/sk_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ void sk_region_contains2(sk_region_t *r, int x, int y) {
AsRegion(r)->contains(x, y);
}

bool sk_region_intersects_rect(sk_region_t* r, const sk_irect_t* rect) {
return AsRegion(r)->intersects(*AsIRect(rect));
}

bool sk_region_intersects(sk_region_t *r, const sk_region_t *src) {
return AsRegion(r)->intersects(*AsRegion(src));
}
Expand Down

0 comments on commit d0706c8

Please sign in to comment.