aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-08-30 08:58:10 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-30 13:16:12 +0000
commita523d2d1554441a79319eb46960d7b5c2dc85d9d (patch)
treebea460eb96b0bec9d57093d159dff0fc74f9f0d7 /docs
parent4c6024afcce54cc775810b5f8ebccbcdbc6a43d7 (diff)
fix param return descriptions
enforce that param and return descriptions are phrases (begin with lower case, no trailing period). Docs-Preview: https://skia.org/?cl=40767 Bug: skia: 6898 Change-Id: Ib5f2a02441673f71c0780d81c5e4c61200a678e3 Reviewed-on: https://skia-review.googlesource.com/40767 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkCanvas_Reference.bmh24
-rw-r--r--docs/SkPaint_Reference.bmh4
-rw-r--r--docs/SkPath_Reference.bmh41
-rw-r--r--docs/undocumented.bmh2
-rw-r--r--docs/usingBookmaker.bmh37
5 files changed, 72 insertions, 36 deletions
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index 0168afae77..8a4fe87fd0 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -818,7 +818,7 @@ If pixels are inaccessible, info, rowBytes, and origin are unchanged.
may be nullptr
##
-#Return Address of pixels, or nullptr if inaccessible ##
+#Return address of pixels, or nullptr if inaccessible ##
#Example
void draw(SkCanvas* canvas) {
@@ -2366,7 +2366,7 @@ Replace Clip with the intersection or difference of Clip and rect,
with an aliased or anti-aliased clip edge. rect is transformed by Matrix
before it is combined with Clip.
-#Param rect Rectangle to combine with Clip ##
+#Param rect Rect to combine with Clip ##
#Param op Clip_Op to apply to Clip ##
#Param doAntiAlias true if Clip is to be anti-aliased ##
@@ -2396,7 +2396,7 @@ Replace Clip with the intersection or difference of Clip and rect.
Resulting Clip is aliased; pixels are fully contained by the clip.
rect is transformed by Matrix before it is combined with Clip.
-#Param rect Rectangle to combine with Clip ##
+#Param rect Rect to combine with Clip ##
#Param op Clip_Op to apply to Clip ##
#Example
@@ -2425,7 +2425,7 @@ Resulting Clip is aliased; pixels are fully contained by the clip.
rect is transformed by Matrix
before it is combined with Clip.
-#Param rect Rectangle to combine with Clip ##
+#Param rect Rect to combine with Clip ##
#Param doAntiAlias true if Clip is to be anti-aliased ##
#Example
@@ -3140,10 +3140,10 @@ Always draws each element one at a time; is not affected by
Paint_Stroke_Join, and unlike drawPath, does not create a mask from all points
and lines before drawing.
-#Param mode Whether pts draws points or lines ##
-#Param count The number of points in the array ##
-#Param pts Array of points to draw ##
-#Param paint Stroke, blend, color, and so on, used to draw ##
+#Param mode whether pts draws points or lines ##
+#Param count number of points in the array ##
+#Param pts array of points to draw ##
+#Param paint stroke, blend, color, and so on, used to draw ##
#Example
#Height 200
@@ -4496,7 +4496,7 @@ improve performance.
#Param paint Paint containing Blend_Mode, Color_Filter, Image_Filter,
and so on; or nullptr
##
-#Param constraint Filter strictly within src or draw faster ##
+#Param constraint sample strictly within src, or draw faster ##
#Example
#Height 64
@@ -5164,7 +5164,7 @@ filled 12 point black glyphs.
#Param byteLength byte length of text array ##
#Param path Path providing text baseline ##
#Param matrix transform of glyphs before mapping to path; may be nullptr
- to use identity Matrix.
+ to use identity Matrix
##
#Param paint text size, blend, color, and so on, used to draw ##
@@ -5571,7 +5571,7 @@ bottom right, bottom left order.
If paint contains Shader, Point array texCoords maps Shader as texture to
corners in top left, top right, bottom right, bottom left order.
-#Param cubics Cubic array, sharing common points ##
+#Param cubics Path_Cubic array, sharing common points ##
#Param colors Color array, one for each corner ##
#Param texCoords Point array of texure coordinates, mapping Shader to corners;
may be nullptr
@@ -5629,7 +5629,7 @@ bottom right, bottom left order.
If paint contains Shader, Point array texCoords maps Shader as texture to
corners in top left, top right, bottom right, bottom left order.
-#Param cubics Cubic array, sharing common points ##
+#Param cubics Path_Cubic array, sharing common points ##
#Param colors Color array, one for each corner ##
#Param texCoords Point array of texure coordinates, mapping Shader to corners;
may be nullptr
diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh
index cc9ae93fbe..e25a51c5f3 100644
--- a/docs/SkPaint_Reference.bmh
+++ b/docs/SkPaint_Reference.bmh
@@ -3647,7 +3647,7 @@ Deprecated.
Pass nullptr to clear Draw_Looper and leave Draw_Looper effect on drawing unaltered.
Does not alter drawLooper Reference_Count.
- #Param drawLooper Iterates through drawing one or more time, altering Paint ##
+ #Param drawLooper iterates through drawing one or more time, altering Paint ##
#Example
#Height 128
@@ -4975,7 +4975,7 @@ void draw(SkCanvas* canvas) {
#Param bounds lower and upper line parallel to the advance ##
#Param intervals returned intersections; may be nullptr ##
- #Return The number of intersections; may be zero ##
+ #Return number of intersections; may be zero ##
#Example
#Description
diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh
index a0508dff29..e4b9770543 100644
--- a/docs/SkPath_Reference.bmh
+++ b/docs/SkPath_Reference.bmh
@@ -532,7 +532,7 @@ pointers are not exposed.
#Param path Path to copy by value ##
-#Return Copy of Path ##
+#Return copy of Path ##
#Example
#Description
@@ -1079,7 +1079,7 @@ Computes Convexity if required, and returns stored value.
Convexity is computed if stored value is kUnknown_Convexity,
or if Path has been altered since Convexity was computed or set.
-#Return Computed or stored Convexity ##
+#Return computed or stored Convexity ##
#Example
void draw(SkCanvas* canvas) {
@@ -1109,7 +1109,7 @@ void draw(SkCanvas* canvas) {
Returns last computed Convexity, or kUnknown_Convexity if
Path has been altered since Convexity was computed or set.
-#Return Stored Convexity ##
+#Return stored Convexity ##
#Example
#Description
@@ -1571,11 +1571,12 @@ Test if Line between Point pair is degenerate.
Line with no length or that moves a very short distance is degenerate; it is
treated as a point.
+exact changes the equality test. If true, returns true only if p1 equals p2.
+If false, returns true if p1 equals or nearly equals p2.
+
#Param p1 line start point ##
#Param p2 line end point ##
-#Param exact If true, returns true only if p1 equals p2. If false, returns true
- if p1 equals or nearly equals p2
-##
+#Param exact if false, allow nearly equals ##
#Return true if Line is degenerate; its length is effectively zero ##
@@ -3821,7 +3822,7 @@ of up to 90 degrees; in this case, set pow2 to one.
#Param pts storage for Quad array ##
#Param pow2 Quad count, as power of two, normally 0 to 5 (1 to 32 Quad curves) ##
-#Return Number of Quad curves written to pts ##
+#Return number of Quad curves written to pts ##
#Example
#Description
@@ -4022,7 +4023,7 @@ start determines the first corner added.
#Param rect Rect to add as a closed contour ##
#Param dir Direction to wind added contour ##
-#Param start Initial corner of Rect to add ##
+#Param start initial corner of Rect to add ##
#Example
#Height 128
@@ -4434,7 +4435,7 @@ After appending, Path may be empty, or may contain: Rect, Oval, or Round_Rect.
#Param rrect bounds and radii of rounded rectangle ##
#Param dir Direction to wind Round_Rect ##
-#Param start Index of initial point of Round_Rect ##
+#Param start index of initial point of Round_Rect ##
#Example
void draw(SkCanvas* canvas) {
@@ -4472,8 +4473,8 @@ appends kClose_Verb to Path, connecting pts[count - 1] and pts[0].
If count is zero, append kMove_Verb to path.
Has no effect if count is less than one.
-#Param pts Array of Line sharing end and start Point ##
-#Param count Length of Point array ##
+#Param pts array of Line sharing end and start Point ##
+#Param count length of Point array ##
#Param close true to add Line connecting Contour end and start ##
#Example
@@ -4635,7 +4636,7 @@ added unaltered. If mode is kExtend_AddPathMode, add Line before appending
Verbs, Points, and Conic_Weights.
#Param src Path Verbs, Points, and Conic_Weights to add ##
-#Param matrix Transform applied to src ##
+#Param matrix transform applied to src ##
#Param mode kAppend_AddPathMode or kExtend_AddPathMode ##
#Example
@@ -5519,20 +5520,20 @@ kDone_Verb
#Method Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)
- Returns next Verb in Verb_Array, and advances Iter.
- When Verb_Array is exhausted, returns kDone_Verb.
+Returns next Verb in Verb_Array, and advances Iter.
+When Verb_Array is exhausted, returns kDone_Verb.
+
Zero to four Points are stored in pts, depending on the returned Verb.
+
If doConsumeDegenerates is true, skip consecutive kMove_Verb entries, returning
only the last in the series; and skip very small Lines, Quads, and Conics; and
skip kClose_Verb following kMove_Verb.
if doConsumeDegenerates is true and exact is true, only skip Lines, Quads, and
Conics with zero lengths.
- #Param pts Storage for Point data describing returned Verb ##
- #Param doConsumeDegenerates If true, skip degenerate Verbs ##
- #Param exact If true, skip zero length curves. Has no effect if doConsumeDegenerates
- is false
- ##
+ #Param pts storage for Point data describing returned Verb ##
+ #Param doConsumeDegenerates if true, skip degenerate Verbs ##
+ #Param exact skip zero length curves ##
#Return next Verb from Verb_Array ##
@@ -5777,7 +5778,7 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
When Verb_Array is exhausted, returns kDone_Verb.
Zero to four Points are stored in pts, depending on the returned Verb.
- #Param pts Storage for Point data describing returned Verb ##
+ #Param pts storage for Point data describing returned Verb ##
#Return next Verb from Verb_Array ##
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index e3c0bedb1b..0be5a0f0c5 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -14,7 +14,7 @@
NULL
RFC
Bezier Coons Cartesian
- C C++
+ C C++
SaveLayerFlags # not external; need to add typedef support
SkUserConfig.h # not external, but still thinking about how markup refers to this
SkXXX.h # ditto
diff --git a/docs/usingBookmaker.bmh b/docs/usingBookmaker.bmh
index 5a088b3d02..60505ca279 100644
--- a/docs/usingBookmaker.bmh
+++ b/docs/usingBookmaker.bmh
@@ -2,7 +2,7 @@
SkXXX
bmh_SkXXX
CL
-C
+Go
Visual_Studio
##
@@ -10,7 +10,9 @@ Visual_Studio
How to use the Bookmaker utility.
+Install #A Go # https://golang.org/doc/install ## if needed.
Get the fiddle command line interface tool.
+By default this will appear in your home directory.
#Code
$ go get go.skia.org/infra/fiddle/go/fiddlecli
@@ -33,6 +35,39 @@ $ ./out/dir/bookmaker -t -i include/core/SkXXX.h
Copy SkXXX.bmh to docs.
Use your favorite editor to fill out docs/SkXXX.bmh.
+#Subtopic Style
+
+Documentation consists of cross references, descriptions, and examples.
+All structs, classes, enums, their members and methods, functions, and so on,
+require descriptions. Most also require examples.
+
+All methods and functions should include examples if practical.
+
+Descriptions start with an active verb. Descriptions are complete, punctuated
+sentences unless they describe parameters or return values. Parameters and
+returned values are described by phrases that start lower case and do not
+include trailing punctuation.
+
+Descriptions are not self-referential; they do not include the thing they
+describe. Descriptions may contain upper case references to definitions
+but otherwise should be free of jargon.
+
+Descriptions may contain code and formulas, each bracketed by markup.
+
+Similar items may be grouped into topics. Topics may include subtopics.
+
+Each document begins with one or more indices that include the contents of
+that file. A class reference includes an index listing contained topics,
+a separate listing for constructors, one for methods, and so on.
+
+Class methods contain a description, any parameters, any return value,
+an example, and any cross references.
+
+Each method must contain either one or more examples or markup indicating
+that there is no example.
+
+##
+
Generate fiddle.json from all examples, including the ones you just wrote.
Error checking is syntatic: starting keywords are closed, keywords have the
correct parents.