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

Side by Side Diff: experimental/sk_surface.h

Issue 624973004: experimental c api (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months 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 | « no previous file | experimental/sk_surface.cpp » ('j') | experimental/sk_surface.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2
3 typedef uint32_t sk_color_t;
4
5 sk_color_t sk_color_set_argb(uint8_t a, uint8_t r, uint8_t g, uint8_t b);
6 uint8_t sk_color_get_a(sk_color_t);
7
8 typedef enum {
9 UNKNOWN_SK_COLORTYPE,
10 RGBA_8888_SK_COLORTYPE,
11 BGRA_8888_SK_COLORTYPE,
12 ALPHA_8_SK_COLORTYPE,
13 } sk_colortype_t;
14
15 typedef struct sk_imageinfo_t {
robertphillips 2014/10/07 16:20:26 Do we not want to do the fWidth thing here ?
16 int32_t width;
17 int32_t height;
18 sk_colortype_t colorType;
19 sk_alphatype_t colorType;
20 };
21
22 typedef struct sk_rect_t {
23 float left;
24 float top;
25 float right;
26 float bottom;
27 };
28
29 typedef struct sk_matrix_t {
30 float mat[9];
31 };
32
33 void sk_matrix_set_identity(sk_matrix_t*);
34
35 typedef struct sk_path_t;
36
37 sk_path_t* sk_path_new();
38 void sk_path_move_to(sk_path*, float x, float y);
39 void sk_path_line_to(sk_path*, float x, float y);
40 void sk_path_quad_to(sk_path*, float x0, float y1, float x1, float y1);
41 void sk_path_get_bounds(const sk_path_t*, sk_rect_t*);
42
43 typedef struct sk_paint_t;
44
45 sk_paint_t* sk_paint_new();
46 bool sk_paint_is_antialias(sk_paint_t*);
47 void sk_paint_set_antialias(sk_paint_t*, bool);
48 sk_color_t sk_paint_get_color(const sk_paint_t*);
49 void sk_paint_set_color(sk_paint_t*, sk_color_t);
50
51 typedef struct sk_canvas_t;
52
53 void sk_canvas_save(sk_canvas_t*);
54 void sk_canvas_save_layer(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);
55 void sk_canvas_restore(sk_canvas_t*);
56
57 void sk_canvas_translate(sk_canvas_t*, sk_scalar_t dx, sk_scalar_t dy);
58 void sk_canvas_scale(sk_canvas_t*, sk_scalar_t sx, sk_scalar_t sy);
59 void sk_canvas_concat(sk_canvas_t*, const sk_matrix_t*);
60
61 void sk_canvas_draw_paint(sk_canvas_t*, const sk_paint_t*);
62 void sk_canvas_draw_rect(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);
63 void sk_canvas_draw_oval(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);
64 void sk_canvas_draw_path(sk_canvas_t*, const sk_path_t*, const sk_paint_t*);
65 void sk_canvas_draw_image(sk_canvas_t*, const sk_image_t*, float x, float y, con st sk_paint_t*);
66
67 typedef struct sk_image_t;
68
69 sk_image_t* sk_image_new_raster_copy(const sk_image_info_t*, const void* pixels, size_t rowBytes);
70
71 int sk_image_get_width(const sk_image_t*);
72 int sk_image_get_height(const sk_image_t*);
73 uint32_t sk_image_get_unique_id(const sk_image_t*);
74
75 typedef struct sk_surface_t;
76
77 sk_surface_t* sk_surface_new_raster(const sk_image_info_t*)
78 sk_surface_t* sk_surface_new_raster_direct(const sk_image_info_t*, void* pixels, size_t rowBytes);
79 void sk_surface_delete(sk_surface_t*);
80
81 sk_canvas_t* sk_surface_get_canvas(sk_surface_t*);
82 sk_image_t* sk_surface_new_image_snapshot(sk_surface_t*);
83
OLDNEW
« no previous file with comments | « no previous file | experimental/sk_surface.cpp » ('j') | experimental/sk_surface.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698