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

Side by Side Diff: site/user/sample/building.md

Issue 1319703004: Fix memory leak in build example (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | 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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698