aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-04-03 08:43:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-03 16:09:56 +0000
commit186d08f621efcaf9960ffe4a1dd9e6703de8a698 (patch)
tree7087f2b1a18ef61e26103389a3aab051c9d923f3
parentba31640427659ea2c096be1a26976e34348619cf (diff)
fix bugs exposed by documenting SkImageInfo
- More rigorous symbol identification creates additional links, and finds spurious errors like unnecessary parentheses. - Fixed code to allow preprocessor directives in #Code blocks (still more to do). - Fixed examples waiting on fiddle updates. - Make SkImageInfo officially documented (update in status.json). - Fixed enum indentation. Docs-Preview: https://skia.org/?cl=115656 Bug: skia:6898 Change-Id: Ifcf5cfd3f6c03b3b83155c898b2b035a2f3d443c Reviewed-on: https://skia-review.googlesource.com/115656 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
-rw-r--r--docs/SkAutoCanvasRestore_Reference.bmh2
-rw-r--r--docs/SkBitmap_Reference.bmh8
-rw-r--r--docs/SkIRect_Reference.bmh24
-rw-r--r--docs/SkImageInfo_Reference.bmh9
-rw-r--r--docs/SkPath_Reference.bmh10
-rw-r--r--docs/status.json4
-rw-r--r--docs/undocumented.bmh2
-rw-r--r--site/user/api/SkAutoCanvasRestore_Reference.md4
-rw-r--r--site/user/api/SkBitmap_Reference.md28
-rw-r--r--site/user/api/SkCanvas_Reference.md78
-rw-r--r--site/user/api/SkIRect_Reference.md19
-rw-r--r--site/user/api/SkImageInfo_Reference.md81
-rw-r--r--site/user/api/SkImage_Reference.md22
-rw-r--r--site/user/api/SkMatrix_Reference.md64
-rw-r--r--site/user/api/SkPaint_Reference.md198
-rw-r--r--site/user/api/SkPath_Reference.md117
-rw-r--r--site/user/api/SkRect_Reference.md24
-rw-r--r--site/user/api/SkSurface_Reference.md42
-rw-r--r--site/user/api/catalog.htm21
-rw-r--r--site/user/api/undocumented.md3
-rw-r--r--site/user/api/usingBookmaker.md60
-rw-r--r--tools/bookmaker/bookmaker.cpp51
-rw-r--r--tools/bookmaker/bookmaker.h106
-rw-r--r--tools/bookmaker/cataloger.cpp2
-rw-r--r--tools/bookmaker/definition.cpp6
-rw-r--r--tools/bookmaker/includeParser.cpp28
-rw-r--r--tools/bookmaker/includeWriter.cpp150
-rw-r--r--tools/bookmaker/mdOut.cpp135
-rw-r--r--tools/bookmaker/parserCommon.cpp4
29 files changed, 727 insertions, 575 deletions
diff --git a/docs/SkAutoCanvasRestore_Reference.bmh b/docs/SkAutoCanvasRestore_Reference.bmh
index e4d559da41..fc0f988c2c 100644
--- a/docs/SkAutoCanvasRestore_Reference.bmh
+++ b/docs/SkAutoCanvasRestore_Reference.bmh
@@ -8,7 +8,7 @@
#Class SkAutoCanvasRestore
-Stack helper class calls SkCanvas::restoreToCount() when SkAutoCanvasRestore
+Stack helper class calls SkCanvas::restoreToCount when SkAutoCanvasRestore
goes out of scope. Use this to guarantee that the canvas is restored to a known
state.
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh
index 584672af3f..192896acc6 100644
--- a/docs/SkBitmap_Reference.bmh
+++ b/docs/SkBitmap_Reference.bmh
@@ -1475,8 +1475,8 @@ until the pixels are written to. The actual behavior depends on the platform
implementation of malloc(), if flags is zero, and calloc(), if flags is
kZeroPixels_AllocFlag.
-Passing kZeroPixels_AllocFlag is usually faster than separately calling
-eraseColor(SK_ColorTRANSPARENT).
+flags set to kZeroPixels_AllocFlag offers equal or better performance than
+subsequently calling eraseColor with SK_ColorTRANSPARENT.
#Param info contains width, height, Alpha_Type, Color_Type, Color_Space ##
#Param flags kZeroPixels_AllocFlag, or zero ##
@@ -1519,8 +1519,8 @@ until the pixels are written to. The actual behavior depends on the platform
implementation of malloc(), if flags is zero, and calloc(), if flags is
kZeroPixels_AllocFlag.
-Passing kZeroPixels_AllocFlag is usually faster than separately calling
-eraseColor(SK_ColorTRANSPARENT).
+flags set to kZeroPixels_AllocFlag offers equal or better performance than
+subsequently calling eraseColor with SK_ColorTRANSPARENT.
#Param info contains width, height, Alpha_Type, Color_Type, Color_Space ##
#Param flags kZeroPixels_AllocFlag, or zero ##
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh
index 45b636082d..1e59578310 100644
--- a/docs/SkIRect_Reference.bmh
+++ b/docs/SkIRect_Reference.bmh
@@ -420,11 +420,9 @@ overflow in its calculation.
#Return fRight minus fLeft cast to int64_t ##
-#Bug 7489
-# width64 is not yet visible to fiddle
-#NoExample
+#Example
SkIRect large = { -2147483647, 1, 2147483644, 2 };
-SkDebugf("width: %d wdith64: %lld\n", large.width(), large.width64());
+SkDebugf("width: %d width64: %lld\n", large.width(), large.width64());
#StdOut
width: -5 width64: 4294967291
##
@@ -472,9 +470,7 @@ overflow in its calculation.
#Return fBottom minus fTop cast to int64_t ##
-#Bug 7489
-# height64 not yet visible to fiddle
-#NoExample
+#Example
SkIRect large = { 1, -2147483647, 2, 2147483644 };
SkDebugf("height: %d height64: %lld\n", large.height(), large.height64());
#StdOut
@@ -623,16 +619,14 @@ width64() or height64().
#Return true if width64() or height64() are zero or negative ##
-#Bug 7489
-# isEmpty64 not yet visible to fiddle
-#NoExample
+#Example
SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};
for (auto rect : tests) {
-SkDebugf("rect: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
-rect.bottom(), isEmpty64() ? "" : " not");
-rect.sort();
-SkDebugf("sorted: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
-rect.bottom(), isEmpty64() ? "" : " not");
+ SkDebugf("rect: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
+ rect.bottom(), rect.isEmpty64() ? "" : " not");
+ rect.sort();
+ SkDebugf("sorted: {%d, %d, %d, %d} is" "%s empty\n", rect.left(), rect.top(), rect.right(),
+ rect.bottom(), rect.isEmpty64() ? "" : " not");
}
#StdOut
rect: {20, 40, 10, 50} is empty
diff --git a/docs/SkImageInfo_Reference.bmh b/docs/SkImageInfo_Reference.bmh
index 516de4e35f..f8b3f208eb 100644
--- a/docs/SkImageInfo_Reference.bmh
+++ b/docs/SkImageInfo_Reference.bmh
@@ -227,7 +227,6 @@ kGray_8_SkColorType, kRGBA_F16_SkColorType
#Line # encoding for pixel color ##
#Code
-###$
enum SkColorType {
kUnknown_SkColorType,
kAlpha_8_SkColorType,
@@ -242,7 +241,7 @@ kGray_8_SkColorType, kRGBA_F16_SkColorType
kRGBA_F16_SkColorType,
kLastEnum_SkColorType = kRGBA_F16_SkColorType,
-
+###$
#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
kN32_SkColorType = kBGRA_8888_SkColorType,
#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
@@ -250,9 +249,9 @@ kGray_8_SkColorType, kRGBA_F16_SkColorType
#else
#error "SK_*32_SHIFT values must correspond to BGRA or RGBA byte order"
#endif
- };
$$$#
-##
+ };
+#Code ##
Describes how pixel bits encode color. A pixel may be an alpha mask, a
gray level, Color_RGB, or Color_ARGB.
@@ -263,7 +262,7 @@ kBGRA_8888_SkColorType. On Big_Endian processors, pixels pack into 32-bit
kRGBA_8888_SkColorType.
#Const kUnknown_SkColorType 0
-
+ Color_Type is uninitialized; encoding format and size is unknown.
##
#Const kAlpha_8_SkColorType 1
Encodes Color_Alpha as Alpha_8 pixel in an 8-bit byte.
diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh
index 869e72e5fd..8aecf01728 100644
--- a/docs/SkPath_Reference.bmh
+++ b/docs/SkPath_Reference.bmh
@@ -4077,8 +4077,6 @@ Oval is upright ellipse bounded by Rect oval with radii equal to half oval width
and half oval height. Oval begins at (oval.fRight, oval.centerY()) and continues
clockwise if dir is kCW_Direction, counterclockwise if dir is kCCW_Direction.
-This form is identical to addOval(oval, dir, 1).
-
#Param oval bounds of ellipse added ##
#Param dir Direction to wind ellipse ##
@@ -4839,7 +4837,7 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
#In Last_Point
#Line # replaces Last_Point ##
Set Last_Point to (x, y). If Point_Array is empty, append kMove_Verb to
- Verb_Array and (x, y) to Point_Array.
+ Verb_Array and append (x, y) to Point_Array.
#Param x set x-coordinate of Last_Point ##
#Param y set y-coordinate of Last_Point ##
@@ -4860,8 +4858,8 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
#Method void setLastPt(const SkPoint& p)
- Set the last point on the path. If no points have been added, moveTo(p)
- is automatically called.
+ Set the last point on the path. If Point_Array is empty, append kMove_Verb to
+ Verb_Array and append p to Point_Array.
#Param p set value of Last_Point ##
@@ -5129,7 +5127,7 @@ path is equal to copy
##
##
-#SeeAlso dump SkRect::dumpHex() SkRRect::dumpHex() writeToMemory
+#SeeAlso dump SkRect::dumpHex SkRRect::dumpHex writeToMemory
##
diff --git a/docs/status.json b/docs/status.json
index eaa80b4189..8ac5f03298 100644
--- a/docs/status.json
+++ b/docs/status.json
@@ -5,6 +5,7 @@
"SkBitmap.h",
"SkCanvas.h",
"SkImage.h",
+ "SkImageInfo.h",
"SkMatrix.h",
"SkPaint.h",
"SkPath.h",
@@ -22,6 +23,7 @@
"SkPoint_Reference.bmh",
"SkIRect_Reference.bmh",
"SkImage_Reference.bmh",
+ "SkImageInfo_Reference.bmh",
"SkPath_Reference.bmh",
"SkRect_Reference.bmh",
"SkBitmap_Reference.bmh",
@@ -36,11 +38,9 @@
"InProgress": {
"include": {
"core": [
- "SkImageInfo.h"
]
},
"docs": [
- "SkImageInfo_Reference.bmh",
"overview.bmh",
"usingBookmaker.bmh"
]
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index da8b9fceee..f59b5daf8b 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -125,6 +125,8 @@ FT_Load_Glyph
##
#Const SK_ColorWHITE 0xFFFFFFFF
##
+ #Const SK_ColorTRANSPARENT 0x00000000
+ ##
#Subtopic Alpha
#Alias Alpha
#Subtopic ##
diff --git a/site/user/api/SkAutoCanvasRestore_Reference.md b/site/user/api/SkAutoCanvasRestore_Reference.md
index ea34e64286..834518353b 100644
--- a/site/user/api/SkAutoCanvasRestore_Reference.md
+++ b/site/user/api/SkAutoCanvasRestore_Reference.md
@@ -13,7 +13,9 @@ SkAutoCanvasRestore Reference
| <a href="#Member_Function">Member Function</a> | static functions and member methods |
# <a name="SkAutoCanvasRestore"></a> Class SkAutoCanvasRestore
-Stack helper class calls
+Stack helper class calls <a href="SkCanvas_Reference#SkCanvas_restoreToCount">SkCanvas::restoreToCount</a> when <a href="#SkAutoCanvasRestore">SkAutoCanvasRestore</a>
+goes out of scope. Use this to guarantee that the canvas is restored to a known
+state.
## <a name="Constructor"></a> Constructor
diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md
index 864ed54e70..c827bdffb9 100644
--- a/site/user/api/SkBitmap_Reference.md
+++ b/site/user/api/SkBitmap_Reference.md
@@ -162,10 +162,10 @@ is useful to position one or more <a href="#Bitmap">Bitmaps</a> within a shared
# <a name="SkBitmap::Allocator"></a> Class SkBitmap::Allocator
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-class <a href="#SkBitmap_Allocator">Allocator</a> : public <a href="undocumented#SkRefCnt">SkRefCnt</a> {
-public:
-virtual bool <a href="#SkBitmap_Allocator_allocPixelRef">allocPixelRef(SkBitmap* bitmap)</a> = 0;
-};
+ class <a href="#SkBitmap_Allocator">Allocator</a> : public <a href="undocumented#SkRefCnt">SkRefCnt</a> {
+ public:
+ virtual bool <a href="#SkBitmap_Allocator_allocPixelRef">allocPixelRef(SkBitmap* bitmap)</a> = 0;
+ };
</pre>
Abstract subclass of <a href="#SkBitmap_HeapAllocator">HeapAllocator</a>.
@@ -201,10 +201,10 @@ true if <a href="undocumented#Pixel_Ref">Pixel Ref</a> was allocated
# <a name="SkBitmap::HeapAllocator"></a> Class SkBitmap::HeapAllocator
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-class <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> : public <a href="#SkBitmap_Allocator">Allocator</a> {
-public:
-bool <a href="#SkBitmap_HeapAllocator_allocPixelRef">allocPixelRef(SkBitmap* bitmap)</a> override;
-};
+ class <a href="#SkBitmap_HeapAllocator">HeapAllocator</a> : public <a href="#SkBitmap_Allocator">Allocator</a> {
+ public:
+ bool <a href="#SkBitmap_HeapAllocator_allocPixelRef">allocPixelRef(SkBitmap* bitmap)</a> override;
+ };
</pre>
Subclass of <a href="#SkBitmap_Allocator">SkBitmap::Allocator</a> that returns a <a href="undocumented#Pixel_Ref">Pixel Ref</a> that allocates its pixel
@@ -1665,9 +1665,9 @@ true if <a href="SkImageInfo_Reference#Image_Info">Image Info</a> set successful
## <a name="SkBitmap_AllocFlags"></a> Enum SkBitmap::AllocFlags
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkBitmap_AllocFlags">AllocFlags</a> {
-<a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> = 1 << 0,
-};
+ enum <a href="#SkBitmap_AllocFlags">AllocFlags</a> {
+ <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> = 1 << 0,
+ };
</pre>
<a href="#SkBitmap_AllocFlags">AllocFlags</a> provides the option to zero pixel memory when allocated.
@@ -1729,7 +1729,8 @@ until the pixels are written to. The actual behavior depends on the platform
implementation of malloc(), if <a href="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is zero, and calloc(), if <a href="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> is
<a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>.
-Passing <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> is usually faster than separately calling
+<a href="#SkBitmap_tryAllocPixelsFlags_flags">flags</a> set to <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> offers equal or better performance than
+subsequently calling <a href="#SkBitmap_eraseColor">eraseColor</a> with <a href="undocumented#SK_ColorTRANSPARENT">SK ColorTRANSPARENT</a>.
### Parameters
@@ -1783,7 +1784,8 @@ until the pixels are written to. The actual behavior depends on the platform
implementation of malloc(), if <a href="#SkBitmap_allocPixelsFlags_flags">flags</a> is zero, and calloc(), if <a href="#SkBitmap_allocPixelsFlags_flags">flags</a> is
<a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a>.
-Passing <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> is usually faster than separately calling
+<a href="#SkBitmap_allocPixelsFlags_flags">flags</a> set to <a href="#SkBitmap_kZeroPixels_AllocFlag">kZeroPixels AllocFlag</a> offers equal or better performance than
+subsequently calling <a href="#SkBitmap_eraseColor">eraseColor</a> with <a href="undocumented#SK_ColorTRANSPARENT">SK ColorTRANSPARENT</a>.
### Parameters
diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md
index 2253b3756a..fe07eca728 100644
--- a/site/user/api/SkCanvas_Reference.md
+++ b/site/user/api/SkCanvas_Reference.md
@@ -457,9 +457,9 @@ storage of <a href="undocumented#Raster_Surface">Raster Surface</a></td>
## <a name="SkCanvas_ColorBehavior"></a> Enum SkCanvas::ColorBehavior
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum class <a href="#SkCanvas_ColorBehavior">ColorBehavior</a> {
-<a href="#SkCanvas_ColorBehavior_kLegacy">kLegacy</a>,
-};
+ enum class <a href="#SkCanvas_ColorBehavior">ColorBehavior</a> {
+ <a href="#SkCanvas_ColorBehavior_kLegacy">kLegacy</a>,
+ };
</pre>
### Constants
@@ -1710,11 +1710,11 @@ depth of saved stack
## <a name="SkCanvas__anonymous"></a> Enum SkCanvas::_anonymous
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum {
-<a href="#SkCanvas_kPreserveLCDText_SaveLayerFlag">kPreserveLCDText SaveLayerFlag</a> = 1 << 1,
-<a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a> = 1 << 2,
-<a href="#SkCanvas_kDontClipToLayer_Legacy_SaveLayerFlag">kDontClipToLayer Legacy SaveLayerFlag</a> = kDontClipToLayer_PrivateSaveLayerFlag,
-};
+ enum {
+ <a href="#SkCanvas_kPreserveLCDText_SaveLayerFlag">kPreserveLCDText SaveLayerFlag</a> = 1 << 1,
+ <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a> = 1 << 2,
+ <a href="#SkCanvas_kDontClipToLayer_Legacy_SaveLayerFlag">kDontClipToLayer Legacy SaveLayerFlag</a> = kDontClipToLayer_PrivateSaveLayerFlag,
+ };
</pre>
<a href="#SkCanvas_SaveLayerFlags">SaveLayerFlags</a> provides options that may be used in any combination in <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a>,
@@ -1752,14 +1752,14 @@ scalePaint blends <a href="#Layer">Layer</a> back with transparency.
# <a name="SkCanvas_SaveLayerRec"></a> Struct SkCanvas::SaveLayerRec
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-struct <a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> {
-<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a>*(...
+ struct <a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> {
+ <a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a>*(...
-const <a href="SkRect_Reference#SkRect">SkRect</a>* <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>;
-const <a href="SkPaint_Reference#SkPaint">SkPaint</a>* <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>;
-const <a href="undocumented#SkImageFilter">SkImageFilter</a>* <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a>;
-<a href="#SkCanvas_SaveLayerFlags">SaveLayerFlags</a> <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>;
-};
+ const <a href="SkRect_Reference#SkRect">SkRect</a>* <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>;
+ const <a href="SkPaint_Reference#SkPaint">SkPaint</a>* <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>;
+ const <a href="undocumented#SkImageFilter">SkImageFilter</a>* <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a>;
+ <a href="#SkCanvas_SaveLayerFlags">SaveLayerFlags</a> <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>;
+ };
</pre>
<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> contains the state used to create the <a href="#Layer">Layer</a>.
@@ -3114,11 +3114,11 @@ graphics state used to fill <a href="#Canvas">Canvas</a></td>
## <a name="SkCanvas_PointMode"></a> Enum SkCanvas::PointMode
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkCanvas_PointMode">PointMode</a> {
-<a href="#SkCanvas_kPoints_PointMode">kPoints PointMode</a>,
-<a href="#SkCanvas_kLines_PointMode">kLines PointMode</a>,
-<a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>,
-};
+ enum <a href="#SkCanvas_PointMode">PointMode</a> {
+ <a href="#SkCanvas_kPoints_PointMode">kPoints PointMode</a>,
+ <a href="#SkCanvas_kLines_PointMode">kLines PointMode</a>,
+ <a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>,
+ };
</pre>
Selects if an array of points are drawn as discrete points, as lines, or as
@@ -3857,10 +3857,10 @@ and so on; or nullptr</td>
## <a name="SkCanvas_SrcRectConstraint"></a> Enum SkCanvas::SrcRectConstraint
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> {
-<a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a>,
-<a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a>,
-};
+ enum <a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> {
+ <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a>,
+ <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a>,
+ };
</pre>
<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> controls the behavior at the edge of source <a href="SkRect_Reference#Rect">Rect</a>,
@@ -4548,17 +4548,17 @@ and below <a href="#SkCanvas_drawBitmapNine_center">center</a> to fill the remai
# <a name="SkCanvas_Lattice"></a> Struct SkCanvas::Lattice
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-struct <a href="#SkCanvas_Lattice">Lattice</a> {
-enum <a href="#SkCanvas_Lattice_RectType">RectType</a> ...
+ struct <a href="#SkCanvas_Lattice">Lattice</a> {
+ enum <a href="#SkCanvas_Lattice_RectType">RectType</a> ...
-const int* <a href="#SkCanvas_Lattice_fXDivs">fXDivs</a>;
-const int* <a href="#SkCanvas_Lattice_fYDivs">fYDivs</a>;
-const <a href="#SkCanvas_Lattice_RectType">RectType</a>* <a href="#SkCanvas_Lattice_fRectTypes">fRectTypes</a>;
-int <a href="#SkCanvas_Lattice_fXCount">fXCount</a>;
-int <a href="#SkCanvas_Lattice_fYCount">fYCount</a>;
-const <a href="SkIRect_Reference#SkIRect">SkIRect</a>* <a href="#SkCanvas_Lattice_fBounds">fBounds</a>;
-const <a href="undocumented#SkColor">SkColor</a>* <a href="#SkCanvas_Lattice_fColors">fColors</a>;
-};
+ const int* <a href="#SkCanvas_Lattice_fXDivs">fXDivs</a>;
+ const int* <a href="#SkCanvas_Lattice_fYDivs">fYDivs</a>;
+ const <a href="#SkCanvas_Lattice_RectType">RectType</a>* <a href="#SkCanvas_Lattice_fRectTypes">fRectTypes</a>;
+ int <a href="#SkCanvas_Lattice_fXCount">fXCount</a>;
+ int <a href="#SkCanvas_Lattice_fYCount">fYCount</a>;
+ const <a href="SkIRect_Reference#SkIRect">SkIRect</a>* <a href="#SkCanvas_Lattice_fBounds">fBounds</a>;
+ const <a href="undocumented#SkColor">SkColor</a>* <a href="#SkCanvas_Lattice_fColors">fColors</a>;
+ };
</pre>
<a href="#SkCanvas_Lattice">Lattice</a> divides <a href="SkBitmap_Reference#Bitmap">Bitmap</a> or <a href="SkImage_Reference#Image">Image</a> into a rectangular grid.
@@ -4572,11 +4572,11 @@ remaining space, if any.
## <a name="SkCanvas_Lattice_RectType"></a> Enum SkCanvas::Lattice::RectType
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkCanvas_Lattice_RectType">RectType</a> : uint8_t {
-<a href="#SkCanvas_Lattice_kDefault">kDefault</a> = 0,
-<a href="#SkCanvas_Lattice_kTransparent">kTransparent</a>,
-<a href="#SkCanvas_Lattice_kFixedColor">kFixedColor</a>,
-};
+ enum <a href="#SkCanvas_Lattice_RectType">RectType</a> : uint8_t {
+ <a href="#SkCanvas_Lattice_kDefault">kDefault</a> = 0,
+ <a href="#SkCanvas_Lattice_kTransparent">kTransparent</a>,
+ <a href="#SkCanvas_Lattice_kFixedColor">kFixedColor</a>,
+ };
</pre>
Optional setting per rectangular grid entry to make it transparent,
diff --git a/site/user/api/SkIRect_Reference.md b/site/user/api/SkIRect_Reference.md
index 47d2b8eb4f..f01542ccdd 100644
--- a/site/user/api/SkIRect_Reference.md
+++ b/site/user/api/SkIRect_Reference.md
@@ -605,7 +605,9 @@ overflow in its calculation.
<a href="#SkIRect_fRight">fRight</a> minus <a href="#SkIRect_fLeft">fLeft</a> cast to int64_t
-<a href="#SkIRect">SkIRect</a> large = { -2147483647, 1, 2147483644, 2 };
+### Example
+
+<div><fiddle-embed name="63977f97999bbd6eecfdcc7575d75492">
#### Example Output
@@ -613,6 +615,8 @@ overflow in its calculation.
width: -5 width64: 4294967291
~~~~
+</fiddle-embed></div>
+
### See Also
<a href="#SkIRect_width">width</a> <a href="#SkIRect_height">height</a> <a href="#SkIRect_height64">height64</a> <a href="SkRect_Reference#SkRect_width">SkRect::width()</a>
@@ -667,7 +671,9 @@ overflow in its calculation.
<a href="#SkIRect_fBottom">fBottom</a> minus <a href="#SkIRect_fTop">fTop</a> cast to int64_t
-<a href="#SkIRect">SkIRect</a> large = { 1, -2147483647, 2, 2147483644 };
+### Example
+
+<div><fiddle-embed name="02dd98716e54bbd8c2f0ff23b7ef98cf">
#### Example Output
@@ -675,6 +681,8 @@ overflow in its calculation.
height: -5 height64: 4294967291
~~~~
+</fiddle-embed></div>
+
### See Also
<a href="#SkIRect_width">width</a> <a href="#SkIRect_height">height</a> <a href="#SkIRect_width64">width64</a> <a href="SkRect_Reference#SkRect_height">SkRect::height()</a>
@@ -835,8 +843,9 @@ to or greater than <a href="#SkIRect_fBottom">fBottom</a>. Call <a href="#SkIRec
true if <a href="#SkIRect_width64">width64</a> or <a href="#SkIRect_height64">height64</a> are zero or negative
-<a href="#SkIRect">SkIRect</a> tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};
-for (auto rect : tests) {
+### Example
+
+<div><fiddle-embed name="eb905faa1084ccab3ad0605df4c27ea4">
#### Example Output
@@ -847,6 +856,8 @@ rect: {20, 40, 20, 50} is empty
sorted: {20, 40, 20, 50} is empty
~~~~
+</fiddle-embed></div>
+
### See Also
<a href="#SkIRect_EmptyIRect">EmptyIRect</a> <a href="#SkIRect_MakeEmpty">MakeEmpty</a> <a href="#SkIRect_sort">sort</a> <a href="SkRect_Reference#SkRect_isEmpty">SkRect::isEmpty</a>
diff --git a/site/user/api/SkImageInfo_Reference.md b/site/user/api/SkImageInfo_Reference.md
index 10e1272361..e43d8e9e4b 100644
--- a/site/user/api/SkImageInfo_Reference.md
+++ b/site/user/api/SkImageInfo_Reference.md
@@ -30,19 +30,16 @@ but <a href="SkImage_Reference#Image">Image</a> and <a href="SkSurface_Reference
## <a name="Alpha_Type"></a> Alpha Type
-<a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>, <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>, <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>,
-<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>
-
## <a name="SkAlphaType"></a> Enum SkAlphaType
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkAlphaType">SkAlphaType</a> {
-<a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>,
-<a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>,
-<a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>,
-<a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>,
-kLastEnum_SkAlphaType = <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>,
-};
+ enum <a href="#SkAlphaType">SkAlphaType</a> {
+ <a href="#kUnknown_SkAlphaType">kUnknown_SkAlphaType</a>,
+ <a href="#kOpaque_SkAlphaType">kOpaque_SkAlphaType</a>,
+ <a href="#kPremul_SkAlphaType">kPremul_SkAlphaType</a>,
+ <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>,
+ kLastEnum_SkAlphaType = <a href="#kUnpremul_SkAlphaType">kUnpremul_SkAlphaType</a>,
+ };
</pre>
Describes how to interpret the alpha component of a pixel. A pixel may
@@ -163,37 +160,34 @@ true if <a href="#SkAlphaTypeIsOpaque_at">at</a> equals <a href="#kOpaque_SkAlph
## <a name="Color_Type"></a> Color Type
-<a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>, <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>, <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>,
-<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>, <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>, <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>,
-<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>, <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>, <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>,
-<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>, <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>
-
## <a name="Color_Type_Native"></a> Color Type Native
## <a name="SkColorType"></a> Enum SkColorType
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkColorType">SkColorType</a> {
-<a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>,
-<a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>,
-<a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>,
-<a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>,
-<a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>,
-<a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>,
-<a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>,
-<a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>,
-<a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>,
-<a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>,
-<a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>,
-
-kLastEnum_SkColorType = <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>,
-
-#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
-<a href="#kN32_SkColorType">kN32_SkColorType</a> = <a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>,
-#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
-<a href="#kN32_SkColorType">kN32_SkColorType</a> = <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>,
-#else
-#error "</pre>
+ enum <a href="#SkColorType">SkColorType</a> {
+ <a href="#kUnknown_SkColorType">kUnknown_SkColorType</a>,
+ <a href="#kAlpha_8_SkColorType">kAlpha_8_SkColorType</a>,
+ <a href="#kRGB_565_SkColorType">kRGB_565_SkColorType</a>,
+ <a href="#kARGB_4444_SkColorType">kARGB_4444_SkColorType</a>,
+ <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>,
+ <a href="#kRGB_888x_SkColorType">kRGB_888x_SkColorType</a>,
+ <a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>,
+ <a href="#kRGBA_1010102_SkColorType">kRGBA_1010102_SkColorType</a>,
+ <a href="#kRGB_101010x_SkColorType">kRGB_101010x_SkColorType</a>,
+ <a href="#kGray_8_SkColorType">kGray_8_SkColorType</a>,
+ <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>,
+
+ kLastEnum_SkColorType = <a href="#kRGBA_F16_SkColorType">kRGBA_F16_SkColorType</a>,
+ #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
+ <a href="#kN32_SkColorType">kN32_SkColorType</a> = <a href="#kBGRA_8888_SkColorType">kBGRA_8888_SkColorType</a>,
+ #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
+ <a href="#kN32_SkColorType">kN32_SkColorType</a> = <a href="#kRGBA_8888_SkColorType">kRGBA_8888_SkColorType</a>,
+ #else
+ #error "SK_*32_SHIFT values must correspond to BGRA or RGBA byte order"
+ #endif
+ };
+</pre>
Describes how pixel bits encode color. A pixel may be an alpha mask, a
gray level, <a href="undocumented#RGB">Color RGB</a>, or <a href="undocumented#ARGB">Color ARGB</a>.
@@ -207,7 +201,8 @@ processors, pixels containing 8-bit <a href="undocumented#ARGB">Color ARGB</a> c
<table>
<tr>
- <td><a name="kUnknown_SkColorType"> <code><strong>kUnknown_SkColorType </strong></code> </a></td><td>0</td><td></td>
+ <td><a name="kUnknown_SkColorType"> <code><strong>kUnknown_SkColorType </strong></code> </a></td><td>0</td><td><a href="#Color_Type">Color Type</a> is uninitialized; encoding format and size is unknown.
+</td>
</tr>
<tr>
<td><a name="kAlpha_8_SkColorType"> <code><strong>kAlpha_8_SkColorType </strong></code> </a></td><td>1</td><td>Encodes <a href="undocumented#Alpha">Color Alpha</a> as <a href="#Color_Type_Alpha_8">Alpha 8</a> pixel in an 8-bit byte.
@@ -595,12 +590,12 @@ true if valid <a href="#Alpha_Type">Alpha Type</a> can be associated with <a hre
## <a name="SkYUVColorSpace"></a> Enum SkYUVColorSpace
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkYUVColorSpace">SkYUVColorSpace</a> {
-<a href="#kJPEG_SkYUVColorSpace">kJPEG_SkYUVColorSpace</a>,
-<a href="#kRec601_SkYUVColorSpace">kRec601_SkYUVColorSpace</a>,
-<a href="#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a>,
-kLastEnum_SkYUVColorSpace = <a href="#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a>,
-};
+ enum <a href="#SkYUVColorSpace">SkYUVColorSpace</a> {
+ <a href="#kJPEG_SkYUVColorSpace">kJPEG_SkYUVColorSpace</a>,
+ <a href="#kRec601_SkYUVColorSpace">kRec601_SkYUVColorSpace</a>,
+ <a href="#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a>,
+ kLastEnum_SkYUVColorSpace = <a href="#kRec709_SkYUVColorSpace">kRec709_SkYUVColorSpace</a>,
+ };
</pre>
Describes color range of YUV pixels. The color mapping from YUV to RGB varies
diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md
index 703a5e840e..a2b23d08e0 100644
--- a/site/user/api/SkImage_Reference.md
+++ b/site/user/api/SkImage_Reference.md
@@ -772,10 +772,10 @@ created <a href="#Image">Image</a>, or nullptr
## <a name="SkImage_BitDepth"></a> Enum SkImage::BitDepth
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum class <a href="#SkImage_BitDepth">BitDepth</a> {
-<a href="#SkImage_BitDepth_kU8">kU8</a>,
-<a href="#SkImage_BitDepth_kF16">kF16</a>,
-};
+ enum class <a href="#SkImage_BitDepth">BitDepth</a> {
+ <a href="#SkImage_BitDepth_kU8">kU8</a>,
+ <a href="#SkImage_BitDepth_kF16">kF16</a>,
+ };
</pre>
### Constants
@@ -1438,10 +1438,10 @@ back-end API texture handle, or nullptr
## <a name="SkImage_CachingHint"></a> Enum SkImage::CachingHint
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkImage_CachingHint">CachingHint</a> {
-<a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>,
-<a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>,
-};
+ enum <a href="#SkImage_CachingHint">CachingHint</a> {
+ <a href="#SkImage_kAllow_CachingHint">kAllow CachingHint</a>,
+ <a href="#SkImage_kDisallow_CachingHint">kDisallow CachingHint</a>,
+ };
</pre>
<a href="#SkImage_CachingHint">CachingHint</a> selects whether Skia may internally cache <a href="SkBitmap_Reference#Bitmap">Bitmaps</a> generated by
@@ -2036,9 +2036,9 @@ true if backend texture was created
soon
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkImage_LegacyBitmapMode">LegacyBitmapMode</a> {
-<a href="#SkImage_kRO_LegacyBitmapMode">kRO LegacyBitmapMode</a>,
-};
+ enum <a href="#SkImage_LegacyBitmapMode">LegacyBitmapMode</a> {
+ <a href="#SkImage_kRO_LegacyBitmapMode">kRO LegacyBitmapMode</a>,
+ };
</pre>
### Constants
diff --git a/site/user/api/SkMatrix_Reference.md b/site/user/api/SkMatrix_Reference.md
index d7dbe08802..a42edc1a85 100644
--- a/site/user/api/SkMatrix_Reference.md
+++ b/site/user/api/SkMatrix_Reference.md
@@ -330,13 +330,13 @@ perspective scale factor</td>
## <a name="SkMatrix_TypeMask"></a> Enum SkMatrix::TypeMask
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkMatrix_TypeMask">TypeMask</a> {
-<a href="#SkMatrix_kIdentity_Mask">kIdentity Mask</a> = 0,
-<a href="#SkMatrix_kTranslate_Mask">kTranslate Mask</a> = 0x01,
-<a href="#SkMatrix_kScale_Mask">kScale Mask</a> = 0x02,
-<a href="#SkMatrix_kAffine_Mask">kAffine Mask</a> = 0x04,
-<a href="#SkMatrix_kPerspective_Mask">kPerspective Mask</a> = 0x08,
-};
+ enum <a href="#SkMatrix_TypeMask">TypeMask</a> {
+ <a href="#SkMatrix_kIdentity_Mask">kIdentity Mask</a> = 0,
+ <a href="#SkMatrix_kTranslate_Mask">kTranslate Mask</a> = 0x01,
+ <a href="#SkMatrix_kScale_Mask">kScale Mask</a> = 0x02,
+ <a href="#SkMatrix_kAffine_Mask">kAffine Mask</a> = 0x04,
+ <a href="#SkMatrix_kPerspective_Mask">kPerspective Mask</a> = 0x08,
+ };
</pre>
Enum of bit fields for mask returned by <a href="#SkMatrix_getType">getType</a>.
@@ -795,17 +795,17 @@ Skews are not similar and do not preserve right angles.
## <a name="SkMatrix__anonymous"></a> Enum SkMatrix::_anonymous
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum {
-<a href="#SkMatrix_kMScaleX">kMScaleX</a>,
-<a href="#SkMatrix_kMSkewX">kMSkewX</a>,
-<a href="#SkMatrix_kMTransX">kMTransX</a>,
-<a href="#SkMatrix_kMSkewY">kMSkewY</a>,
-<a href="#SkMatrix_kMScaleY">kMScaleY</a>,
-<a href="#SkMatrix_kMTransY">kMTransY</a>,
-<a href="#SkMatrix_kMPersp0">kMPersp0</a>,
-<a href="#SkMatrix_kMPersp1">kMPersp1</a>,
-<a href="#SkMatrix_kMPersp2">kMPersp2</a>,
-};
+ enum {
+ <a href="#SkMatrix_kMScaleX">kMScaleX</a>,
+ <a href="#SkMatrix_kMSkewX">kMSkewX</a>,
+ <a href="#SkMatrix_kMTransX">kMTransX</a>,
+ <a href="#SkMatrix_kMSkewY">kMSkewY</a>,
+ <a href="#SkMatrix_kMScaleY">kMScaleY</a>,
+ <a href="#SkMatrix_kMTransY">kMTransY</a>,
+ <a href="#SkMatrix_kMPersp0">kMPersp0</a>,
+ <a href="#SkMatrix_kMPersp1">kMPersp1</a>,
+ <a href="#SkMatrix_kMPersp2">kMPersp2</a>,
+ };
</pre>
<a href="#Matrix">Matrix</a> organizes its values in row order. These members correspond to
@@ -856,14 +856,14 @@ each value in <a href="#Matrix">Matrix</a>.
## <a name="SkMatrix__anonymous_2"></a> Enum SkMatrix::_anonymous_2
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum {
-<a href="#SkMatrix_kAScaleX">kAScaleX</a>,
-<a href="#SkMatrix_kASkewY">kASkewY</a>,
-<a href="#SkMatrix_kASkewX">kASkewX</a>,
-<a href="#SkMatrix_kAScaleY">kAScaleY</a>,
-<a href="#SkMatrix_kATransX">kATransX</a>,
-<a href="#SkMatrix_kATransY">kATransY</a>,
-};
+ enum {
+ <a href="#SkMatrix_kAScaleX">kAScaleX</a>,
+ <a href="#SkMatrix_kASkewY">kASkewY</a>,
+ <a href="#SkMatrix_kASkewX">kASkewX</a>,
+ <a href="#SkMatrix_kAScaleY">kAScaleY</a>,
+ <a href="#SkMatrix_kATransX">kATransX</a>,
+ <a href="#SkMatrix_kATransY">kATransY</a>,
+ };
</pre>
Affine arrays are in column major order to match the matrix used by
@@ -3018,12 +3018,12 @@ other * Matrix = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
## <a name="SkMatrix_ScaleToFit"></a> Enum SkMatrix::ScaleToFit
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkMatrix_ScaleToFit">ScaleToFit</a> {
-<a href="#SkMatrix_kFill_ScaleToFit">kFill ScaleToFit</a>,
-<a href="#SkMatrix_kStart_ScaleToFit">kStart ScaleToFit</a>,
-<a href="#SkMatrix_kCenter_ScaleToFit">kCenter ScaleToFit</a>,
-<a href="#SkMatrix_kEnd_ScaleToFit">kEnd ScaleToFit</a>,
-};
+ enum <a href="#SkMatrix_ScaleToFit">ScaleToFit</a> {
+ <a href="#SkMatrix_kFill_ScaleToFit">kFill ScaleToFit</a>,
+ <a href="#SkMatrix_kStart_ScaleToFit">kStart ScaleToFit</a>,
+ <a href="#SkMatrix_kCenter_ScaleToFit">kCenter ScaleToFit</a>,
+ <a href="#SkMatrix_kEnd_ScaleToFit">kEnd ScaleToFit</a>,
+ };
</pre>
<a href="#SkMatrix_ScaleToFit">ScaleToFit</a> describes how <a href="#Matrix">Matrix</a> is constructed to map one <a href="SkRect_Reference#Rect">Rect</a> to another.
diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md
index 88a100b978..cfe356d25c 100644
--- a/site/user/api/SkPaint_Reference.md
+++ b/site/user/api/SkPaint_Reference.md
@@ -621,12 +621,12 @@ paint1.getHash() == paint2.getHash()
## <a name="SkPaint_Hinting"></a> Enum SkPaint::Hinting
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#Hinting">Hinting</a> {
-<a href="#SkPaint_kNo_Hinting">kNo Hinting</a> = 0,
-<a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a> = 1,
-<a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> = 2,
-<a href="#SkPaint_kFull_Hinting">kFull Hinting</a> = 3,
-};
+ enum <a href="#Hinting">Hinting</a> {
+ <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> = 0,
+ <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a> = 1,
+ <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> = 2,
+ <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> = 3,
+ };
</pre>
<a href="#Hinting">Hinting</a> adjusts the glyph outlines so that the shape provides a uniform
@@ -749,21 +749,21 @@ paint1 == paint2
## <a name="SkPaint_Flags"></a> Enum SkPaint::Flags
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#Flags">Flags</a> {
-<a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> = 0x01,
-<a href="#SkPaint_kDither_Flag">kDither Flag</a> = 0x04,
-<a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> = 0x20,
-<a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> = 0x40,
-<a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> = 0x80,
-<a href="#SkPaint_kDevKernText_Flag">kDevKernText Flag</a> = 0x100,
-<a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> = 0x200,
-<a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> = 0x400,
-<a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a> = 0x800,
-<a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> = 0x1000,
-<a href="#SkPaint_kGenA8FromLCD_Flag">kGenA8FromLCD Flag</a> = 0x2000,
+ enum <a href="#Flags">Flags</a> {
+ <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> = 0x01,
+ <a href="#SkPaint_kDither_Flag">kDither Flag</a> = 0x04,
+ <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> = 0x20,
+ <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> = 0x40,
+ <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> = 0x80,
+ <a href="#SkPaint_kDevKernText_Flag">kDevKernText Flag</a> = 0x100,
+ <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> = 0x200,
+ <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> = 0x400,
+ <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a> = 0x800,
+ <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a> = 0x1000,
+ <a href="#SkPaint_kGenA8FromLCD_Flag">kGenA8FromLCD Flag</a> = 0x2000,
-<a href="#SkPaint_kAllFlags">kAllFlags</a> = 0xFFFF,
-};
+ <a href="#SkPaint_kAllFlags">kAllFlags</a> = 0xFFFF,
+ };
</pre>
@@ -821,10 +821,10 @@ multiple settings at once.
soonOnly valid for Android framework.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPaint_ReserveFlags">ReserveFlags</a> {
-<a href="#SkPaint_kUnderlineText_ReserveFlag">kUnderlineText ReserveFlag</a> = 0x08,
-<a href="#SkPaint_kStrikeThruText_ReserveFlag">kStrikeThruText ReserveFlag</a> = 0x10,
-};
+ enum <a href="#SkPaint_ReserveFlags">ReserveFlags</a> {
+ <a href="#SkPaint_kUnderlineText_ReserveFlag">kUnderlineText ReserveFlag</a> = 0x08,
+ <a href="#SkPaint_kStrikeThruText_ReserveFlag">kStrikeThruText ReserveFlag</a> = 0x10,
+ };
</pre>
### Constants
@@ -1010,7 +1010,7 @@ Dithering is always enabled for linear gradients drawing into
<a href="#Dither">Dither</a> can be enabled by default by setting <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to <a href="#SkPaint_kDither_Flag">kDither Flag</a>
at compile time.
-Some platform implementations may ignore dithering. Setto ignore <a href="#Dither">Dither</a> on <a href="undocumented#GPU_Surface">GPU Surface</a>.
+Some platform implementations may ignore dithering. SetSK_IGNORE_GPU_DITHERto ignore <a href="#Dither">Dither</a> on <a href="undocumented#GPU_Surface">GPU Surface</a>.
### Example
@@ -2074,11 +2074,11 @@ while stroking.
## <a name="SkPaint_Style"></a> Enum SkPaint::Style
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPaint_Style">Style</a> {
-<a href="#SkPaint_kFill_Style">kFill Style</a>,
-<a href="#SkPaint_kStroke_Style">kStroke Style</a>,
-<a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a>,
-};
+ enum <a href="#SkPaint_Style">Style</a> {
+ <a href="#SkPaint_kFill_Style">kFill Style</a>,
+ <a href="#SkPaint_kStroke_Style">kStroke Style</a>,
+ <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a>,
+ };
</pre>
Set <a href="#SkPaint_Style">Style</a> to fill, stroke, or both fill and stroke geometry.
@@ -2122,9 +2122,9 @@ and the set <a href="SkPath_Reference#Fill_Type">Path Fill Type</a> is ignored.
## <a name="SkPaint__anonymous"></a> Enum SkPaint::_anonymous
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum {
-<a href="#SkPaint_kStyleCount">kStyleCount</a> = <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a> + 1,
-};
+ enum {
+ <a href="#SkPaint_kStyleCount">kStyleCount</a> = <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a> + 1,
+ };
</pre>
### Constants
@@ -2393,16 +2393,16 @@ default miter limit == 8
## <a name="SkPaint_Cap"></a> Enum SkPaint::Cap
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPaint_Cap">Cap</a> {
-<a href="#SkPaint_kButt_Cap">kButt Cap</a>,
-<a href="#SkPaint_kRound_Cap">kRound Cap</a>,
-<a href="#SkPaint_kSquare_Cap">kSquare Cap</a>,
+ enum <a href="#SkPaint_Cap">Cap</a> {
+ <a href="#SkPaint_kButt_Cap">kButt Cap</a>,
+ <a href="#SkPaint_kRound_Cap">kRound Cap</a>,
+ <a href="#SkPaint_kSquare_Cap">kSquare Cap</a>,
-<a href="#SkPaint_kLast_Cap">kLast Cap</a> = <a href="#SkPaint_kSquare_Cap">kSquare Cap</a>,
-<a href="#SkPaint_kDefault_Cap">kDefault Cap</a> = <a href="#SkPaint_kButt_Cap">kButt Cap</a>,
-};
+ <a href="#SkPaint_kLast_Cap">kLast Cap</a> = <a href="#SkPaint_kSquare_Cap">kSquare Cap</a>,
+ <a href="#SkPaint_kDefault_Cap">kDefault Cap</a> = <a href="#SkPaint_kButt_Cap">kButt Cap</a>,
+ };
-static constexpr int <a href="#SkPaint_kCapCount">kCapCount</a> = <a href="#SkPaint_kLast_Cap">kLast Cap</a> + 1;
+ static constexpr int <a href="#SkPaint_kCapCount">kCapCount</a> = <a href="#SkPaint_kLast_Cap">kLast Cap</a> + 1;
</pre>
<a href="#Stroke_Cap">Stroke Cap</a> draws at the beginning and end of an open <a href="SkPath_Reference#Contour">Path Contour</a>.
@@ -2544,16 +2544,16 @@ the following curve, the pair of curves meet at <a href="#Stroke_Join">Stroke Jo
## <a name="SkPaint_Join"></a> Enum SkPaint::Join
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPaint_Join">Join</a> {
-<a href="#SkPaint_kMiter_Join">kMiter Join</a>,
-<a href="#SkPaint_kRound_Join">kRound Join</a>,
-<a href="#SkPaint_kBevel_Join">kBevel Join</a>,
+ enum <a href="#SkPaint_Join">Join</a> {
+ <a href="#SkPaint_kMiter_Join">kMiter Join</a>,
+ <a href="#SkPaint_kRound_Join">kRound Join</a>,
+ <a href="#SkPaint_kBevel_Join">kBevel Join</a>,
-<a href="#SkPaint_kLast_Join">kLast Join</a> = <a href="#SkPaint_kBevel_Join">kBevel Join</a>,
-<a href="#SkPaint_kDefault_Join">kDefault Join</a> = <a href="#SkPaint_kMiter_Join">kMiter Join</a>,
-};
+ <a href="#SkPaint_kLast_Join">kLast Join</a> = <a href="#SkPaint_kBevel_Join">kBevel Join</a>,
+ <a href="#SkPaint_kDefault_Join">kDefault Join</a> = <a href="#SkPaint_kMiter_Join">kMiter Join</a>,
+ };
-static constexpr int <a href="#SkPaint_kJoinCount">kJoinCount</a> = <a href="#SkPaint_kLast_Join">kLast Join</a> + 1;
+ static constexpr int <a href="#SkPaint_kJoinCount">kJoinCount</a> = <a href="#SkPaint_kLast_Join">kLast Join</a> + 1;
</pre>
<a href="#SkPaint_Join">Join</a> specifies how corners are drawn when a shape is stroked. <a href="#SkPaint_Join">Join</a>
@@ -3581,11 +3581,11 @@ void setLooper(sk_sp&lt;SkDrawLooper&gt; drawLooper)
## <a name="SkPaint_Align"></a> Enum SkPaint::Align
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPaint_Align">Align</a> {
-<a href="#SkPaint_kLeft_Align">kLeft Align</a>,
-<a href="#SkPaint_kCenter_Align">kCenter Align</a>,
-<a href="#SkPaint_kRight_Align">kRight Align</a>,
-};
+ enum <a href="#SkPaint_Align">Align</a> {
+ <a href="#SkPaint_kLeft_Align">kLeft Align</a>,
+ <a href="#SkPaint_kCenter_Align">kCenter Align</a>,
+ <a href="#SkPaint_kRight_Align">kRight Align</a>,
+ };
</pre>
<a href="#SkPaint_Align">Align</a> adjusts the text relative to the text position.
@@ -3628,9 +3628,9 @@ and by its height if <a href="#SkPaint_Flags">Flags</a> has <a href="#SkPaint_kV
## <a name="SkPaint__anonymous_2"></a> Enum SkPaint::_anonymous_2
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum {
-<a href="#SkPaint_kAlignCount">kAlignCount</a> = 3,
-};
+ enum {
+ <a href="#SkPaint_kAlignCount">kAlignCount</a> = 3,
+ };
</pre>
### Constants
@@ -3874,12 +3874,12 @@ additional shear in x-axis relative to y-axis</td>
## <a name="SkPaint_TextEncoding"></a> Enum SkPaint::TextEncoding
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPaint_TextEncoding">TextEncoding</a> {
-<a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a>,
-<a href="#SkPaint_kUTF16_TextEncoding">kUTF16 TextEncoding</a>,
-<a href="#SkPaint_kUTF32_TextEncoding">kUTF32 TextEncoding</a>,
-<a href="#SkPaint_kGlyphID_TextEncoding">kGlyphID TextEncoding</a>,
-};
+ enum <a href="#SkPaint_TextEncoding">TextEncoding</a> {
+ <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a>,
+ <a href="#SkPaint_kUTF16_TextEncoding">kUTF16 TextEncoding</a>,
+ <a href="#SkPaint_kUTF32_TextEncoding">kUTF32 TextEncoding</a>,
+ <a href="#SkPaint_kGlyphID_TextEncoding">kGlyphID TextEncoding</a>,
+ };
</pre>
<a href="#SkPaint_TextEncoding">TextEncoding</a> determines whether text specifies character codes and their encoded
@@ -4013,36 +4013,36 @@ Y-axis values above the baseline are negative, and below the baseline are positi
# <a name="SkPaint_FontMetrics"></a> Struct SkPaint::FontMetrics
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-struct <a href="#SkPaint_FontMetrics">FontMetrics</a> {
-enum <a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> {
-<a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0,
-<a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1,
-<a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2,
-<a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3,
-};
-
-uint32_t <a href="#SkPaint_FontMetrics_fFlags">fFlags</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fTop">fTop</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fAscent">fAscent</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fDescent">fDescent</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fBottom">fBottom</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fLeading">fLeading</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fAvgCharWidth">fAvgCharWidth</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fMaxCharWidth">fMaxCharWidth</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXMin">fXMin</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXMax">fXMax</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXHeight">fXHeight</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fCapHeight">fCapHeight</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fUnderlineThickness">fUnderlineThickness</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fUnderlinePosition">fUnderlinePosition</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a>;
-
-bool <a href="#SkPaint_FontMetrics_hasUnderlineThickness">hasUnderlineThickness(SkScalar* thickness)</a> const;
-bool <a href="#SkPaint_FontMetrics_hasUnderlinePosition">hasUnderlinePosition(SkScalar* position)</a> const;
-bool <a href="#SkPaint_FontMetrics_hasStrikeoutThickness">hasStrikeoutThickness(SkScalar* thickness)</a> const;
-bool <a href="#SkPaint_FontMetrics_hasStrikeoutPosition">hasStrikeoutPosition(SkScalar* position)</a> const;
-};
+ struct <a href="#SkPaint_FontMetrics">FontMetrics</a> {
+ enum <a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> {
+ <a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0,
+ <a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1,
+ <a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2,
+ <a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3,
+ };
+
+ uint32_t <a href="#SkPaint_FontMetrics_fFlags">fFlags</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fTop">fTop</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fAscent">fAscent</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fDescent">fDescent</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fBottom">fBottom</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fLeading">fLeading</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fAvgCharWidth">fAvgCharWidth</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fMaxCharWidth">fMaxCharWidth</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXMin">fXMin</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXMax">fXMax</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fXHeight">fXHeight</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fCapHeight">fCapHeight</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fUnderlineThickness">fUnderlineThickness</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fUnderlinePosition">fUnderlinePosition</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fStrikeoutThickness">fStrikeoutThickness</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPaint_FontMetrics_fStrikeoutPosition">fStrikeoutPosition</a>;
+
+ bool <a href="#SkPaint_FontMetrics_hasUnderlineThickness">hasUnderlineThickness(SkScalar* thickness)</a> const;
+ bool <a href="#SkPaint_FontMetrics_hasUnderlinePosition">hasUnderlinePosition(SkScalar* position)</a> const;
+ bool <a href="#SkPaint_FontMetrics_hasStrikeoutThickness">hasStrikeoutThickness(SkScalar* thickness)</a> const;
+ bool <a href="#SkPaint_FontMetrics_hasStrikeoutPosition">hasStrikeoutPosition(SkScalar* position)</a> const;
+ };
</pre>
<a href="#SkPaint_FontMetrics">FontMetrics</a> is filled out by <a href="#SkPaint_getFontMetrics">getFontMetrics</a>. <a href="#SkPaint_FontMetrics">FontMetrics</a> contents reflect the values
@@ -4062,12 +4062,12 @@ are valid, since their value may be zero.
## <a name="SkPaint_FontMetrics_FontMetricsFlags"></a> Enum SkPaint::FontMetrics::FontMetricsFlags
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> {
-<a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0,
-<a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1,
-<a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2,
-<a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3,
-};
+ enum <a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> {
+ <a href="#SkPaint_FontMetrics_kUnderlineThicknessIsValid_Flag">kUnderlineThicknessIsValid Flag</a> = 1 << 0,
+ <a href="#SkPaint_FontMetrics_kUnderlinePositionIsValid_Flag">kUnderlinePositionIsValid Flag</a> = 1 << 1,
+ <a href="#SkPaint_FontMetrics_kStrikeoutThicknessIsValid_Flag">kStrikeoutThicknessIsValid Flag</a> = 1 << 2,
+ <a href="#SkPaint_FontMetrics_kStrikeoutPositionIsValid_Flag">kStrikeoutPositionIsValid Flag</a> = 1 << 3,
+ };
</pre>
<a href="#SkPaint_FontMetrics_FontMetricsFlags">FontMetricsFlags</a> are set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a> when underline and strikeout metrics are valid;
diff --git a/site/user/api/SkPath_Reference.md b/site/user/api/SkPath_Reference.md
index 527a245da5..8bfd765e8a 100644
--- a/site/user/api/SkPath_Reference.md
+++ b/site/user/api/SkPath_Reference.md
@@ -253,15 +253,15 @@ Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and co
## <a name="SkPath_Verb"></a> Enum SkPath::Verb
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#Verb">Verb</a> {
-<a href="#SkPath_kMove_Verb">kMove Verb</a>,
-<a href="#SkPath_kLine_Verb">kLine Verb</a>,
-<a href="#SkPath_kQuad_Verb">kQuad Verb</a>,
-<a href="#SkPath_kConic_Verb">kConic Verb</a>,
-<a href="#SkPath_kCubic_Verb">kCubic Verb</a>,
-<a href="#SkPath_kClose_Verb">kClose Verb</a>,
-<a href="#SkPath_kDone_Verb">kDone Verb</a>,
-};
+ enum <a href="#Verb">Verb</a> {
+ <a href="#SkPath_kMove_Verb">kMove Verb</a>,
+ <a href="#SkPath_kLine_Verb">kLine Verb</a>,
+ <a href="#SkPath_kQuad_Verb">kQuad Verb</a>,
+ <a href="#SkPath_kConic_Verb">kConic Verb</a>,
+ <a href="#SkPath_kCubic_Verb">kCubic Verb</a>,
+ <a href="#SkPath_kClose_Verb">kClose Verb</a>,
+ <a href="#SkPath_kDone_Verb">kDone Verb</a>,
+ };
</pre>
<a href="#Verb">Verb</a> instructs <a href="#Path">Path</a> how to interpret one or more <a href="SkPoint_Reference#Point">Point</a> and optional <a href="#Conic_Weight">Conic Weight</a>;
@@ -343,10 +343,10 @@ verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConi
## <a name="SkPath_Direction"></a> Enum SkPath::Direction
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#Direction">Direction</a> {
-<a href="#SkPath_kCW_Direction">kCW Direction</a>,
-<a href="#SkPath_kCCW_Direction">kCCW Direction</a>,
-};
+ enum <a href="#Direction">Direction</a> {
+ <a href="#SkPath_kCW_Direction">kCW Direction</a>,
+ <a href="#SkPath_kCCW_Direction">kCCW Direction</a>,
+ };
</pre>
<a href="#Direction">Direction</a> describes whether <a href="#Contour">Contour</a> is clockwise or counterclockwise.
@@ -749,12 +749,12 @@ soonOnly valid for Android framework.
## <a name="SkPath_FillType"></a> Enum SkPath::FillType
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPath_FillType">FillType</a> {
-<a href="#SkPath_kWinding_FillType">kWinding FillType</a>,
-<a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>,
-<a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>,
-<a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a>,
-};
+ enum <a href="#SkPath_FillType">FillType</a> {
+ <a href="#SkPath_kWinding_FillType">kWinding FillType</a>,
+ <a href="#SkPath_kEvenOdd_FillType">kEvenOdd FillType</a>,
+ <a href="#SkPath_kInverseWinding_FillType">kInverseWinding FillType</a>,
+ <a href="#SkPath_kInverseEvenOdd_FillType">kInverseEvenOdd FillType</a>,
+ };
</pre>
<a href="#Fill_Type">Fill Type</a> selects the rule used to fill <a href="#Path">Path</a>. <a href="#Path">Path</a> set to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>
@@ -931,11 +931,11 @@ unmodified by the original <a href="#SkPath_FillType">FillType</a>.
## <a name="SkPath_Convexity"></a> Enum SkPath::Convexity
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#Convexity">Convexity</a> : uint8_t {
-<a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>,
-<a href="#SkPath_kConvex_Convexity">kConvex Convexity</a>,
-<a href="#SkPath_kConcave_Convexity">kConcave Convexity</a>,
-};
+ enum <a href="#Convexity">Convexity</a> : uint8_t {
+ <a href="#SkPath_kUnknown_Convexity">kUnknown Convexity</a>,
+ <a href="#SkPath_kConvex_Convexity">kConvex Convexity</a>,
+ <a href="#SkPath_kConcave_Convexity">kConcave Convexity</a>,
+ };
</pre>
<a href="#Path">Path</a> is convex if it contains one <a href="#Contour">Contour</a> and <a href="#Contour">Contour</a> loops no more than
@@ -2959,10 +2959,10 @@ line (156,20),(200,20)
## <a name="SkPath_ArcSize"></a> Enum SkPath::ArcSize
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPath_ArcSize">ArcSize</a> {
-<a href="#SkPath_kSmall_ArcSize">kSmall ArcSize</a>,
-<a href="#SkPath_kLarge_ArcSize">kLarge ArcSize</a>,
-};
+ enum <a href="#SkPath_ArcSize">ArcSize</a> {
+ <a href="#SkPath_kSmall_ArcSize">kSmall ArcSize</a>,
+ <a href="#SkPath_kLarge_ArcSize">kLarge ArcSize</a>,
+ };
</pre>
Four <a href="undocumented#Oval">Oval</a> parts with radii (rx, ry) start at last <a href="#Path">Path</a> <a href="SkPoint_Reference#Point">Point</a> and ends at (x, y).
@@ -3553,8 +3553,6 @@ Add <a href="undocumented#Oval">Oval</a> to path, appending <a href="#SkPath_kMo
and half <a href="#SkPath_addOval_oval">oval</a> height. <a href="undocumented#Oval">Oval</a> begins at (<a href="#SkPath_addOval_oval">oval</a>.fRight, <a href="#SkPath_addOval_oval">oval</a>.centerY()) and continues
clockwise if <a href="#SkPath_addOval_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, counterclockwise if <a href="#SkPath_addOval_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>.
-This form is identical to
-
### Parameters
<table> <tr> <td><a name="SkPath_addOval_oval"> <code><strong>oval </strong></code> </a></td> <td>
@@ -3907,10 +3905,10 @@ true to add <a href="undocumented#Line">Line</a> connecting <a href="#Contour">C
## <a name="SkPath_AddPathMode"></a> Enum SkPath::AddPathMode
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPath_AddPathMode">AddPathMode</a> {
-<a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>,
-<a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>,
-};
+ enum <a href="#SkPath_AddPathMode">AddPathMode</a> {
+ <a href="#SkPath_kAppend_AddPathMode">kAppend AddPathMode</a>,
+ <a href="#SkPath_kExtend_AddPathMode">kExtend AddPathMode</a>,
+ };
</pre>
<a href="#SkPath_AddPathMode">AddPathMode</a> chooses how <a href="#SkPath_addPath">addPath</a> appends. Adding one <a href="#Path">Path</a> to another can extend
@@ -4252,7 +4250,7 @@ void setLastPt(SkScalar x, SkScalar y)
</pre>
Set <a href="#Last_Point">Last Point</a> to (<a href="#SkPath_setLastPt_x">x</a>, <a href="#SkPath_setLastPt_y">y</a>). If <a href="#Point_Array">Point Array</a> is empty, append <a href="#SkPath_kMove_Verb">kMove Verb</a> to
-<a href="#Verb_Array">Verb Array</a> and (<a href="#SkPath_setLastPt_x">x</a>, <a href="#SkPath_setLastPt_y">y</a>) to <a href="#Point_Array">Point Array</a>.
+<a href="#Verb_Array">Verb Array</a> and append (<a href="#SkPath_setLastPt_x">x</a>, <a href="#SkPath_setLastPt_y">y</a>) to <a href="#Point_Array">Point Array</a>.
### Parameters
@@ -4279,7 +4277,8 @@ set <a href="#SkPath_setLastPt_y">y</a>-coordinate of <a href="#Last_Point">Last
void setLastPt(const SkPoint& p)
</pre>
-Set the last point on the path. If no points have been added,
+Set the last point on the path. If <a href="#Point_Array">Point Array</a> is empty, append <a href="#SkPath_kMove_Verb">kMove Verb</a> to
+<a href="#Verb_Array">Verb Array</a> and append <a href="#SkPath_setLastPt_2_p">p</a> to <a href="#Point_Array">Point Array</a>.
### Parameters
@@ -4301,12 +4300,12 @@ set value of <a href="#Last_Point">Last Point</a></td>
## <a name="SkPath_SegmentMask"></a> Enum SkPath::SegmentMask
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkPath_SegmentMask">SegmentMask</a> {
-<a href="#SkPath_kLine_SegmentMask">kLine SegmentMask</a> = 1 << 0,
-<a href="#SkPath_kQuad_SegmentMask">kQuad SegmentMask</a> = 1 << 1,
-<a href="#SkPath_kConic_SegmentMask">kConic SegmentMask</a> = 1 << 2,
-<a href="#SkPath_kCubic_SegmentMask">kCubic SegmentMask</a> = 1 << 3,
-};
+ enum <a href="#SkPath_SegmentMask">SegmentMask</a> {
+ <a href="#SkPath_kLine_SegmentMask">kLine SegmentMask</a> = 1 << 0,
+ <a href="#SkPath_kQuad_SegmentMask">kQuad SegmentMask</a> = 1 << 1,
+ <a href="#SkPath_kConic_SegmentMask">kConic SegmentMask</a> = 1 << 2,
+ <a href="#SkPath_kCubic_SegmentMask">kCubic SegmentMask</a> = 1 << 3,
+ };
</pre>
<a href="#SkPath_SegmentMask">SegmentMask</a> constants correspond to each drawing <a href="#SkPath_Verb">Verb</a> type in <a href="#Path">Path</a>; for
@@ -4547,7 +4546,7 @@ path is equal to copy
### See Also
-<a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup>
+<a href="#SkPath_dump">dump</a><sup><a href="#SkPath_dump_2">[2]</a></sup> <a href="SkRect_Reference#SkRect_dumpHex">SkRect::dumpHex</a> <a href="undocumented#SkRRect_dumpHex">SkRRect::dumpHex</a> <a href="#SkPath_writeToMemory">writeToMemory</a>
---
@@ -4766,13 +4765,13 @@ degenerate data.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
class <a href="#SkPath_Iter_Iter">Iter</a> {
public:
-<a href="#SkPath_Iter_Iter">Iter()</a>;
-<a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a>;
-void <a href="#SkPath_Iter_setPath">setPath(const SkPath& path, bool forceClose)</a>;
-<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_Iter_next">next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)</a>;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_Iter_conicWeight">conicWeight</a> const;
-bool <a href="#SkPath_Iter_isCloseLine">isCloseLine</a> const;
-bool <a href="#SkPath_Iter_isClosedContour">isClosedContour</a> const;
+ <a href="#SkPath_Iter_Iter">Iter()</a>;
+ <a href="#SkPath_Iter_Iter_2">Iter(const SkPath& path, bool forceClose)</a>;
+ void <a href="#SkPath_Iter_setPath">setPath(const SkPath& path, bool forceClose)</a>;
+ <a href="#SkPath_Verb">Verb</a> <a href="#SkPath_Iter_next">next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)</a>;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_Iter_conicWeight">conicWeight</a> const;
+ bool <a href="#SkPath_Iter_isCloseLine">isCloseLine</a> const;
+ bool <a href="#SkPath_Iter_isClosedContour">isClosedContour</a> const;
};
</pre>
@@ -5114,15 +5113,15 @@ Iterates through <a href="#Verb_Array">Verb Array</a>, and associated <a href="#
<a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Conic_Weight">Conic Weight</a> are returned unaltered.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-class <a href="#SkPath_RawIter_RawIter">RawIter</a> {
-public:
-<a href="#SkPath_RawIter_RawIter">RawIter()</a>;
-<a href="#SkPath_RawIter_RawIter_2">RawIter(const SkPath& path)</a>;
-void <a href="#SkPath_RawIter_setPath">setPath(const SkPath& path)</a>;
-<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_next">next(SkPoint pts[4])</a>;
-<a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_peek">peek</a> const;
-<a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_RawIter_conicWeight">conicWeight</a> const;
-}
+ class <a href="#SkPath_RawIter_RawIter">RawIter</a> {
+ public:
+ <a href="#SkPath_RawIter_RawIter">RawIter()</a>;
+ <a href="#SkPath_RawIter_RawIter_2">RawIter(const SkPath& path)</a>;
+ void <a href="#SkPath_RawIter_setPath">setPath(const SkPath& path)</a>;
+ <a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_next">next(SkPoint pts[4])</a>;
+ <a href="#SkPath_Verb">Verb</a> <a href="#SkPath_RawIter_peek">peek</a> const;
+ <a href="undocumented#SkScalar">SkScalar</a> <a href="#SkPath_RawIter_conicWeight">conicWeight</a> const;
+ }
</pre>
<a name="SkPath_RawIter_RawIter"></a>
diff --git a/site/user/api/SkRect_Reference.md b/site/user/api/SkRect_Reference.md
index f1b4d06148..f43af1407b 100644
--- a/site/user/api/SkRect_Reference.md
+++ b/site/user/api/SkRect_Reference.md
@@ -2535,7 +2535,9 @@ void round(SkIRect* dst) const
</pre>
Sets <a href="SkIRect_Reference#IRect">IRect</a> by adding 0.5 and discarding the fractional portion of <a href="#Rect">Rect</a>
-members, using(.
+members, using(<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fLeft)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fTop)</a>,
+<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fRight)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fBottom)</a>)
+.
### Parameters
@@ -2570,7 +2572,9 @@ void roundOut(SkIRect* dst) const
</pre>
Sets <a href="SkIRect_Reference#IRect">IRect</a> by discarding the fractional portion of <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and
-rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(.
+rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fLeft)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fTop)</a>,
+<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fRight)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fBottom)</a>)
+.
### Parameters
@@ -2604,7 +2608,9 @@ void roundOut(SkRect* dst) const
</pre>
Sets <a href="#Rect">Rect</a> by discarding the fractional portion of <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and
-rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(.
+rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fLeft)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fTop)</a>,
+<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fRight)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fBottom)</a>)
+.
### Parameters
@@ -2639,7 +2645,9 @@ void roundIn(SkIRect* dst) const
</pre>
Sets <a href="#Rect">Rect</a> by rounding up <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and
-discarding the fractional portion of <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(.
+discarding the fractional portion of <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fLeft)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fTop)</a>,
+<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fRight)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fBottom)</a>)
+.
### Parameters
@@ -2673,7 +2681,9 @@ SkIRect round() const
</pre>
Returns <a href="SkIRect_Reference#IRect">IRect</a> by adding 0.5 and discarding the fractional portion of <a href="#Rect">Rect</a>
-members, using(.
+members, using(<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fLeft)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fTop)</a>,
+<a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fRight)</a>, <a href="undocumented#SkScalarRoundToInt">SkScalarRoundToInt(fBottom)</a>)
+.
### Return Value
@@ -2704,7 +2714,9 @@ SkIRect roundOut() const
</pre>
Sets <a href="SkIRect_Reference#IRect">IRect</a> by discarding the fractional portion of <a href="#SkRect_fLeft">fLeft</a> and <a href="#SkRect_fTop">fTop</a>; and
-rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(.
+rounding up <a href="#SkRect_fRight">fRight</a> and <a href="#SkRect_fBottom">fBottom</a>, using(<a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fLeft)</a>, <a href="undocumented#SkScalarFloorToInt">SkScalarFloorToInt(fTop)</a>,
+<a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fRight)</a>, <a href="undocumented#SkScalarCeilToInt">SkScalarCeilToInt(fBottom)</a>)
+.
### Return Value
diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md
index b6933c8aa7..9cd4ab534c 100644
--- a/site/user/api/SkSurface_Reference.md
+++ b/site/user/api/SkSurface_Reference.md
@@ -910,10 +910,10 @@ surface generationID: 3
## <a name="SkSurface_ContentChangeMode"></a> Enum SkSurface::ContentChangeMode
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkSurface_ContentChangeMode">ContentChangeMode</a> {
-<a href="#SkSurface_kDiscard_ContentChangeMode">kDiscard ContentChangeMode</a>,
-<a href="#SkSurface_kRetain_ContentChangeMode">kRetain ContentChangeMode</a>,
-};
+ enum <a href="#SkSurface_ContentChangeMode">ContentChangeMode</a> {
+ <a href="#SkSurface_kDiscard_ContentChangeMode">kDiscard ContentChangeMode</a>,
+ <a href="#SkSurface_kRetain_ContentChangeMode">kRetain ContentChangeMode</a>,
+ };
</pre>
<a href="#SkSurface_ContentChangeMode">ContentChangeMode</a> members are parameters to <a href="#SkSurface_notifyContentWillChange">notifyContentWillChange</a>.
@@ -975,18 +975,18 @@ one of: <a href="#SkSurface_kDiscard_ContentChangeMode">kDiscard ContentChangeMo
## <a name="SkSurface_BackendHandleAccess"></a> Enum SkSurface::BackendHandleAccess
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-enum <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> {
-<a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>,
-<a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>,
-<a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a>,
-};
-
-static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kFlushRead_TextureHandleAccess">kFlushRead TextureHandleAccess</a> =
-<a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>;
-static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kFlushWrite_TextureHandleAccess">kFlushWrite TextureHandleAccess</a> =
-<a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>;
-static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kDiscardWrite_TextureHandleAccess">kDiscardWrite TextureHandleAccess</a> =
-<a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a>;
+ enum <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> {
+ <a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>,
+ <a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>,
+ <a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a>,
+ };
+
+ static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kFlushRead_TextureHandleAccess">kFlushRead TextureHandleAccess</a> =
+ <a href="#SkSurface_kFlushRead_BackendHandleAccess">kFlushRead BackendHandleAccess</a>;
+ static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kFlushWrite_TextureHandleAccess">kFlushWrite TextureHandleAccess</a> =
+ <a href="#SkSurface_kFlushWrite_BackendHandleAccess">kFlushWrite BackendHandleAccess</a>;
+ static const <a href="#SkSurface_BackendHandleAccess">BackendHandleAccess</a> <a href="#SkSurface_kDiscardWrite_TextureHandleAccess">kDiscardWrite TextureHandleAccess</a> =
+ <a href="#SkSurface_kDiscardWrite_BackendHandleAccess">kDiscardWrite BackendHandleAccess</a>;
</pre>
### Constants
@@ -1670,16 +1670,6 @@ array of semaphore containers</td>
true if GPU is waiting on semaphores
-# gpu<a href="SkPaint_Reference#SkPaint">SkPaint</a> paint;
-paint.setTextSize(32);
-<a href="undocumented#GrContext">GrContext</a>* context = canvas->getGrContext();
-if (!context) {
-canvas->drawString("GPU only!", 20, 40, paint);
-return;
-}
-<a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a> semaphore;
-<a href="undocumented#sk_sp">sk sp</a><<a href="#SkSurface">SkSurface</a>> surface =
-
### See Also
<a href="#SkSurface_flushAndSignalSemaphores">flushAndSignalSemaphores</a> <a href="undocumented#GrBackendSemaphore">GrBackendSemaphore</a>
diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm
index 37741eef05..377a6c1b8f 100644
--- a/site/user/api/catalog.htm
+++ b/site/user/api/catalog.htm
@@ -798,6 +798,13 @@
"name": "SkIRect::height()",
"stdout": "unsorted height: -5\\nlarge height: -5\\n"
},
+ "SkIRect_height64": {
+ "code": "void draw(SkCanvas* canvas) {\n SkIRect large = { 1, -2147483647, 2, 2147483644 };\n SkDebugf(\"height: %d height64: %lld\\n\", large.height(), large.height64());\n}",
+ "hash": "02dd98716e54bbd8c2f0ff23b7ef98cf",
+ "file": "SkIRect_Reference",
+ "name": "SkIRect::height64",
+ "stdout": "height: -5 height64: 4294967291\\n"
+ },
"SkIRect_inset": {
"code": "void draw(SkCanvas* canvas) {\n SkIRect rect = { 10, 14, 50, 73 };\n rect.inset(5, 13);\n SkDebugf(\"rect: %d, %d, %d, %d\\n\", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);\n}",
"hash": "9debaded1aa8bdf5077a4de0b3015b8f",
@@ -847,6 +854,13 @@
"name": "SkIRect::isEmpty",
"stdout": "rect: {20, 40, 10, 50} is empty\\nsorted: {10, 40, 20, 50} is not empty\\nrect: {20, 40, 20, 50} is empty\\nsorted: {20, 40, 20, 50} is empty\\n"
},
+ "SkIRect_isEmpty64": {
+ "code": "void draw(SkCanvas* canvas) {\n SkIRect tests[] = {{20, 40, 10, 50}, {20, 40, 20, 50}};\n for (auto rect : tests) {\n SkDebugf(\"rect: {%d, %d, %d, %d} is\" \"%s empty\\n\", rect.left(), rect.top(), rect.right(),\n rect.bottom(), rect.isEmpty64() ? \"\" : \" not\");\n rect.sort();\n SkDebugf(\"sorted: {%d, %d, %d, %d} is\" \"%s empty\\n\", rect.left(), rect.top(), rect.right(),\n rect.bottom(), rect.isEmpty64() ? \"\" : \" not\");\n }\n}",
+ "hash": "eb905faa1084ccab3ad0605df4c27ea4",
+ "file": "SkIRect_Reference",
+ "name": "SkIRect::isEmpty64",
+ "stdout": "rect: {20, 40, 10, 50} is empty\\nsorted: {10, 40, 20, 50} is not empty\\nrect: {20, 40, 20, 50} is empty\\nsorted: {20, 40, 20, 50} is empty\\n"
+ },
"SkIRect_join": {
"code": "void draw(SkCanvas* canvas) {\n SkIRect rect = { 10, 20, 15, 25};\n rect.join(50, 60, 55, 65);\n SkDebugf(\"join: %d, %d, %d, %d\\n\", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);\n}",
"hash": "c00ef06289d21db70340e465690e0e08",
@@ -1001,6 +1015,13 @@
"name": "SkIRect::width()",
"stdout": "unsorted width: -5\\nlarge width: -5\\n"
},
+ "SkIRect_width64": {
+ "code": "void draw(SkCanvas* canvas) {\n SkIRect large = { -2147483647, 1, 2147483644, 2 };\n SkDebugf(\"width: %d width64: %lld\\n\", large.width(), large.width64());\n}",
+ "hash": "63977f97999bbd6eecfdcc7575d75492",
+ "file": "SkIRect_Reference",
+ "name": "SkIRect::width64",
+ "stdout": "width: -5 width64: 4294967291\\n"
+ },
"SkIRect_x": {
"code": "void draw(SkCanvas* canvas) {\n SkIRect unsorted = { 15, 5, 10, 25 };\n SkDebugf(\"unsorted.fLeft: %d unsorted.x(): %d\\n\", unsorted.fLeft, unsorted.x());\n SkIRect sorted = unsorted.makeSorted();\n SkDebugf(\"sorted.fLeft: %d sorted.x(): %d\\n\", sorted.fLeft, sorted.x());\n}",
"hash": "2a59cbfd1330a0db520d6ebb2b7c68c7",
diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md
index c667925ea7..fc316b85dd 100644
--- a/site/user/api/undocumented.md
+++ b/site/user/api/undocumented.md
@@ -126,6 +126,9 @@ SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
<tr>
<td><a name="SK_ColorWHITE"> <code><strong>SK_ColorWHITE </strong></code> </a></td><td>0xFFFFFFFF </td><td></td>
</tr>
+ <tr>
+ <td><a name="SK_ColorTRANSPARENT"> <code><strong>SK_ColorTRANSPARENT </strong></code> </a></td><td>0x00000000</td><td></td>
+ </tr>
</table>
## <a name="Alpha"></a> Alpha
diff --git a/site/user/api/usingBookmaker.md b/site/user/api/usingBookmaker.md
index 955ed5653f..f622daf6e1 100644
--- a/site/user/api/usingBookmaker.md
+++ b/site/user/api/usingBookmaker.md
@@ -19,7 +19,7 @@ If the interface is deprecated, but still present in the interface, mark-up the
documentation to be deprecated as well.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-# void someMethodThatIsNowDeprecated()
+#Method void someMethodThatIsNowDeprecated()
#Deprecated
##
</pre>
@@ -27,7 +27,8 @@ documentation to be deprecated as well.
Use
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-## soon</pre>
+##Deprecated soon
+</pre>
if the change is soon to be deprecated.
@@ -59,12 +60,14 @@ For instance, if include/core/SkSurface.h comments do not match
docs/SkSurface_Reference.bmh, running:
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ ./out/dir/bookmaker -b docs -i include/core/SkSurface.h -p</pre>
+$ ./out/dir/bookmaker -b docs -i include/core/SkSurface.h -p
+</pre>
generates
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-wrote updated <a href="SkSurface_Reference#SkSurface">SkSurface</a>.h</pre>
+wrote updated <a href="SkSurface_Reference#SkSurface">SkSurface</a>.h
+</pre>
The updated SkSurface.h is written to the root to avoid subsequent runs of
<a href="#Bookmaker">Bookmaker</a> from recompiling. if SkSurface.h was not changed, it is not written,
@@ -77,12 +80,14 @@ be compiled by fiddle. If the example cannot be fixed, it can be commented out
by changing
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-#Example</pre>
+#Example
+</pre>
to
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-#NoExample</pre>
+#NoExample
+</pre>
.
The disabled example can contain additional markup,
@@ -95,12 +100,14 @@ Get the fiddle command line interface tool.
By default this will appear in your home directory.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ go get go.skia.org/infra/fiddle/go/fiddlecli</pre>
+$ go get go.skia.org/infra/fiddle/go/fiddlecli
+</pre>
Build <a href="#Bookmaker">Bookmaker</a>.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ ninja -C out/dir bookmaker</pre>
+$ ninja -C out/dir bookmaker
+</pre>
## <a name="Regenerate"></a> Regenerate
@@ -111,21 +118,23 @@ $ ./out/skia/bookmaker -a docs/status.json -e fiddle.json
$ ~/go/bin/fiddlecli --input fiddle.json --output fiddleout.json
$ ./out/skia/bookmaker -a docs/status.json -f fiddleout.json -r site/user/api -c
$ ./out/skia/bookmaker -a docs/status.json -x
-$ ./out/skia/bookmaker -a docs/status.json -p</pre>
+$ ./out/skia/bookmaker -a docs/status.json -p
+</pre>
## <a name="New_Documentation"></a> New Documentation
Generate an starter <a href="#Bookmaker">Bookmaker</a> file from an existing include.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs</pre>
+$ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs
+</pre>
If a method or function has an unnamed parameter, bookmaker generates an error:
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-C:/puregit/include/core/<a href="SkPixmap_Reference#SkPixmap">SkPixmap</a>.h(208): error: # missing param name
+C:/puregit/include/core/<a href="SkPixmap_Reference#SkPixmap">SkPixmap</a>.h(208): error: #Method missing param name
bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const
-^
+ ^
</pre>
All parameters require names to allow markdown and doxygen documents to refer to
@@ -134,14 +143,16 @@ them. After naming all parameters, check in the include before continuing.
A successful run generates
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-docs/SkXXX_Reference.bmh</pre>
+docs/SkXXX_Reference.bmh
+</pre>
.
Next, use your favorite editor to fill out
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-docs/SkXXX_Reference.bmh</pre>
+docs/SkXXX_Reference.bmh
+</pre>
.
@@ -156,12 +167,14 @@ It's difficult to think of a meaningful example for class destructors.
In cases like these, change the placeholder:
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-#Example</pre>
+#Example
+</pre>
to:
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-#NoExample</pre>
+#NoExample
+</pre>
Descriptions start with an active verb. Descriptions are complete, punctuated
sentences unless they describe parameters or return values. Parameters and
@@ -199,13 +212,15 @@ If you run <a href="#Bookmaker">Bookmaker</a> inside Visual_Studio, you can clic
will take you to the source line in question.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ ./out/dir/bookmaker -e fiddle.json -b docs</pre>
+$ ./out/dir/bookmaker -e fiddle.json -b docs
+</pre>
Once complete, run fiddlecli to generate the example hashes.
Errors are contained by the output but aren't reported yet.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ $GOPATH/bin/fiddlecli --input fiddle.json --output fiddleout.json</pre>
+$ $GOPATH/bin/fiddlecli --input fiddle.json --output fiddleout.json
+</pre>
Generate SkXXX.md from SkXXX.bmh and fiddleout.json.
Error checking includes: undefined references, fiddle compiler errors,
@@ -213,19 +228,22 @@ missing or mismatched printf output.
Again, you can click on any errors inside Visual_Studio.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ ./out/dir/bookmaker -r site/user/api -b docs -f fiddleout.json</pre>
+$ ./out/dir/bookmaker -r site/user/api -b docs -f fiddleout.json
+</pre>
The original include may have changed since you started creating the markdown.
Check to see if it is up to date.
This reports if a method no longer exists or its parameters have changed.
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ ./out/dir/bookmaker -x -b docs/SkXXX.bmh -i include/core/SkXXX.h</pre>
+$ ./out/dir/bookmaker -x -b docs/SkXXX.bmh -i include/core/SkXXX.h
+</pre>
Generate an updated include header. Run:
<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
-$ ./out/dir/bookmaker -p -b docs -i include/core/SkXXX.h</pre>
+$ ./out/dir/bookmaker -p -b docs -i include/core/SkXXX.h
+</pre>
to write the updated SkXXX.h to the current directory.
diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp
index 4016a19439..223c5b521a 100644
--- a/tools/bookmaker/bookmaker.cpp
+++ b/tools/bookmaker/bookmaker.cpp
@@ -50,6 +50,9 @@ trouble with aliases, plurals
need to keep first letter of includeWriter @param / @return lowercase
Quad -> quad, Quads -> quads
deprecated methods should be sorted down in md out, and show include "Deprecated." text body.
+rewrap text to fit in some number of columns
+#Literal is inflexible, making the entire #Code block link-less (see $Literal in SkImageInfo)
+ would rather keep links for boby above #Literal, and/or make it a block and not a one-liner
see head of selfCheck.cpp for additional todos
*/
@@ -639,7 +642,7 @@ string BmhParser::className(MarkType markType) {
const char* end = this->lineEnd();
const char* mc = this->strnchr(fMC, end);
string classID;
- TextParser::Save savePlace(this);
+ TextParserSave savePlace(this);
this->skipSpace();
const char* wordStart = fChar;
this->skipToNonAlphaNum();
@@ -1054,9 +1057,6 @@ bool BmhParser::findDefinitions() {
const char* lastMC = nullptr;
fParent = nullptr;
while (!this->eof()) {
- if (195 == fLineCount && "docs\\SkImageInfo_Reference.bmh" == fFileName) {
- SkDebugf("");
- }
if (this->peek() == fMC) {
lastMC = fChar;
this->next();
@@ -1570,7 +1570,7 @@ string BmhParser::methodName() {
bool addConst = false;
if (isConstructor || expectOperator) {
paren = this->strnchr(')', end) + 1;
- TextParser::Save saveState(this);
+ TextParserSave saveState(this);
this->skipTo(paren);
if (this->skipExact("_const")) {
addConst = true;
@@ -1593,7 +1593,7 @@ string BmhParser::methodName() {
}
this->next();
}
- TextParser::Save saveState(this);
+ TextParserSave saveState(this);
this->skipWhiteSpace();
if (this->startsWith("const")) {
this->skipName("const");
@@ -1739,6 +1739,22 @@ void TextParser::reportWarning(const char* errorStr) const {
}
}
+void TextParser::setForErrorReporting(const Definition* definition, const char* str) {
+ fFileName = definition->fFileName;
+ fStart = definition->fContentStart;
+ fLine = str;
+ while (fLine > fStart && fLine[-1] != '\n') {
+ --fLine;
+ }
+ fChar = str;
+ fEnd = definition->fContentEnd;
+ fLineCount = definition->fLineCount;
+ const char* lineInc = fStart;
+ while (lineInc < str) {
+ fLineCount += '\n' == *lineInc++;
+ }
+}
+
string TextParser::typedefName() {
// look for typedef as one of three forms:
// typedef return-type (*NAME)(params);
@@ -2289,7 +2305,7 @@ int main(int argc, char** const argv) {
if (FLAGS_tokens) {
IncludeParser::RemoveFile(FLAGS_bmh[0], FLAGS_include[0]);
}
- if (!bmhParser.parseFile(FLAGS_bmh[0], ".bmh")) {
+ if (!bmhParser.parseFile(FLAGS_bmh[0], ".bmh", ParserCommon::OneFile::kNo)) {
return -1;
}
} else if (!FLAGS_status.isEmpty()) {
@@ -2304,7 +2320,7 @@ int main(int argc, char** const argv) {
return 1;
}
HackParser hacker(bmhParser);
- if (!hacker.parseFile(FLAGS_bmh[0], ".bmh")) {
+ if (!hacker.parseFile(FLAGS_bmh[0], ".bmh", ParserCommon::OneFile::kNo)) {
SkDebugf("hack failed\n");
return -1;
}
@@ -2317,7 +2333,7 @@ int main(int argc, char** const argv) {
if (!FLAGS_include.isEmpty() && FLAGS_tokens) {
IncludeParser includeParser;
includeParser.validate();
- if (!includeParser.parseFile(FLAGS_include[0], ".h")) {
+ if (!includeParser.parseFile(FLAGS_include[0], ".h", ParserCommon::OneFile::kNo)) {
return -1;
}
if (FLAGS_tokens) {
@@ -2332,7 +2348,7 @@ int main(int argc, char** const argv) {
IncludeParser includeParser;
includeParser.validate();
if (!FLAGS_include.isEmpty() &&
- !includeParser.parseFile(FLAGS_include[0], ".h")) {
+ !includeParser.parseFile(FLAGS_include[0], ".h", ParserCommon::OneFile::kNo)) {
return -1;
}
if (!FLAGS_status.isEmpty() && !includeParser.parseStatus(FLAGS_status[0], ".h",
@@ -2347,7 +2363,7 @@ int main(int argc, char** const argv) {
IncludeWriter includeWriter;
includeWriter.validate();
if (!FLAGS_include.isEmpty() &&
- !includeWriter.parseFile(FLAGS_include[0], ".h")) {
+ !includeWriter.parseFile(FLAGS_include[0], ".h", ParserCommon::OneFile::kNo)) {
return -1;
}
if (!FLAGS_status.isEmpty() && !includeWriter.parseStatus(FLAGS_status[0], ".h",
@@ -2364,7 +2380,7 @@ int main(int argc, char** const argv) {
}
if (!done && !FLAGS_fiddle.isEmpty() && FLAGS_examples.isEmpty()) {
FiddleParser fparser(&bmhParser);
- if (!fparser.parseFile(FLAGS_fiddle[0], ".txt")) {
+ if (!fparser.parseFile(FLAGS_fiddle[0], ".txt", ParserCommon::OneFile::kNo)) {
return -1;
}
}
@@ -2377,7 +2393,7 @@ int main(int argc, char** const argv) {
if (!FLAGS_status.isEmpty() && !cparser.openStatus(FLAGS_status[0], FLAGS_ref[0])) {
return -1;
}
- if (!cparser.parseFile(FLAGS_fiddle[0], ".txt")) {
+ if (!cparser.parseFile(FLAGS_fiddle[0], ".txt", ParserCommon::OneFile::kNo)) {
return -1;
}
if (!cparser.closeCatalog()) {
@@ -2387,9 +2403,16 @@ int main(int argc, char** const argv) {
done = true;
}
if (!done && !FLAGS_ref.isEmpty() && FLAGS_examples.isEmpty()) {
+ IncludeParser includeParser;
+ includeParser.validate();
+ if (!FLAGS_include.isEmpty() && !includeParser.parseFile(FLAGS_include[0], ".h",
+ ParserCommon::OneFile::kYes)) {
+ return -1;
+ }
MdOut mdOut(bmhParser);
mdOut.fDebugOut = FLAGS_stdout;
- if (!FLAGS_bmh.isEmpty() && mdOut.buildReferences(FLAGS_bmh[0], FLAGS_ref[0])) {
+ if (!FLAGS_bmh.isEmpty() && mdOut.buildReferences(includeParser,
+ FLAGS_bmh[0], FLAGS_ref[0])) {
bmhParser.fWroteOut = true;
}
if (!FLAGS_status.isEmpty() && mdOut.buildStatus(FLAGS_status[0], FLAGS_ref[0])) {
diff --git a/tools/bookmaker/bookmaker.h b/tools/bookmaker/bookmaker.h
index 968644f8b1..a0f6bca6a7 100644
--- a/tools/bookmaker/bookmaker.h
+++ b/tools/bookmaker/bookmaker.h
@@ -240,31 +240,11 @@ public:
class Definition;
class TextParser : public NonAssignable {
- TextParser() {} // only for ParserCommon to call
+ TextParser() {} // only for ParserCommon, TextParserSave
friend class ParserCommon;
+ friend class TextParserSave;
public:
virtual ~TextParser() {}
- class Save {
- public:
- Save(TextParser* parser) {
- fParser = parser;
- fLine = parser->fLine;
- fChar = parser->fChar;
- fLineCount = parser->fLineCount;
- }
-
- void restore() const {
- fParser->fLine = fLine;
- fParser->fChar = fChar;
- fParser->fLineCount = fLineCount;
- }
-
- private:
- TextParser* fParser;
- const char* fLine;
- const char* fChar;
- int fLineCount;
- };
TextParser(const string& fileName, const char* start, const char* end, int lineCount)
: fFileName(fileName)
@@ -417,6 +397,8 @@ public:
return true;
}
+ void setForErrorReporting(const Definition* , const char* );
+
bool skipToEndBracket(char endBracket, const char* end = nullptr) {
if (nullptr == end) {
end = fEnd;
@@ -690,6 +672,33 @@ public:
size_t fLineCount;
};
+class TextParserSave {
+public:
+ TextParserSave(TextParser* parser) {
+ fParser = parser;
+ fSave.fFileName = parser->fFileName;
+ fSave.fStart = parser->fStart;
+ fSave.fLine = parser->fLine;
+ fSave.fChar = parser->fChar;
+ fSave.fEnd = parser->fEnd;
+ fSave.fLineCount = parser->fLineCount;
+ }
+
+ void restore() const {
+ fParser->fFileName = fSave.fFileName;
+ fParser->fStart = fSave.fStart;
+ fParser->fLine = fSave.fLine;
+ fParser->fChar = fSave.fChar;
+ fParser->fEnd = fSave.fEnd;
+ fParser->fLineCount = fSave.fLineCount;
+ }
+
+private:
+ TextParser* fParser;
+ TextParser fSave;
+};
+
+
class EscapeParser : public TextParser {
public:
EscapeParser(const char* start, const char* end) :
@@ -1019,6 +1028,10 @@ struct TypeNames {
class ParserCommon : public TextParser {
public:
+ enum class OneFile {
+ kNo,
+ kYes,
+ };
ParserCommon() : TextParser()
, fParent(nullptr)
@@ -1078,7 +1091,7 @@ public:
fPendingSpace = 0;
}
- bool parseFile(const char* file, const char* suffix);
+ bool parseFile(const char* file, const char* suffix, OneFile );
bool parseStatus(const char* file, const char* suffix, StatusFilter filter);
virtual bool parseFromFile(const char* path) = 0;
bool parseSetup(const char* path);
@@ -1206,8 +1219,9 @@ public:
enum class Resolvable {
kNo, // neither resolved nor output
kYes, // resolved, output
- kOut, // not resolved, but output
- kLiteral, // output untouched (FIXME: is this really different from kOut?)
+ kOut, // mostly resolved, output (FIXME: is this really different from kYes?)
+ kFormula, // resolve methods as they are used, not as they are prototyped
+ kLiteral, // output untouched
kClone, // resolved, output, with references to clones as well
};
@@ -1252,6 +1266,7 @@ public:
#define R_Y Resolvable::kYes
#define R_N Resolvable::kNo
#define R_O Resolvable::kOut
+#define R_F Resolvable::kFormula
#define R_C Resolvable::kClone
#define E_Y Exemplary::kYes
@@ -1284,7 +1299,7 @@ public:
, { "Experimental", nullptr, MarkType::kExperimental, R_Y, E_N, 0 }
, { "External", nullptr, MarkType::kExternal, R_Y, E_N, M(Root) }
, { "File", nullptr, MarkType::kFile, R_N, E_N, M(Track) }
-, { "Formula", nullptr, MarkType::kFormula, R_O, E_N,
+, { "Formula", nullptr, MarkType::kFormula, R_F, E_N,
M(Column) | M_E | M_ST | M(Member) | M(Method) | M_D }
, { "Function", nullptr, MarkType::kFunction, R_O, E_N, M(Example) | M(NoExample) }
, { "Height", nullptr, MarkType::kHeight, R_N, E_N, M(Example) | M(NoExample) }
@@ -1301,7 +1316,7 @@ public:
, { "", nullptr, MarkType::kMarkChar, R_N, E_N, 0 }
, { "Member", nullptr, MarkType::kMember, R_Y, E_N, M_CSST }
, { "Method", &fMethodMap, MarkType::kMethod, R_Y, E_Y, M_CSST }
-, { "NoExample", nullptr, MarkType::kNoExample, R_O, E_N, M_CSST | M_E | M(Method) }
+, { "NoExample", nullptr, MarkType::kNoExample, R_N, E_N, M_CSST | M_E | M(Method) }
, { "Outdent", nullptr, MarkType::kOutdent, R_N, E_N, M(Code) }
, { "Param", nullptr, MarkType::kParam, R_Y, E_N, M(Method) }
, { "PhraseDef", nullptr, MarkType::kPhraseDef, R_Y, E_N, M(Subtopic) }
@@ -1338,6 +1353,8 @@ public:
#undef R_O
#undef R_N
#undef R_Y
+#undef R_F
+#undef R_C
#undef M_E
#undef M_CSST
@@ -1346,6 +1363,10 @@ public:
#undef M_D
#undef M
+#undef E_Y
+#undef E_N
+#undef E_O
+
~BmhParser() override {}
bool addDefinition(const char* defStart, bool hasEnd, MarkType markType,
@@ -1634,6 +1655,8 @@ public:
this->addDefinition(container);
}
+ bool references(const SkString& file) const;
+
static void RemoveFile(const char* docs, const char* includes);
static void RemoveOneFile(const char* docs, const char* includesFileOrPath);
@@ -1888,6 +1911,11 @@ public:
kChars,
};
+ enum class MemberPass {
+ kCount,
+ kOut,
+ };
+
struct IterState {
IterState (list<Definition>::iterator tIter, list<Definition>::iterator tIterEnd)
: fDefIter(tIter)
@@ -1902,6 +1930,17 @@ public:
const ParentPair* fPrev;
};
+ struct Preprocessor {
+ Preprocessor()
+ : fStart(nullptr)
+ , fEnd(nullptr)
+ , fWord(false) {
+ }
+ const char* fStart;
+ const char* fEnd;
+ bool fWord;
+ };
+
IncludeWriter() : IncludeParser() {
this->reset();
}
@@ -1924,7 +1963,10 @@ public:
void descriptionOut(const Definition* def, SkipFirstLine , Phrase );
void enumHeaderOut(const RootDefinition* root, const Definition& child);
void enumMembersOut(const RootDefinition* root, Definition& child);
+ bool enumPreprocessor(Definition* token, MemberPass pass,
+ vector<IterState>& iterStack, IterState** iterState, Preprocessor* );
void enumSizeItems(const Definition& child);
+ bool findEnumSubtopic(string undername, const Definition** ) const;
Definition* findMemberCommentBlock(const vector<Definition*>& bmhChildren, const string& name) const;
int lookupMethod(const PunctuationState punctuation, const Word word,
const int start, const int run, int lastWrite,
@@ -2101,7 +2143,7 @@ public:
this->reset();
}
- bool buildReferences(const char* docDir, const char* mdOutDirOrFile);
+ bool buildReferences(const IncludeParser& , const char* docDir, const char* mdOutDirOrFile);
bool buildStatus(const char* docDir, const char* mdOutDir);
static constexpr const char* kClassesAndStructs = "Class_or_Struct";
@@ -2137,7 +2179,7 @@ private:
void childrenOut(const Definition* def, const char* contentStart);
const Definition* csParent() const;
const Definition* findParamType();
- const Definition* isDefined(const TextParser& parser, const string& ref, bool report);
+ const Definition* isDefined(const TextParser& , const string& ref, BmhParser::Resolvable );
string linkName(const Definition* ) const;
string linkRef(const string& leadingSpaces, const Definition*, const string& ref,
BmhParser::Resolvable ) const;
@@ -2166,7 +2208,8 @@ private:
fHasFiddle = false;
fInDescription = false;
fInList = false;
- fRespectLeadingSpace = false;
+ fResolveAndIndent = false;
+ fLiteralAndIndent = false;
}
BmhParser::Resolvable resolvable(const Definition* definition) const {
@@ -2204,7 +2247,8 @@ private:
bool fInDescription; // FIXME: for now, ignore unfound camelCase in description since it may
// be defined in example which at present cannot be linked to
bool fInList;
- bool fRespectLeadingSpace;
+ bool fLiteralAndIndent;
+ bool fResolveAndIndent;
typedef ParserCommon INHERITED;
};
diff --git a/tools/bookmaker/cataloger.cpp b/tools/bookmaker/cataloger.cpp
index a564d3ee98..de46ecd1a7 100644
--- a/tools/bookmaker/cataloger.cpp
+++ b/tools/bookmaker/cataloger.cpp
@@ -86,7 +86,7 @@ bool Catalog::parseFromFile(const char* path) {
this->writeString("var text = {");
this->lf(1);
fTextOut = true;
- TextParser::Save save(this);
+ TextParserSave save(this);
if (!parseFiddles()) {
return false;
}
diff --git a/tools/bookmaker/definition.cpp b/tools/bookmaker/definition.cpp
index 14f6daab81..e3a5aa3bd5 100644
--- a/tools/bookmaker/definition.cpp
+++ b/tools/bookmaker/definition.cpp
@@ -200,7 +200,7 @@ bool Definition::parseOperator(size_t doubleColons, string& result) {
SkAssertResult(iParser.skipExact("operator"));
iParser.skipWhiteSpace();
fMethodType = Definition::MethodType::kOperator;
- TextParser::Save save(&iParser);
+ TextParserSave save(&iParser);
for (auto parser : opData) {
save.restore();
if (!iParser.skipExact(parser.fSymbol)) {
@@ -670,7 +670,7 @@ string Definition::formatFunction(Format format) const {
indent = (size_t) (lastEnd - lastStart);
}
// trim indent so longest line doesn't exceed box width
- TextParser::Save savePlace(&methodParser);
+ TextParserSave savePlace(&methodParser);
const char* saveStart = lastStart;
ptrdiff_t maxLine = 0;
do {
@@ -889,7 +889,7 @@ string Definition::methodName() const {
bool Definition::nextMethodParam(TextParser* methodParser, const char** nextEndPtr,
string* paramName) const {
int parenCount = 0;
- TextParser::Save saveState(methodParser);
+ TextParserSave saveState(methodParser);
while (true) {
if (methodParser->eof()) {
return methodParser->reportError<bool>("#Method function missing close paren");
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index 8365a82d1c..4040fb6d15 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -1363,9 +1363,6 @@ bool IncludeParser::parseEnum(Definition* child, Definition* markupDef) {
markupChild->fName = markupDef->fName + "::" +
string(nameStart, (size_t) (enumName.fChar - nameStart));
}
- if (string::npos != markupChild->fName.find("SkColorType")) {
- SkDebugf("");
- }
if (!this->findComments(*child, markupChild)) {
return false;
}
@@ -1433,7 +1430,7 @@ bool IncludeParser::parseEnum(Definition* child, Definition* markupDef) {
if ('/' == parser.next()) {
char slashStar = parser.next();
if ('/' == slashStar || '*' == slashStar) {
- TextParser::Save save(&parser);
+ TextParserSave save(&parser);
char doxCheck = parser.next();
if ((slashStar != doxCheck && '!' != doxCheck) || '<' != parser.next()) {
save.restore();
@@ -1954,7 +1951,7 @@ bool IncludeParser::parseChar() {
return reportError<bool>("malformed closing comment");
}
if (Bracket::kSlashStar == this->topBracket()) {
- TextParser::Save save(this);
+ TextParserSave save(this);
this->next(); // include close in bracket
this->popBracket();
save.restore(); // put things back so nothing is skipped
@@ -2316,6 +2313,27 @@ void IncludeParser::validate() const {
IncludeParser::ValidateKeyWords();
}
+bool IncludeParser::references(const SkString& file) const {
+ // if includes weren't passed one at a time, assume all references are valid
+ if (fIncludeMap.empty()) {
+ return true;
+ }
+ SkASSERT(file.endsWith(".bmh") );
+ string root(file.c_str(), file.size() - 4);
+ string kReference("_Reference");
+ if (string::npos != root.find(kReference)) {
+ root = root.substr(0, root.length() - kReference.length());
+ }
+ if (fIClassMap.end() != fIClassMap.find(root)) {
+ return true;
+ }
+ if (fIStructMap.end() != fIStructMap.find(root)) {
+ return true;
+ }
+ // TODO incomplete: probably need to look in other places for class-less includes like SkColor.h
+ return false;
+}
+
void IncludeParser::RemoveFile(const char* docs, const char* includes) {
if (!sk_isdir(includes)) {
IncludeParser::RemoveOneFile(docs, includes);
diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp
index 067c014070..5b2f8076bc 100644
--- a/tools/bookmaker/includeWriter.cpp
+++ b/tools/bookmaker/includeWriter.cpp
@@ -375,43 +375,11 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
vector<IterState> iterStack;
iterStack.emplace_back(child.fTokens.begin(), child.fTokens.end());
IterState* iterState = &iterStack[0];
- bool preprocessorWord = false;
- const char* preprocessStart = nullptr;
- const char* preprocessEnd = nullptr;
+ Preprocessor preprocessor;
for (int onePast = 0; onePast < 2; onePast += iterState->fDefIter == iterState->fDefEnd) {
Definition* token = onePast ? nullptr : &*iterState->fDefIter++;
- if (token && Definition::Type::kBracket == token->fType) {
- if (Bracket::kSlashSlash == token->fBracket) {
- fStart = token->fContentEnd;
- continue; // ignore old inline comments
- }
- if (Bracket::kSlashStar == token->fBracket) {
- fStart = token->fContentEnd + 1;
- continue; // ignore old inline comments
- }
- if (Bracket::kPound == token->fBracket) { // preprocessor wraps member
- preprocessStart = token->fContentStart;
- if (KeyWord::kIf == token->fKeyWord || KeyWord::kIfdef == token->fKeyWord) {
- iterStack.emplace_back(token->fTokens.begin(), token->fTokens.end());
- iterState = &iterStack.back();
- preprocessorWord = true;
- } else if (KeyWord::kEndif == token->fKeyWord) {
- iterStack.pop_back();
- iterState = &iterStack.back();
- preprocessEnd = token->fContentEnd;
- } else {
- SkASSERT(0); // incomplete
- }
- continue;
- }
- SkASSERT(0); // incomplete
- }
- if (token && Definition::Type::kWord != token->fType) {
- SkASSERT(0); // incomplete
- }
- if (preprocessorWord) {
- preprocessorWord = false;
- preprocessEnd = token->fContentEnd;
+ if (this->enumPreprocessor(token, MemberPass::kOut, iterStack, &iterState,
+ &preprocessor)) {
continue;
}
if (token && State::kItemName == state) {
@@ -462,16 +430,17 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
fIndent -= 4;
}
this->lfcr();
- if (preprocessStart) {
- SkASSERT(preprocessEnd);
+ if (preprocessor.fStart) {
+ SkASSERT(preprocessor.fEnd);
int saveIndent = fIndent;
fIndent = SkTMax(0, fIndent - 8);
this->lf(2);
- this->writeBlock((int) (preprocessEnd - preprocessStart), preprocessStart);
+ this->writeBlock(
+ (int) (preprocessor.fEnd - preprocessor.fStart), preprocessor.fStart);
this->lfcr();
fIndent = saveIndent;
- preprocessStart = nullptr;
- preprocessEnd = nullptr;
+ preprocessor.fStart = nullptr;
+ preprocessor.fEnd = nullptr;
}
if (token && State::kItemValue == state) {
fStart = token->fContentStart;
@@ -538,8 +507,11 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
this->writeString(currentEnumItem->fToBeDeprecated
? "To be deprecated soon." : "Deprecated.");
}
+ TextParserSave save(this);
+ this->setForErrorReporting(currentEnumItem, commentStart);
wroteLineFeed = Wrote::kLF ==
this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
+ save.restore();
fIndent -= 4;
if (wroteLineFeed || fColumn > 100 - 3 /* space * / */ ) {
this->lfcr();
@@ -559,6 +531,55 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
}
}
+bool IncludeWriter::enumPreprocessor(Definition* token, MemberPass pass,
+ vector<IterState>& iterStack, IterState** iterState, Preprocessor* preprocessor) {
+ if (token && Definition::Type::kBracket == token->fType) {
+ if (Bracket::kSlashSlash == token->fBracket) {
+ if (MemberPass::kOut == pass) {
+ fStart = token->fContentEnd;
+ }
+ return true; // ignore old inline comments
+ }
+ if (Bracket::kSlashStar == token->fBracket) {
+ if (MemberPass::kOut == pass) {
+ fStart = token->fContentEnd + 1;
+ }
+ return true; // ignore old inline comments
+ }
+ if (Bracket::kPound == token->fBracket) { // preprocessor wraps member
+ preprocessor->fStart = token->fContentStart;
+ if (KeyWord::kIf == token->fKeyWord || KeyWord::kIfdef == token->fKeyWord) {
+ iterStack.emplace_back(token->fTokens.begin(), token->fTokens.end());
+ *iterState = &iterStack.back();
+ preprocessor->fWord = true;
+ } else if (KeyWord::kEndif == token->fKeyWord || KeyWord::kElif == token->fKeyWord
+ || KeyWord::kElse == token->fKeyWord) {
+ iterStack.pop_back();
+ *iterState = &iterStack.back();
+ preprocessor->fEnd = token->fContentEnd;
+ if (KeyWord::kElif == token->fKeyWord) {
+ iterStack.emplace_back(token->fTokens.begin(), token->fTokens.end());
+ *iterState = &iterStack.back();
+ preprocessor->fWord = true;
+ }
+ } else {
+ SkASSERT(0); // incomplete
+ }
+ return true;
+ }
+ return true;
+ }
+ if (token && Definition::Type::kWord != token->fType) {
+ SkASSERT(0); // incomplete
+ }
+ if (preprocessor->fWord) {
+ preprocessor->fWord = false;
+ preprocessor->fEnd = token->fContentEnd;
+ return true;
+ }
+ return false;
+}
+
void IncludeWriter::enumSizeItems(const Definition& child) {
enum class State {
kNoItem,
@@ -580,36 +601,11 @@ void IncludeWriter::enumSizeItems(const Definition& child) {
vector<IterState> iterStack;
iterStack.emplace_back(brace->fTokens.begin(), brace->fTokens.end());
IterState* iterState = &iterStack[0];
- bool preprocessorWord = false;
+ Preprocessor preprocessor;
while (iterState->fDefIter != iterState->fDefEnd) {
auto& token = *iterState->fDefIter++;
- if (Definition::Type::kBracket == token.fType) {
- if (Bracket::kSlashSlash == token.fBracket) {
- continue; // ignore old inline comments
- }
- if (Bracket::kSlashStar == token.fBracket) {
- continue; // ignore old inline comments
- }
- if (Bracket::kPound == token.fBracket) { // preprocessor wraps member
- if (KeyWord::kIf == token.fKeyWord || KeyWord::kIfdef == token.fKeyWord) {
- iterStack.emplace_back(token.fTokens.begin(), token.fTokens.end());
- iterState = &iterStack.back();
- preprocessorWord = true;
- } else if (KeyWord::kEndif == token.fKeyWord) {
- iterStack.pop_back();
- iterState = &iterStack.back();
- } else {
- SkASSERT(0); // incomplete
- }
- continue;
- }
- SkASSERT(0); // incomplete
- }
- if (Definition::Type::kWord != token.fType) {
- SkASSERT(0); // incomplete
- }
- if (preprocessorWord) {
- preprocessorWord = false;
+ if (this->enumPreprocessor(&token, MemberPass::kCount, iterStack, &iterState,
+ &preprocessor)) {
continue;
}
if (State::kItemName == state) {
@@ -763,6 +759,17 @@ void IncludeWriter::structOut(const Definition* root, const Definition& child,
this->writeCommentTrailer();
}
+bool IncludeWriter::findEnumSubtopic(string undername, const Definition** rootDefPtr) const {
+ const Definition* subtopic = fEnumDef->fParent;
+ string subcheck = subtopic->fFiddle + '_' + undername;
+ auto iter = fBmhParser->fTopicMap.find(subcheck);
+ if (iter == fBmhParser->fTopicMap.end()) {
+ return false;
+ }
+ *rootDefPtr = iter->second;
+ return true;
+}
+
Definition* IncludeWriter::findMemberCommentBlock(const vector<Definition*>& bmhChildren,
const string& name) const {
for (auto memberDef : bmhChildren) {
@@ -1038,9 +1045,6 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
const Definition* requireDense = nullptr;
const Definition* startDef = nullptr;
for (auto& child : def->fTokens) {
- if (51 == child.fLineCount) {
- SkDebugf("");
- }
if (KeyWord::kOperator == child.fKeyWord && method &&
Definition::MethodType::kOperator == method->fMethodType) {
eatOperator = true;
@@ -1728,8 +1732,10 @@ string IncludeWriter::resolveRef(const char* start, const char* end, bool first,
auto aliasIter = fBmhParser->fAliasMap.find(undername);
if (fBmhParser->fAliasMap.end() != aliasIter) {
rootDef = aliasIter->second;
+ } else if (fInEnum && fEnumDef && this->findEnumSubtopic(undername, &rootDef)) {
+ ;
} else if (!first) {
- SkDebugf("unfound: %s\n", undername.c_str());
+ this->fChar = start;
this->reportError("reference unfound");
return "";
}
diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp
index 80d3e21faa..4b4e2b89be 100644
--- a/tools/bookmaker/mdOut.cpp
+++ b/tools/bookmaker/mdOut.cpp
@@ -93,8 +93,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
continue;
}
ref = string(start, t.fChar - start);
- if (const Definition* def = this->isDefined(t, ref,
- BmhParser::Resolvable::kOut != resolvable)) {
+ if (const Definition* def = this->isDefined(t, ref, resolvable)) {
if (MarkType::kExternal == def->fMarkType) {
add_ref(leadingSpaces, ref, &result);
continue;
@@ -122,7 +121,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
}
string altTest = ref + '_';
altTest += suffix++;
- altDef = this->isDefined(t, altTest, false);
+ altDef = this->isDefined(t, altTest, BmhParser::Resolvable::kOut);
}
if (suffix > '9') {
t.reportError("too many alts");
@@ -130,13 +129,18 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
return result;
}
if (!foundMatch) {
- if (!(def = this->isDefined(t, fullRef,
- BmhParser::Resolvable::kOut != resolvable))) {
- if (!result.size()) {
+ if (!(def = this->isDefined(t, fullRef, resolvable))) {
+ if (BmhParser::Resolvable::kFormula == resolvable) {
+ // TODO: look for looser mapping -- if methods name match, look for
+ // unique mapping based on number of parameters
+ // for now, just look for function name match
+ def = this->isDefined(t, ref, resolvable);
+ }
+ if (!def && !result.size()) {
t.reportError("missing method");
fAddRefFailed = true;
+ return result;
}
- return result;
}
ref = fullRef;
}
@@ -145,6 +149,11 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
add_ref(leadingSpaces, ref, &result);
continue;
}
+ if (!def) {
+ t.reportError("missing method");
+ fAddRefFailed = true;
+ return result;
+ }
result += linkRef(leadingSpaces, def, ref, resolvable);
continue;
}
@@ -156,7 +165,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
}
t.next();
ref = string(start, t.fChar - start);
- if (const Definition* def = this->isDefined(t, ref, true)) {
+ if (const Definition* def = this->isDefined(t, ref, BmhParser::Resolvable::kYes)) {
SkASSERT(def->fFiddle.length());
result += linkRef(leadingSpaces, def, ref, resolvable);
continue;
@@ -173,15 +182,15 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
if (BmhParser::Resolvable::kOut != resolvable) {
t.reportError("missed Sk prefixed");
fAddRefFailed = true;
+ return result;
}
- return result;
}
if (!ref.compare(0, 2, "SK")) {
if (BmhParser::Resolvable::kOut != resolvable) {
t.reportError("missed SK prefixed");
fAddRefFailed = true;
+ return result;
}
- return result;
}
if (!isupper(start[0])) {
// TODO:
@@ -209,7 +218,8 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
}
}
}
- if (BmhParser::Resolvable::kOut != resolvable) {
+ if (BmhParser::Resolvable::kOut != resolvable &&
+ BmhParser::Resolvable::kFormula != resolvable) {
t.reportError("missed camelCase");
fAddRefFailed = true;
return result;
@@ -236,7 +246,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
if (isupper(t.fChar[1]) && startsSentence) {
TextParser next(t.fFileName, &t.fChar[1], t.fEnd, t.fLineCount);
string nextWord(next.fChar, next.wordEnd() - next.fChar);
- if (this->isDefined(t, nextWord, true)) {
+ if (this->isDefined(t, nextWord, BmhParser::Resolvable::kYes)) {
add_ref(leadingSpaces, ref, &result);
continue;
}
@@ -261,6 +271,8 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
if (BmhParser::Resolvable::kOut != resolvable) {
t.reportError("undefined reference");
fAddRefFailed = true;
+ } else {
+ add_ref(leadingSpaces, ref, &result);
}
}
} while (!t.eof());
@@ -269,25 +281,22 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
-bool MdOut::buildReferences(const char* docDir, const char* mdFileOrPath) {
+bool MdOut::buildReferences(const IncludeParser& includeParser, const char* docDir,
+ const char* mdFileOrPath) {
if (!sk_isdir(mdFileOrPath)) {
- SkString mdFile = SkOSPath::Basename(mdFileOrPath);
- SkString bmhFile = SkOSPath::Join(docDir, mdFile.c_str());
- bmhFile.remove(bmhFile.size() - 3, 3);
- bmhFile += ".bmh";
- SkString mdPath = SkOSPath::Dirname(mdFileOrPath);
- if (!this->buildRefFromFile(bmhFile.c_str(), mdPath.c_str())) {
- SkDebugf("failed to parse %s\n", mdFileOrPath);
- return false;
+ SkDebugf("must pass directory %s\n", mdFileOrPath);
+ SkDebugf("pass -i SkXXX.h to build references for a single include\n");
+ return false;
+ }
+ SkOSFile::Iter it(docDir, ".bmh");
+ for (SkString file; it.next(&file); ) {
+ if (!includeParser.references(file)) {
+ continue;
}
- } else {
- SkOSFile::Iter it(docDir, ".bmh");
- for (SkString file; it.next(&file); ) {
- SkString p = SkOSPath::Join(docDir, file.c_str());
- if (!this->buildRefFromFile(p.c_str(), mdFileOrPath)) {
- SkDebugf("failed to parse %s\n", p.c_str());
- return false;
- }
+ SkString p = SkOSPath::Join(docDir, file.c_str());
+ if (!this->buildRefFromFile(p.c_str(), mdFileOrPath)) {
+ SkDebugf("failed to parse %s\n", p.c_str());
+ return false;
}
}
return true;
@@ -409,7 +418,7 @@ bool MdOut::checkParamReturnBody(const Definition* def) {
if (!islower(descriptionStart[0]) && !isdigit(descriptionStart[0])) {
paramBody.skipToNonAlphaNum();
string ref = string(descriptionStart, paramBody.fChar - descriptionStart);
- if (!this->isDefined(paramBody, ref, true)) {
+ if (!this->isDefined(paramBody, ref, BmhParser::Resolvable::kYes)) {
string errorStr = MarkType::kReturn == def->fMarkType ? "return" : "param";
errorStr += " description must start with lower case";
paramBody.reportError(errorStr.c_str());
@@ -484,7 +493,8 @@ const Definition* MdOut::findParamType() {
SkASSERT(!parser.eof());
string name = string(word, parser.fChar - word);
if (fLastParam->fName == name) {
- const Definition* paramType = this->isDefined(parser, lastFull, false);
+ const Definition* paramType = this->isDefined(parser, lastFull,
+ BmhParser::Resolvable::kOut);
return paramType;
}
if (isupper(name[0])) {
@@ -494,7 +504,8 @@ const Definition* MdOut::findParamType() {
return nullptr;
}
-const Definition* MdOut::isDefined(const TextParser& parser, const string& ref, bool report) {
+const Definition* MdOut::isDefined(const TextParser& parser, const string& ref,
+ BmhParser::Resolvable resolvable) {
auto rootIter = fBmhParser.fClassMap.find(ref);
if (rootIter != fBmhParser.fClassMap.end()) {
return &rootIter->second;
@@ -613,7 +624,8 @@ const Definition* MdOut::isDefined(const TextParser& parser, const string& ref,
return nullptr;
}
} else {
- if (report) {
+ if (BmhParser::Resolvable::kOut != resolvable &&
+ BmhParser::Resolvable::kFormula != resolvable) {
parser.reportError("SK undefined");
fAddRefFailed = true;
}
@@ -643,7 +655,8 @@ const Definition* MdOut::isDefined(const TextParser& parser, const string& ref,
return definition;
}
}
- if (report) {
+ if (BmhParser::Resolvable::kOut != resolvable &&
+ BmhParser::Resolvable::kFormula != resolvable) {
parser.reportError("_ undefined");
fAddRefFailed = true;
}
@@ -797,6 +810,7 @@ void MdOut::markTypeOut(Definition* def) {
FPRINTF("<pre style=\"padding: 1em 1em 1em 1em;"
"width: 62.5em; background-color: #f0f0f0\">");
this->lf(1);
+ fResolveAndIndent = true;
break;
case MarkType::kColumn:
this->writePending();
@@ -889,7 +903,7 @@ void MdOut::markTypeOut(Definition* def) {
if (def->fWrapper.length() > 0) {
FPRINTF("%s", def->fWrapper.c_str());
}
- fRespectLeadingSpace = true;
+ fLiteralAndIndent = true;
}
} break;
case MarkType::kExperimental:
@@ -1107,7 +1121,8 @@ void MdOut::markTypeOut(Definition* def) {
case MarkType::kWidth:
break;
case MarkType::kPhraseDef:
- break;
+ // skip text and children
+ return;
case MarkType::kPhraseRef:
if (fBmhParser.fPhraseMap.end() == fBmhParser.fPhraseMap.find(def->fName)) {
def->reportError<void>("missing phrase definition");
@@ -1139,9 +1154,12 @@ void MdOut::markTypeOut(Definition* def) {
}
break;
case MarkType::kCode:
+ fIndent = 0;
+ this->lf(1);
this->writePending();
FPRINTF("</pre>");
this->lf(2);
+ fResolveAndIndent = false;
break;
case MarkType::kColumn:
if (fInList) {
@@ -1174,7 +1192,7 @@ void MdOut::markTypeOut(Definition* def) {
FPRINTF("</pre>");
}
this->lf(2);
- fRespectLeadingSpace = false;
+ fLiteralAndIndent = false;
break;
case MarkType::kLink:
this->writeString("</a>");
@@ -1317,10 +1335,16 @@ void MdOut::populateTables(const Definition* def) {
}
void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable resolvable) {
- if ((BmhParser::Resolvable::kLiteral == resolvable || fRespectLeadingSpace) && end > start) {
+ if ((BmhParser::Resolvable::kLiteral == resolvable || fLiteralAndIndent ||
+ fResolveAndIndent) && end > start) {
+ int linefeeds = 0;
while ('\n' == *start) {
+ ++linefeeds;
++start;
}
+ if (fResolveAndIndent && linefeeds) {
+ this->lf(linefeeds);
+ }
const char* spaceStart = start;
while (' ' == *start) {
++start;
@@ -1328,6 +1352,8 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable
if (start > spaceStart) {
fIndent = start - spaceStart;
}
+ }
+ if (BmhParser::Resolvable::kLiteral == resolvable || fLiteralAndIndent) {
this->writeBlockTrim(end - start, start);
if ('\n' == end[-1]) {
this->lf(1);
@@ -1347,14 +1373,20 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable
trim_end_spaces(resolved);
if (resolved.length()) {
TextParser paragraph(fFileName, &*resolved.begin(), &*resolved.end(), fLineCount);
- TextParser original(fFileName, start, end, fLineCount);
- while (!original.eof() && '\n' == original.peek()) {
- original.next();
- }
- original.skipSpace();
while (!paragraph.eof()) {
+ while ('\n' == paragraph.peek()) {
+ paragraph.next();
+ if (paragraph.eof()) {
+ return;
+ }
+ }
+ const char* lineStart = paragraph.fChar;
paragraph.skipWhiteSpace();
const char* contentStart = paragraph.fChar;
+ if (fResolveAndIndent && contentStart > lineStart) {
+ this->writePending();
+ this->indentToColumn(contentStart - lineStart);
+ }
paragraph.skipToEndBracket('\n');
ptrdiff_t lineLength = paragraph.fChar - contentStart;
if (lineLength) {
@@ -1364,17 +1396,6 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable
string str(contentStart, lineLength);
this->writeString(str.c_str());
}
-#if 0
- int linefeeds = 0;
- while (lineLength > 0 && '\n' == contentStart[--lineLength]) {
-
- ++linefeeds;
- }
- if (lineLength > 0) {
- this->nl();
- }
- fLinefeeds += linefeeds;
-#endif
if (paragraph.eof()) {
break;
}
@@ -1386,12 +1407,6 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable
this->lf(linefeeds);
}
}
-#if 0
- while (end > start && end[0] == '\n') {
- FPRINTF("\n");
- --end;
- }
-#endif
}
}
diff --git a/tools/bookmaker/parserCommon.cpp b/tools/bookmaker/parserCommon.cpp
index 2e9ad81e45..072c996df3 100644
--- a/tools/bookmaker/parserCommon.cpp
+++ b/tools/bookmaker/parserCommon.cpp
@@ -14,13 +14,13 @@ static void debug_out(int len, const char* data) {
SkDebugf("%.*s", len, data);
}
-bool ParserCommon::parseFile(const char* fileOrPath, const char* suffix) {
+bool ParserCommon::parseFile(const char* fileOrPath, const char* suffix, OneFile oneFile) {
if (!sk_isdir(fileOrPath)) {
if (!this->parseFromFile(fileOrPath)) {
SkDebugf("failed to parse %s\n", fileOrPath);
return false;
}
- } else {
+ } else if (OneFile::kNo == oneFile) {
SkOSFile::Iter it(fileOrPath, suffix);
for (SkString file; it.next(&file); ) {
SkString p = SkOSPath::Join(fileOrPath, file.c_str());