Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: src/c/sk_surface.cpp

Issue 762493005: Add scale and skew to C canvas API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Now with radians Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/c/sk_canvas.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "sk_canvas.h" 8 #include "sk_canvas.h"
9 #include "sk_image.h" 9 #include "sk_image.h"
10 #include "sk_paint.h" 10 #include "sk_paint.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 302
303 void sk_canvas_translate(sk_canvas_t* ccanvas, float dx, float dy) { 303 void sk_canvas_translate(sk_canvas_t* ccanvas, float dx, float dy) {
304 AsCanvas(ccanvas)->translate(dx, dy); 304 AsCanvas(ccanvas)->translate(dx, dy);
305 } 305 }
306 306
307 void sk_canvas_scale(sk_canvas_t* ccanvas, float sx, float sy) { 307 void sk_canvas_scale(sk_canvas_t* ccanvas, float sx, float sy) {
308 AsCanvas(ccanvas)->scale(sx, sy); 308 AsCanvas(ccanvas)->scale(sx, sy);
309 } 309 }
310 310
311 void sk_canvas_rotate_degress(sk_canvas_t* ccanvas, float degrees) {
312 AsCanvas(ccanvas)->rotate(degrees);
313 }
314
315 void sk_canvas_rotate_radians(sk_canvas_t* ccanvas, float radians) {
316 AsCanvas(ccanvas)->rotate(SkRadiansToDegrees(radians));
317 }
318
319 void sk_canvas_skew(sk_canvas_t* ccanvas, float sx, float sy) {
320 AsCanvas(ccanvas)->skew(sx, sy);
321 }
322
311 void sk_canvas_draw_paint(sk_canvas_t* ccanvas, const sk_paint_t* cpaint) { 323 void sk_canvas_draw_paint(sk_canvas_t* ccanvas, const sk_paint_t* cpaint) {
312 AsCanvas(ccanvas)->drawPaint(AsPaint(*cpaint)); 324 AsCanvas(ccanvas)->drawPaint(AsPaint(*cpaint));
313 } 325 }
314 326
315 void sk_canvas_draw_rect(sk_canvas_t* ccanvas, const sk_rect_t* crect, const sk_ paint_t* cpaint) { 327 void sk_canvas_draw_rect(sk_canvas_t* ccanvas, const sk_rect_t* crect, const sk_ paint_t* cpaint) {
316 AsCanvas(ccanvas)->drawRect(AsRect(*crect), AsPaint(*cpaint)); 328 AsCanvas(ccanvas)->drawRect(AsRect(*crect), AsPaint(*cpaint));
317 } 329 }
318 330
319 void sk_canvas_draw_oval(sk_canvas_t* ccanvas, const sk_rect_t* crect, const sk_ paint_t* cpaint) { 331 void sk_canvas_draw_oval(sk_canvas_t* ccanvas, const sk_rect_t* crect, const sk_ paint_t* cpaint) {
320 AsCanvas(ccanvas)->drawOval(AsRect(*crect), AsPaint(*cpaint)); 332 AsCanvas(ccanvas)->drawOval(AsRect(*crect), AsPaint(*cpaint));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 sk_image_t* cimage = sk_surface_new_image_snapshot(csurface); 470 sk_image_t* cimage = sk_surface_new_image_snapshot(csurface);
459 471
460 // HERE WE CROSS THE C..C++ boundary 472 // HERE WE CROSS THE C..C++ boundary
461 canvas->drawImage((const SkImage*)cimage, 20, 20, NULL); 473 canvas->drawImage((const SkImage*)cimage, 20, 20, NULL);
462 474
463 sk_path_delete(cpath); 475 sk_path_delete(cpath);
464 sk_paint_delete(cpaint); 476 sk_paint_delete(cpaint);
465 sk_image_unref(cimage); 477 sk_image_unref(cimage);
466 sk_surface_unref(csurface); 478 sk_surface_unref(csurface);
467 } 479 }
OLDNEW
« no previous file with comments | « include/c/sk_canvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698