aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/dev/contrib/flatten.md
diff options
context:
space:
mode:
authorGravatar Andrew Monshizadeh <amonshiz@fb.com>2018-01-10 09:55:05 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-11 19:47:58 +0000
commit9d6681cc70095b5be6523873a9de54b02ec65086 (patch)
treebd92d441e53c164e9bfbfb94ee3ade8ba89902fd /site/dev/contrib/flatten.md
parentd75fdc64be5cbbc11660ea4e6e9be4b84e407c79 (diff)
Changes to site documentation
Mostly just formatting fixes with a few grammatical changes. Two real notable changes: - Removed references to SkGLCanvas from Tips & FAQ and replaced with references to `SkDevice` and `SkSurface`. - Deleted deprecated "Quick Start Guides" folder Docs-Preview: https://skia.org/?cl=92361 Bug: skia: Change-Id: Ief790b1c2bae8fe0e39aa8d66c79f80560d18c9e Reviewed-on: https://skia-review.googlesource.com/92361 Reviewed-by: Heather Miller <hcm@google.com> Reviewed-by: Joe Gregorio <jcgregorio@google.com> Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Diffstat (limited to 'site/dev/contrib/flatten.md')
-rw-r--r--site/dev/contrib/flatten.md18
1 files changed, 9 insertions, 9 deletions
diff --git a/site/dev/contrib/flatten.md b/site/dev/contrib/flatten.md
index 192571e1c7..0b3663f560 100644
--- a/site/dev/contrib/flatten.md
+++ b/site/dev/contrib/flatten.md
@@ -1,13 +1,13 @@
Flattenables
============
-Many objects in Skia, such as SkShaders and other effects on SkPaint, need to be
+Many objects in Skia, such as `SkShaders` and other effects on `SkPaint`, need to be
flattened into a data stream for either transport or as part of the key to the
-font cache. Classes for these objects should derive from SkFlattenable or one of
+font cache. Classes for these objects should derive from `SkFlattenable` or one of
its subclasses. If you create a new flattenable class, you need to make sure you
do a few things so that it will work on all platforms:
-1: Override the method flatten (the default scope is protected):
+1: Override the method `flatten` (the default scope is protected):
<!--?prettify?-->
~~~~
@@ -18,7 +18,7 @@ virtual void flatten(SkFlattenableWriteBuffer& buffer) const override {
~~~~
2: Override the (protected) constructor that creates an object from an
-SkFlattenableReadBuffer:
+`SkFlattenableReadBuffer`:
<!--?prettify?-->
~~~~
@@ -39,10 +39,10 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkNewClass)
~~~~
-4: If your class is declared in a .cpp file or in a private header file, create a
+4: If your class is declared in a `.cpp` file or in a private header file, create a
function to register its group:
This occurs in cases where the classes are hidden behind a factory, like many effects
-and shaders are. Then in the parent class header file (such as SkGradientShader) you
+and shaders are. Then in the parent class header file (such as `SkGradientShader`) you
need to add:
<!--?prettify?-->
@@ -69,9 +69,9 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
5: Register your flattenable with the global registrar:
-You need to add one line to SkFlattenable::InitalizeFlattenables(). To register the
-flattenable in a Skia build, that function is defined in SkGlobalInitialization_default.cpp.
-For Chromium, it is in SkGlobalInitialization_chromium.cpp.
+You need to add one line to `SkFlattenable::InitalizeFlattenables()`. To register the
+flattenable in a Skia build, that function is defined in `SkGlobalInitialization_default.cpp`.
+For Chromium, it is in `SkGlobalInitialization_chromium.cpp`.
For a single flattenable add
<!--?prettify?-->