OLD | NEW |
1 Skia's Stable C API | 1 Skia's Stable C API |
2 =================== | 2 =================== |
3 | 3 |
4 <div style="text-align:center"> | 4 <div style="text-align:center"> |
5 <strong>EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL<br> | 5 <strong>EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL<br> |
6 DO NOT USE — FOR INTERNAL TESTING ONLY</strong> | 6 DO NOT USE — FOR INTERNAL TESTING ONLY</strong> |
7 </div> | 7 </div> |
8 | 8 |
9 Several issues hinder the development of a stable ABI (application | 9 Several issues hinder the development of a stable ABI (application |
10 binary interface) for Skia: | 10 binary interface) for Skia: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 int main() { | 95 int main() { |
96 sk_surface_t* surface = make_surface(640, 480); | 96 sk_surface_t* surface = make_surface(640, 480); |
97 sk_canvas_t* canvas = sk_surface_get_canvas(surface); | 97 sk_canvas_t* canvas = sk_surface_get_canvas(surface); |
98 draw(canvas); | 98 draw(canvas); |
99 emit_png("skia-c-example.png", surface); | 99 emit_png("skia-c-example.png", surface); |
100 sk_surface_unref(surface); | 100 sk_surface_unref(surface); |
101 return 0; | 101 return 0; |
102 } | 102 } |
103 | 103 |
104 <a href="https://fiddle.skia.org/c/6c6c01438d9c3d80e9c22e606359432e"><img src="h
ttps://fiddle.skia.org/i/6c6c01438d9c3d8 | 104 <a href="https://fiddle.skia.org/c/6c6c01438d9c3d80e9c22e606359432e"><img src="h
ttps://fiddle.skia.org/i/6c6c01438d9c3d80e9c22e606359432e_raster.png" alt=""></a
> |
105 0e9c22e606359432e_raster.png" alt=""></a> | |
106 | 105 |
107 Gyp+Linux example | 106 Gyp+Linux example |
108 ----------------- | 107 ----------------- |
109 | 108 |
110 The following proof-of-concept workflow currently works on Ubuntu 14.04: | 109 The following proof-of-concept workflow currently works on Ubuntu 14.04: |
111 | 110 |
112 1. Aquire Skia and install dependencies (you may have already done this): | 111 1. Aquire Skia and install dependencies (you may have already done this): |
113 | 112 |
114 <!--?prettify lang=sh?--> | 113 <!--?prettify lang=sh?--> |
115 | 114 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 <!--?prettify lang=sh?--> | 164 <!--?prettify lang=sh?--> |
166 | 165 |
167 cd [Wherever you want the example] | 166 cd [Wherever you want the example] |
168 cp "$SKIA_DIR/experimental/c-api-example/skia-c-example.c" . | 167 cp "$SKIA_DIR/experimental/c-api-example/skia-c-example.c" . |
169 cc -c -I "$SKIA_DIR/include/c" skia-c-example.c -o skia-c-example.o | 168 cc -c -I "$SKIA_DIR/include/c" skia-c-example.c -o skia-c-example.o |
170 c++ skia-c-example.o \ | 169 c++ skia-c-example.o \ |
171 "$SKIA_BUILD"/libskia.* -Wl,-rpath -Wl,"$SKIA_BUILD" \ | 170 "$SKIA_BUILD"/libskia.* -Wl,-rpath -Wl,"$SKIA_BUILD" \ |
172 -o skia-c-example | 171 -o skia-c-example |
173 ./skia-c-example | 172 ./skia-c-example |
174 open skia-c-example.png | 173 open skia-c-example.png |
OLD | NEW |