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

Side by Side Diff: include/c/sk_types.h

Issue 728323002: separate c headers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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_surface.h ('k') | src/c/sk_surface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
11 #ifndef sk_types_DEFINED
12 #define sk_types_DEFINED
13
14 #include <stdint.h>
15 #include <stddef.h>
16
17 #ifdef __cplusplus
18 #define SK_C_PLUS_PLUS_BEGIN_GUARD extern "C" {
19 #define SK_C_PLUS_PLUS_END_GUARD }
20 #else
21 #include <stdbool.h>
22 #define SK_C_PLUS_PLUS_BEGIN_GUARD
23 #define SK_C_PLUS_PLUS_END_GUARD
24 #endif
25
26 //////////////////////////////////////////////////////////////////////////////// ///////
27
28 SK_C_PLUS_PLUS_BEGIN_GUARD
29
30 typedef uint32_t sk_color_t;
31
32 #define sk_color_set_argb(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
33 #define sk_color_get_a(c) (((c) >> 24) & 0xFF)
34 #define sk_color_get_r(c) (((c) >> 16) & 0xFF)
35 #define sk_color_get_g(c) (((c) >> 8) & 0xFF)
36 #define sk_color_get_b(c) (((c) >> 0) & 0xFF)
37
38 typedef enum {
39 UNKNOWN_SK_COLORTYPE,
40 RGBA_8888_SK_COLORTYPE,
41 BGRA_8888_SK_COLORTYPE,
42 ALPHA_8_SK_COLORTYPE,
43 } sk_colortype_t;
44
45 typedef enum {
46 OPAQUE_SK_ALPHATYPE,
47 PREMUL_SK_ALPHATYPE,
48 UNPREMUL_SK_ALPHATYPE,
49 } sk_alphatype_t;
50
51 sk_colortype_t sk_colortype_get_default_8888();
52
53 typedef struct {
54 int32_t width;
55 int32_t height;
56 sk_colortype_t colorType;
57 sk_alphatype_t alphaType;
58 } sk_imageinfo_t;
59
60 typedef struct {
61 float left;
62 float top;
63 float right;
64 float bottom;
65 } sk_rect_t;
66
67 typedef struct sk_canvas_t sk_canvas_t;
68 typedef struct sk_image_t sk_image_t;
69 typedef struct sk_paint_t sk_paint_t;
70 typedef struct sk_path_t sk_path_t;
71 typedef struct sk_surface_t sk_surface_t;
72
73 //////////////////////////////////////////////////////////////////////////////// //////////
74
75 #ifdef __cplusplus
76 class SkCanvas;
77 void sk_test_capi(SkCanvas*);
78 #endif
79
80 SK_C_PLUS_PLUS_END_GUARD
81
82 #endif
OLDNEW
« no previous file with comments | « include/c/sk_surface.h ('k') | src/c/sk_surface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698