| OLD | NEW |
| 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 |
| 11 We use .cpp and .h as extensions for c++ source and header files. We use | 11 We use .cpp and .h as extensions for c++ source and header files. We use |
| 12 foo_impl.h for headers with inline definitions for class foo. | 12 foo_impl.h for headers with inline definitions for class foo. |
| 13 | 13 |
| 14 Headers that aren’t meant for public consumption should be placed in src | 14 Headers that aren’t meant for public consumption should be placed in src |
| 15 directories so that they aren’t in a client’s search path. | 15 directories so that they aren’t in a client’s search path. |
| 16 | 16 |
| 17 We prefer to minimize includes. If forward declaring a name in a header is | 17 We prefer to minimize includes. If forward declaring a name in a header is |
| 18 sufficient then that is preferred to an include. | 18 sufficient then that is preferred to an include. |
| 19 | 19 |
| 20 Forward declarations and file includes should be in alphabetical order (but we | 20 Forward declarations and file includes should be in alphabetical order (but we |
| 21 aren't very strict about it). | 21 aren't very strict about it). |
| 22 | 22 |
| 23 <span id="no-define-before-sktypes"></span> |
| 23 Do not use #if/#ifdef before including "SkTypes.h" (directly or indirectly). | 24 Do not use #if/#ifdef before including "SkTypes.h" (directly or indirectly). |
| 24 | 25 |
| 25 We use spaces not tabs (4 of them). | 26 We use spaces not tabs (4 of them). |
| 26 | 27 |
| 27 We use Unix style endlines (LF). | 28 We use Unix style endlines (LF). |
| 28 | 29 |
| 29 We prefer no trailing whitespace but aren't very strict about it. | 30 We prefer no trailing whitespace but aren't very strict about it. |
| 30 | 31 |
| 31 We wrap lines at 100 columns unless it is excessively ugly (use your judgement). | 32 We wrap lines at 100 columns unless it is excessively ugly (use your judgement). |
| 32 The soft line length limit was changed from 80 to 100 columns in June 2012. Thus
, | 33 The soft line length limit was changed from 80 to 100 columns in June 2012. Thus
, |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 this->drawBitmapRectToRect( | 551 this->drawBitmapRectToRect( |
| 551 bitmap, NULL, dst, paint, kNone_DrawBitmapRectFlag); | 552 bitmap, NULL, dst, paint, kNone_DrawBitmapRectFlag); |
| 552 } | 553 } |
| 553 ~~~~ | 554 ~~~~ |
| 554 | 555 |
| 555 Python | 556 Python |
| 556 ------ | 557 ------ |
| 557 | 558 |
| 558 Python code follows the [Google Python Style Guide](http://google-styleguide.goo
glecode.com/svn/trunk/pyguide.html). | 559 Python code follows the [Google Python Style Guide](http://google-styleguide.goo
glecode.com/svn/trunk/pyguide.html). |
| 559 | 560 |
| OLD | NEW |