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

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

Issue 1037793002: C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: git cl web Created 5 years, 9 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/SampleVertices.cpp ('k') | site/dev/contrib/style.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 Flattenables 1 Flattenables
2 ============ 2 ============
3 3
4 Many objects in Skia, such as SkShaders and other effects on SkPaint, need to be 4 Many objects in Skia, such as SkShaders and other effects on SkPaint, need to be
5 flattened into a data stream for either transport or as part of the key to the 5 flattened into a data stream for either transport or as part of the key to the
6 font cache. Classes for these objects should derive from SkFlattenable or one of 6 font cache. Classes for these objects should derive from SkFlattenable or one of
7 its subclasses. If you create a new flattenable class, you need to make sure you 7 its subclasses. If you create a new flattenable class, you need to make sure you
8 do a few things so that it will work on all platforms: 8 do a few things so that it will work on all platforms:
9 9
10 1: Override the method flatten (the default scope is protected): 10 1: Override the method flatten (the default scope is protected):
11 11
12 <!--?prettify?--> 12 <!--?prettify?-->
13 ~~~~ 13 ~~~~
14 virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE { 14 virtual void flatten(SkFlattenableWriteBuffer& buffer) const override {
15 this->INHERITED::flatten(buffer); 15 this->INHERITED::flatten(buffer);
16 // Write any private data that needs to be stored to recreate this object 16 // Write any private data that needs to be stored to recreate this object
17 } 17 }
18 ~~~~ 18 ~~~~
19 19
20 2: Override the (protected) constructor that creates an object from an 20 2: Override the (protected) constructor that creates an object from an
21 SkFlattenableReadBuffer: 21 SkFlattenableReadBuffer:
22 22
23 <!--?prettify?--> 23 <!--?prettify?-->
24 ~~~~ 24 ~~~~
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNewClass) 79 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkNewClass)
80 ~~~~ 80 ~~~~
81 81
82 For a group, add 82 For a group, add
83 83
84 <!--?prettify?--> 84 <!--?prettify?-->
85 ~~~~ 85 ~~~~
86 SkGroupClass::InitializeFlattenables(); 86 SkGroupClass::InitializeFlattenables();
87 ~~~~ 87 ~~~~
88 88
OLDNEW
« no previous file with comments | « samplecode/SampleVertices.cpp ('k') | site/dev/contrib/style.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698