Add scale and skew to C canvas API

R=reed@chromium.org
BUG=skia:

Review URL: https://codereview.chromium.org/762493005
This commit is contained in:
abarth 2014-12-01 14:04:03 -08:00 committed by Commit bot
parent 9dc24686e7
commit 2fc6ea62ce
2 changed files with 15 additions and 0 deletions

View File

@ -21,6 +21,9 @@ void sk_canvas_restore(sk_canvas_t*);
void sk_canvas_translate(sk_canvas_t*, float dx, float dy);
void sk_canvas_scale(sk_canvas_t*, float sx, float sy);
void sk_canvas_rotate_degrees(sk_canvas_t*, float degrees);
void sk_canvas_rotate_radians(sk_canvas_t*, float radians);
void sk_canvas_skew(sk_canvas_t*, float sx, float sy);
void sk_canvas_draw_paint(sk_canvas_t*, const sk_paint_t*);
void sk_canvas_draw_rect(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);

View File

@ -308,6 +308,18 @@ void sk_canvas_scale(sk_canvas_t* ccanvas, float sx, float sy) {
AsCanvas(ccanvas)->scale(sx, sy);
}
void sk_canvas_rotate_degress(sk_canvas_t* ccanvas, float degrees) {
AsCanvas(ccanvas)->rotate(degrees);
}
void sk_canvas_rotate_radians(sk_canvas_t* ccanvas, float radians) {
AsCanvas(ccanvas)->rotate(SkRadiansToDegrees(radians));
}
void sk_canvas_skew(sk_canvas_t* ccanvas, float sx, float sy) {
AsCanvas(ccanvas)->skew(sx, sy);
}
void sk_canvas_draw_paint(sk_canvas_t* ccanvas, const sk_paint_t* cpaint) {
AsCanvas(ccanvas)->drawPaint(AsPaint(*cpaint));
}