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

Side by Side Diff: site/dev/contrib/style.md

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT 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 | « samplecode/SampleSubpixelTranslate.cpp ('k') | site/user/api/canvas.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Coding Style Guidelines 1 Coding Style Guidelines
2 ======================= 2 =======================
3 3
4 These conventions have evolved over time. Some of the earlier code in both 4 These conventions have evolved over time. Some of the earlier code in both
5 projects doesn’t strictly adhere to the guidelines. However, as the code evolves 5 projects doesn’t strictly adhere to the guidelines. However, as the code evolves
6 we hope to make the existing code conform to the guildelines. 6 we hope to make the existing code conform to the guildelines.
7 7
8 Files 8 Files
9 ----- 9 -----
10 10
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 ... 378 ...
379 }; 379 };
380 ~~~~ 380 ~~~~
381 381
382 Method calls within method calls should be prefixed with dereference of the 382 Method calls within method calls should be prefixed with dereference of the
383 'this' pointer. For example: 383 'this' pointer. For example:
384 384
385 <!--?prettify?--> 385 <!--?prettify?-->
386 ~~~~ 386 ~~~~
387 this->method(); 387 this->method();
388 Memory Management
389 ~~~~
390
391 All memory allocation should be routed through SkNEW and its variants. These are
392 #defined in SkPostConfig.h, but the correct way to get access to the config
393 system is to #include SkTypes.h, which will allow external users of the library
394 to provide a custom memory manager or other adaptations.
395
396 <!--?prettify?-->
397 ~~~~
398 SkNEW(type_name)
399 SkNEW_ARGS(type_name, args)
400 SkNEW_ARRAY(type_name, count)
401 SkNEW_PLACEMENT(buf, type_name)
402 SkNEW_PLACEMENT_ARGS(buf, type_name, args)
403 SkDELETE(obj)
404 SkDELETE_ARRAY(array)
405 ~~~~ 388 ~~~~
406 389
407 Comparisons 390 Comparisons
408 ----------- 391 -----------
409 392
410 We prefer that equality operators between lvalues and rvalues place the lvalue 393 We prefer that equality operators between lvalues and rvalues place the lvalue
411 on the right: 394 on the right:
412 395
413 <!--?prettify?--> 396 <!--?prettify?-->
414 ~~~~ 397 ~~~~
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 this->drawBitmapRectToRect( 543 this->drawBitmapRectToRect(
561 bitmap, NULL, dst, paint, kNone_DrawBitmapRectFlag); 544 bitmap, NULL, dst, paint, kNone_DrawBitmapRectFlag);
562 } 545 }
563 ~~~~ 546 ~~~~
564 547
565 Python 548 Python
566 ------ 549 ------
567 550
568 Python code follows the [Google Python Style Guide](http://google-styleguide.goo glecode.com/svn/trunk/pyguide.html). 551 Python code follows the [Google Python Style Guide](http://google-styleguide.goo glecode.com/svn/trunk/pyguide.html).
569 552
OLDNEW
« no previous file with comments | « samplecode/SampleSubpixelTranslate.cpp ('k') | site/user/api/canvas.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698