OLD | NEW |
1 Building with Skia Tutorial | 1 Building with Skia Tutorial |
2 =========================== | 2 =========================== |
3 | 3 |
4 dsinclair@chromium.org | 4 dsinclair@chromium.org |
5 | 5 |
6 | 6 |
7 This document describes the steps used to create an application that uses Skia.
The assumptions are that you're using: | 7 This document describes the steps used to create an application that uses Skia.
The assumptions are that you're using: |
8 | 8 |
9 * [git](http://git-scm.com) | 9 * [git](http://git-scm.com) |
10 * [gclient](https://code.google.com/p/gclient/) | 10 * [gclient](https://code.google.com/p/gclient/) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 Our application is defined in `src/app/main.cpp` as: | 253 Our application is defined in `src/app/main.cpp` as: |
254 | 254 |
255 ~~~~ | 255 ~~~~ |
256 #include "SkPaint.h" | 256 #include "SkPaint.h" |
257 #include "SkString.h" | 257 #include "SkString.h" |
258 | 258 |
259 int main(int argc, char** argv) { | 259 int main(int argc, char** argv) { |
260 SkPaint paint; | 260 SkPaint paint; |
261 paint.setColor(SK_ColorRED); | 261 paint.setColor(SK_ColorRED); |
262 | 262 |
263 SkString* str = new SkString(); | 263 SkString str; |
264 paint.toString(str); | 264 paint.toString(&str); |
265 | 265 |
266 fprintf(stdout, "%s\n", str->c_str()); | 266 fprintf(stdout, "%s\n", str.c_str()); |
267 | 267 |
268 return 0; | 268 return 0; |
269 } | 269 } |
270 ~~~~ | 270 ~~~~ |
271 | 271 |
272 We're just printing out an SkPaint to show that everything is linking correctly. | 272 We're just printing out an SkPaint to show that everything is linking correctly. |
273 | 273 |
274 Now, we can run: | 274 Now, we can run: |
275 | 275 |
276 $ ./build/gyp_using_skia | 276 $ ./build/gyp_using_skia |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 { | 310 { |
311 # A change to a .gyp, .gypi or to GYP itself should run the generator. | 311 # A change to a .gyp, .gypi or to GYP itself should run the generator. |
312 "name": "gyp", | 312 "name": "gyp", |
313 "pattern": ".", | 313 "pattern": ".", |
314 "action": ["python", "src/build/gyp_using_skia"] | 314 "action": ["python", "src/build/gyp_using_skia"] |
315 } | 315 } |
316 ] | 316 ] |
317 | 317 |
318 Adding the above to the end of DEPS and running gclient sync should show the | 318 Adding the above to the end of DEPS and running gclient sync should show the |
319 GYP files being updated at the end of the sync procedure. | 319 GYP files being updated at the end of the sync procedure. |
320 | |
OLD | NEW |