aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-07-11 16:18:41 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-11 21:21:28 +0000
commit80247e594d1fb168e11a19ce6a73a7e7169ec1f5 (patch)
tree005fe49ae8985ff6b80e73c71fd255220501c199 /docs
parent8885550dbc1972311cdf8f08b6fc8c0778fc1d33 (diff)
Publish docs for rrect, picture, blendmode
Complete basic docs for SkRRect, SkPicture, SkBlendMode. Add a new rule that checks the main description tense. Check for spelling errors. R=caryclark@google.com Docs-Preview: https://skia.org/?cl=138542 Bug: skia:6898 Change-Id: Iba547873775a89f1d652be9b0219b84ffa8d0628 Reviewed-on: https://skia-review.googlesource.com/138542 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkBitmap_Reference.bmh17
-rw-r--r--docs/SkBlendMode_Reference.bmh2
-rw-r--r--docs/SkCanvas_Reference.bmh194
-rw-r--r--docs/SkMatrix_Reference.bmh48
-rw-r--r--docs/SkPaint_Reference.bmh63
-rw-r--r--docs/SkPath_Reference.bmh84
-rw-r--r--docs/SkPicture_Reference.bmh332
-rw-r--r--docs/SkPoint_Reference.bmh1
-rw-r--r--docs/SkRRect_Reference.bmh266
-rw-r--r--docs/SkSurface_Reference.bmh5
-rw-r--r--docs/undocumented.bmh9
-rw-r--r--docs/usingBookmaker.bmh6
12 files changed, 674 insertions, 353 deletions
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh
index ab9d7c8730..d57f0b85b8 100644
--- a/docs/SkBitmap_Reference.bmh
+++ b/docs/SkBitmap_Reference.bmh
@@ -471,7 +471,7 @@ rowBytes() / info().bytesPerPixel()
##
.
-Maybe be less than pixelRef().width(). Will not exceed pixelRef().width() less
+May be less than pixelRef().width(). Will not exceed pixelRef().width() less
pixelRefOrigin().fX.
#Return pixel width in Image_Info ##
@@ -777,7 +777,7 @@ width: 2 height: 2 empty: false
#Method bool isNull() const
#In Property
#Line # returns true if Pixel_Ref is nullptr ##
-Return true if Pixel_Ref is nullptr.
+Returns true if Pixel_Ref is nullptr.
Does not check if width() or height() are zero; call drawsNothing to check
width(), height(), and Pixel_Ref.
@@ -807,7 +807,7 @@ allocated bitmap does have pixels
#Method bool drawsNothing() const
#In Property
#Line # returns true if no width(), no height(), or no Pixel_Ref ##
-Return true if width() or height() are zero, or if Pixel_Ref is nullptr.
+Returns true if width() or height() are zero, or if Pixel_Ref is nullptr.
If true, Bitmap has no effect when drawn or drawn into.
#Return true if drawing has no effect ##
@@ -1108,8 +1108,8 @@ isOpaque: true
#Method bool isVolatile() const
#In Property
#Line # returns true if pixels should not be cached ##
-If true, provides a hint to caller that pixels should not
-be cached. Only true if setIsVolatile has been called to mark as volatile.
+Provides a hint to caller that pixels should not be cached. Only true if
+setIsVolatile has been called to mark as volatile.
Volatile state is not shared by other bitmaps sharing the same Pixel_Ref.
@@ -1404,6 +1404,7 @@ Calls reset() and returns false if:
# imageInfo.height() is negative ##
# rowBytes is positive and less than imageInfo.width() times imageInfo.bytesPerPixel ##
##
+.
#Param imageInfo contains width, height, Alpha_Type, Color_Type, Color_Space ##
#Param rowBytes imageInfo.minRowBytes or larger; or zero ##
@@ -2572,6 +2573,7 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
# x is negative, or not less than width() ##
# y is negative, or not less than height() ##
##
+.
#Param x column index, zero or greater, and less than width() ##
#Param y row index, zero or greater, and less than height() ##
@@ -2607,6 +2609,7 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
# x is negative, or not less than width() ##
# y is negative, or not less than height() ##
##
+.
#Param x column index, zero or greater, and less than width() ##
#Param y row index, zero or greater, and less than height() ##
@@ -2648,6 +2651,7 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
# x is negative, or not less than width() ##
# y is negative, or not less than height() ##
##
+.
#Param x column index, zero or greater, and less than width() ##
#Param y row index, zero or greater, and less than height() ##
@@ -2693,7 +2697,7 @@ Return false if:
# Pixel_Ref is nullptr ##
# subset does not intersect bounds() ##
##
-
+.
#Param dst Bitmap set to subset ##
#Param subset rectangle of pixels to reference ##
@@ -2759,6 +2763,7 @@ row to the next. Returns true if pixels are copied. Returns false if:
# dstRowBytes is less than dstInfo.minRowBytes ##
# Pixel_Ref is nullptr ##
##
+.
Pixels are copied only if pixel conversion is possible. If Bitmap colorType is
kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match.
diff --git a/docs/SkBlendMode_Reference.bmh b/docs/SkBlendMode_Reference.bmh
index 494ff4fb30..3e4aa4c168 100644
--- a/docs/SkBlendMode_Reference.bmh
+++ b/docs/SkBlendMode_Reference.bmh
@@ -751,7 +751,7 @@ Da as destination Alpha, Dc as destination Color component
, scaling Alpha and Color components by the lesser of the values.
SkBlendMode::kModulate differs from SkBlendMode::kMultiply in two ways.
SkBlendMode::kModulate like SkBlendMode::kSrcATop alters the destination inside
-the destination area, as if the destination Alpha defined the boudaries of a
+the destination area, as if the destination Alpha defined the boundaries of a
soft clip. SkBlendMode::kMultiply like SkBlendMode::kSrcOver can alter the
destination where the destination is transparent.
SkBlendMode::kModulate computes the product of the source and destination using
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index bfd3e9d7d1..db14d0190b 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -307,7 +307,7 @@ different characteristics, it is best not to rely on this legacy behavior.
#Method explicit SkCanvas(const SkBitmap& bitmap)
#Line # uses existing Bitmap ##
-Construct a canvas that draws into bitmap.
+Constructs a canvas that draws into bitmap.
Sets SkSurfaceProps::kLegacyFontHost_InitType in constructed Surface.
Bitmap is copied so that subsequently editing bitmap will not affect
@@ -387,7 +387,7 @@ Android framework only.
#Line # exists for Android framework only ##
-Android framework only.
+For use by Android framework only.
#Param bitmap specifies a bitmap for the canvas to draw into ##
#Param behavior specializes this constructor; value is unused ##
@@ -402,7 +402,7 @@ Android framework only.
#Method SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)
#Line # uses existing Bitmap and Surface_Properties ##
-Construct a canvas that draws into bitmap.
+Constructs a canvas that draws into bitmap.
Use props to match the device characteristics, like LCD striping.
bitmap is copied so that subsequently editing bitmap will not affect
@@ -562,9 +562,8 @@ GPU_Surface, returned Color_Type is set to kUnknown_SkColorType.
#Method bool getProps(SkSurfaceProps* props) const
#In Property
#Line # copies Surface_Properties if available ##
-If Canvas is associated with Raster_Surface or
-GPU_Surface, copies Surface_Properties and returns true. Otherwise,
-return false and leave props unchanged.
+Copies Surface_Properties, if Canvas is associated with Raster_Surface or
+GPU_Surface, and returns true. Otherwise, returns false and leave props unchanged.
#Param props storage for writable SkSurfaceProps ##
@@ -944,6 +943,7 @@ Does not copy, and returns false if:
# Canvas pixels are not readable; for instance, Canvas is document-based. ##
# dstRowBytes is too small to contain one row of pixels. ##
##
+.
#Param dstInfo width, height, Color_Type, and Alpha_Type of dstPixels ##
#Param dstPixels storage for pixels; dstInfo.height() times dstRowBytes, or larger ##
@@ -1037,6 +1037,7 @@ Does not copy, and returns false if:
# Pixmap pixels could not be allocated. ##
# pixmap.rowBytes() is too small to contain one row of pixels. ##
##
+.
#Param pixmap storage for pixels copied from Canvas ##
#Param srcX offset into readable pixels on x-axis; may be negative ##
@@ -1100,6 +1101,7 @@ Does not copy, and returns false if:
# bitmap pixels could not be allocated. ##
# bitmap.rowBytes() is too small to contain one row of pixels. ##
##
+.
#Param bitmap storage for pixels copied from Canvas ##
#Param srcX offset into readable pixels on x-axis; may be negative ##
@@ -1163,6 +1165,7 @@ Does not copy, and returns false if:
# Canvas pixels are not writable; for instance, Canvas is document-based. ##
# rowBytes is too small to contain one row of pixels. ##
##
+.
#Param info width, height, Color_Type, and Alpha_Type of pixels ##
#Param pixels pixels to copy, of size info.height() times rowBytes, or larger ##
@@ -1222,6 +1225,7 @@ Does not copy, and returns false if:
# Canvas pixels are not writable; for instance, Canvas is document based. ##
# bitmap pixels are inaccessible; for instance, bitmap wraps a texture. ##
##
+.
#Param bitmap contains pixels copied to Canvas ##
#Param x offset into Canvas writable pixels in x; may be negative ##
@@ -2027,9 +2031,9 @@ Outside of the circle the mandrill is brightened.
#In Matrix
#Line # translates Matrix ##
-Translate Matrix by dx along the x-axis and dy along the y-axis.
+Translates Matrix by dx along the x-axis and dy along the y-axis.
-Mathematically, replace Matrix with a translation matrix
+Mathematically, replaces Matrix with a translation matrix
Premultiplied with Matrix.
This has the effect of moving the drawing by (dx, dy) before transforming
@@ -2079,9 +2083,9 @@ void draw(SkCanvas* canvas) {
#In Matrix
#Line # scales Matrix ##
-Scale Matrix by sx on the x-axis and sy on the y-axis.
+Scales Matrix by sx on the x-axis and sy on the y-axis.
-Mathematically, replace Matrix with a scale matrix
+Mathematically, replaces Matrix with a scale matrix
Premultiplied with Matrix.
This has the effect of scaling the drawing by (sx, sy) before transforming
@@ -2113,9 +2117,9 @@ void draw(SkCanvas* canvas) {
#In Matrix
#Line # rotates Matrix ##
-Rotate Matrix by degrees. Positive degrees rotates clockwise.
+Rotates Matrix by degrees. Positive degrees rotates clockwise.
-Mathematically, replace Matrix with a rotation matrix
+Mathematically, replaces Matrix with a rotation matrix
Premultiplied with Matrix.
This has the effect of rotating the drawing by degrees before transforming
@@ -2151,11 +2155,11 @@ void draw(SkCanvas* canvas) {
#Method void rotate(SkScalar degrees, SkScalar px, SkScalar py)
#In Matrix
-Rotate Matrix by degrees about a point at (px, py). Positive degrees rotates
+Rotates Matrix by degrees about a point at (px, py). Positive degrees rotates
clockwise.
-Mathematically, construct a rotation matrix. Premultiply the rotation matrix by
-a translation matrix, then replace Matrix with the resulting matrix
+Mathematically, constructs a rotation matrix; Premultiplies the rotation matrix by
+a translation matrix; then replaces Matrix with the resulting matrix
Premultiplied with Matrix.
This has the effect of rotating the drawing about a given point before
@@ -2186,11 +2190,11 @@ void draw(SkCanvas* canvas) {
#In Matrix
#Line # skews Matrix ##
-Skew Matrix by sx on the x-axis and sy on the y-axis. A positive value of sx
+Skews Matrix by sx on the x-axis and sy on the y-axis. A positive value of sx
skews the drawing right as y-axis values increase; a positive value of sy skews
the drawing down as x-axis values increase.
-Mathematically, replace Matrix with a skew matrix Premultiplied with Matrix.
+Mathematically, replaces Matrix with a skew matrix Premultiplied with Matrix.
This has the effect of skewing the drawing by (sx, sy) before transforming
the result with Matrix.
@@ -2233,7 +2237,7 @@ the result with Matrix.
#In Matrix
#Line # multiplies Matrix by Matrix ##
-Replace Matrix with matrix Premultiplied with existing Matrix.
+Replaces Matrix with matrix Premultiplied with existing Matrix.
This has the effect of transforming the drawn geometry by matrix, before
transforming the result with existing Matrix.
@@ -2267,7 +2271,7 @@ void draw(SkCanvas* canvas) {
#In Matrix
#Line # sets Matrix ##
-Replace Matrix with matrix.
+Replaces Matrix with matrix.
Unlike concat(), any prior matrix state is overwritten.
#Param matrix matrix to copy, replacing existing Matrix ##
@@ -2403,7 +2407,7 @@ and is unaffected by Matrix.
#In Clip
#Line # combines Clip with Rect ##
-Replace Clip with the intersection or difference of Clip and rect,
+Replaces Clip with the intersection or difference of Clip and rect,
with an Aliased or Anti_Aliased clip edge. rect is transformed by Matrix
before it is combined with Clip.
@@ -2434,7 +2438,7 @@ void draw(SkCanvas* canvas) {
#Method void clipRect(const SkRect& rect, SkClipOp op)
#In Clip
-Replace Clip with the intersection or difference of Clip and rect.
+Replaces Clip with the intersection or difference of Clip and rect.
Resulting Clip is Aliased; pixels are fully contained by the clip.
rect is transformed by Matrix before it is combined with Clip.
@@ -2463,7 +2467,7 @@ void draw(SkCanvas* canvas) {
#Method void clipRect(const SkRect& rect, bool doAntiAlias = false)
#In Clip
-Replace Clip with the intersection of Clip and rect.
+Replaces Clip with the intersection of Clip and rect.
Resulting Clip is Aliased; pixels are fully contained by the clip.
rect is transformed by Matrix
before it is combined with Clip.
@@ -2526,7 +2530,7 @@ This private API is for use by Android framework only.
#In Clip
#Line # combines Clip with Round_Rect ##
-Replace Clip with the intersection or difference of Clip and rrect,
+Replaces Clip with the intersection or difference of Clip and rrect,
with an Aliased or Anti_Aliased clip edge.
rrect is transformed by Matrix
before it is combined with Clip.
@@ -2556,7 +2560,7 @@ void draw(SkCanvas* canvas) {
#Method void clipRRect(const SkRRect& rrect, SkClipOp op)
#In Clip
-Replace Clip with the intersection or difference of Clip and rrect.
+Replaces Clip with the intersection or difference of Clip and rrect.
Resulting Clip is Aliased; pixels are fully contained by the clip.
rrect is transformed by Matrix before it is combined with Clip.
@@ -2581,7 +2585,7 @@ void draw(SkCanvas* canvas) {
#Method void clipRRect(const SkRRect& rrect, bool doAntiAlias = false)
#In Clip
-Replace Clip with the intersection of Clip and rrect,
+Replaces Clip with the intersection of Clip and rrect,
with an Aliased or Anti_Aliased clip edge.
rrect is transformed by Matrix before it is combined with Clip.
@@ -2607,7 +2611,7 @@ void draw(SkCanvas* canvas) {
#In Clip
#Line # combines Clip with Path ##
-Replace Clip with the intersection or difference of Clip and path,
+Replaces Clip with the intersection or difference of Clip and path,
with an Aliased or Anti_Aliased clip edge. Path_Fill_Type determines if path
describes the area inside or outside its contours; and if Path_Contour overlaps
itself or another Path_Contour, whether the overlaps form part of the area.
@@ -2649,7 +2653,7 @@ void draw(SkCanvas* canvas) {
#Method void clipPath(const SkPath& path, SkClipOp op)
#In Clip
-Replace Clip with the intersection or difference of Clip and path.
+Replaces Clip with the intersection or difference of Clip and path.
Resulting Clip is Aliased; pixels are fully contained by the clip.
Path_Fill_Type determines if path
describes the area inside or outside its contours; and if Path_Contour overlaps
@@ -2691,7 +2695,7 @@ void draw(SkCanvas* canvas) {
#Method void clipPath(const SkPath& path, bool doAntiAlias = false)
#In Clip
-Replace Clip with the intersection of Clip and path.
+Replaces Clip with the intersection of Clip and path.
Resulting Clip is Aliased; pixels are fully contained by the clip.
Path_Fill_Type determines if path
describes the area inside or outside its contours; and if Path_Contour overlaps
@@ -2748,7 +2752,7 @@ Set to simplify clip stack using PathOps.
#In Clip
#Line # combines Clip with Region ##
-Replace Clip with the intersection or difference of Clip and Region deviceRgn.
+Replaces Clip with the intersection or difference of Clip and Region deviceRgn.
Resulting Clip is Aliased; pixels are fully contained by the clip.
deviceRgn is unaffected by Matrix.
@@ -2785,7 +2789,7 @@ void draw(SkCanvas* canvas) {
#In Clip
#Line # returns if Rect is outside Clip ##
-Return true if Rect rect, transformed by Matrix, can be quickly determined to be
+Returns true if Rect rect, transformed by Matrix, can be quickly determined to be
outside of Clip. May return false even though rect is outside of Clip.
Use to check if an area to be drawn is clipped out, to skip subsequent draw calls.
@@ -2819,7 +2823,7 @@ void draw(SkCanvas* canvas) {
#Method bool quickReject(const SkPath& path) const
#In Clip
-Return true if path, transformed by Matrix, can be quickly determined to be
+Returns true if path, transformed by Matrix, can be quickly determined to be
outside of Clip. May return false even though path is outside of Clip.
Use to check if an area to be drawn is clipped out, to skip subsequent draw calls.
@@ -2857,7 +2861,7 @@ void draw(SkCanvas* canvas) {
#In Clip
#Line # returns Clip bounds in source coordinates ##
-Return bounds of Clip, transformed by inverse of Matrix. If Clip is empty,
+Returns bounds of Clip, transformed by inverse of Matrix. If Clip is empty,
return SkRect::MakeEmpty, where all Rect sides equal zero.
Rect returned is outset by one to account for partial pixel coverage if Clip
@@ -2904,7 +2908,7 @@ is Anti_Aliased.
#Method bool getLocalClipBounds(SkRect* bounds) const
#In Clip
-Return bounds of Clip, transformed by inverse of Matrix. If Clip is empty,
+Returns bounds of Clip, transformed by inverse of Matrix. If Clip is empty,
return false, and set bounds to SkRect::MakeEmpty, where all Rect sides equal zero.
bounds is outset by one to account for partial pixel coverage if Clip
@@ -2942,7 +2946,7 @@ is Anti_Aliased.
#In Clip
#Line # returns IRect bounds of Clip ##
-Return IRect bounds of Clip, unaffected by Matrix. If Clip is empty,
+Returns IRect bounds of Clip, unaffected by Matrix. If Clip is empty,
return SkRect::MakeEmpty, where all Rect sides equal zero.
Unlike getLocalClipBounds, returned IRect is not outset.
@@ -2995,7 +2999,7 @@ void draw(SkCanvas* canvas) {
#Method bool getDeviceClipBounds(SkIRect* bounds) const
#In Clip
-Return IRect bounds of Clip, unaffected by Matrix. If Clip is empty,
+Returns IRect bounds of Clip, unaffected by Matrix. If Clip is empty,
return false, and set bounds to SkRect::MakeEmpty, where all Rect sides equal zero.
Unlike getLocalClipBounds, bounds is not outset.
@@ -3035,7 +3039,7 @@ Unlike getLocalClipBounds, bounds is not outset.
#Method void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver)
#In Draw
#Line # fills Clip with Color and Blend_Mode ##
-Fill Clip with Color color.
+Fills Clip with Color color.
mode determines how ARGB is combined with destination.
#Param color Unpremultiplied ARGB ##
@@ -3058,7 +3062,7 @@ mode determines how ARGB is combined with destination.
#Method void clear(SkColor color)
#In Draw
#Line # fills Clip with Color ##
-Fill Clip with Color color using SkBlendMode::kSrc.
+Fills Clip with Color color using SkBlendMode::kSrc.
This has the effect of replacing all pixels contained by Clip with color.
#Param color Unpremultiplied ARGB ##
@@ -3087,7 +3091,7 @@ void draw(SkCanvas* canvas) {
#Method void discard()
#In Utility
#Line # makes Canvas contents undefined ##
-Make Canvas contents undefined. Subsequent calls that read Canvas pixels,
+Makes Canvas contents undefined. Subsequent calls that read Canvas pixels,
such as drawing with SkBlendMode, return undefined results. discard() does
not change Clip or Matrix.
@@ -3112,7 +3116,7 @@ any cached data is deleted when owning Surface or Device is deleted.
#Method void drawPaint(const SkPaint& paint)
#In Draw
#Line # fills Clip with Paint ##
-Fill Clip with Paint paint. Paint components Mask_Filter, Shader,
+Fills Clip with Paint paint. Paint components Mask_Filter, Shader,
Color_Filter, Image_Filter, and Blend_Mode affect drawing;
Path_Effect in paint is ignored.
@@ -3195,7 +3199,7 @@ void draw(SkCanvas* canvas) {
#Method void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint)
#In Draw
#Line # draws array as points, lines, polygon ##
-Draw pts using Clip, Matrix and Paint paint.
+Draws pts using Clip, Matrix and Paint paint.
count is the number of points; if count is less than one, has no effect.
mode may be one of: kPoints_PointMode, kLines_PointMode, or kPolygon_PointMode.
@@ -3276,7 +3280,7 @@ void draw(SkCanvas* canvas) {
#Method void drawPoint(SkScalar x, SkScalar y, const SkPaint& paint)
#In Draw
#Line # draws point at (x, y) position ##
-Draw point at (x, y) using Clip, Matrix and Paint paint.
+Draws point at (x, y) using Clip, Matrix and Paint paint.
The shape of point drawn depends on paint Paint_Stroke_Cap.
If paint is set to SkPaint::kRound_Cap, draw a circle of diameter
@@ -3310,7 +3314,7 @@ void draw(SkCanvas* canvas) {
#Method void drawPoint(SkPoint p, const SkPaint& paint)
-Draw point p using Clip, Matrix and Paint paint.
+Draws point p using Clip, Matrix and Paint paint.
The shape of point drawn depends on paint Paint_Stroke_Cap.
If paint is set to SkPaint::kRound_Cap, draw a circle of diameter
@@ -3403,7 +3407,7 @@ Paint_Style is ignored, as if were set to SkPaint::kStroke_Style.
#Method void drawRect(const SkRect& rect, const SkPaint& paint)
#In Draw
#Line # draws Rect using Clip, Matrix, and Paint ##
-Draw Rect rect using Clip, Matrix, and Paint paint.
+Draws Rect rect using Clip, Matrix, and Paint paint.
In paint: Paint_Style determines if rectangle is stroked or filled;
if stroked, Paint_Stroke_Width describes the line thickness, and
Paint_Stroke_Join draws the corners rounded or square.
@@ -3440,7 +3444,7 @@ void draw(SkCanvas* canvas) {
#Method void drawIRect(const SkIRect& rect, const SkPaint& paint)
#In Draw
#Line # draws IRect using Clip, Matrix, and Paint ##
-Draw IRect rect using Clip, Matrix, and Paint paint.
+Draws IRect rect using Clip, Matrix, and Paint paint.
In paint: Paint_Style determines if rectangle is stroked or filled;
if stroked, Paint_Stroke_Width describes the line thickness, and
Paint_Stroke_Join draws the corners rounded or square.
@@ -3471,7 +3475,7 @@ Paint_Stroke_Join draws the corners rounded or square.
#Method void drawRegion(const SkRegion& region, const SkPaint& paint)
#In Draw
#Line # draws Region using Clip, Matrix, and Paint ##
-Draw Region region using Clip, Matrix, and Paint paint.
+Draws Region region using Clip, Matrix, and Paint paint.
In paint: Paint_Style determines if rectangle is stroked or filled;
if stroked, Paint_Stroke_Width describes the line thickness, and
Paint_Stroke_Join draws the corners rounded or square.
@@ -3502,7 +3506,7 @@ void draw(SkCanvas* canvas) {
#Method void drawOval(const SkRect& oval, const SkPaint& paint)
#In Draw
#Line # draws Oval using Clip, Matrix, and Paint ##
-Draw Oval oval using Clip, Matrix, and Paint.
+Draws Oval oval using Clip, Matrix, and Paint.
In paint: Paint_Style determines if Oval is stroked or filled;
if stroked, Paint_Stroke_Width describes the line thickness.
@@ -3534,7 +3538,7 @@ void draw(SkCanvas* canvas) {
#Method void drawRRect(const SkRRect& rrect, const SkPaint& paint)
#In Draw
#Line # draws Round_Rect using Clip, Matrix, and Paint ##
-Draw Round_Rect rrect using Clip, Matrix, and Paint paint.
+Draws Round_Rect rrect using Clip, Matrix, and Paint paint.
In paint: Paint_Style determines if rrect is stroked or filled;
if stroked, Paint_Stroke_Width describes the line thickness.
@@ -3574,7 +3578,7 @@ void draw(SkCanvas* canvas) {
#Method void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint)
#In Draw
#Line # draws double Round_Rect stroked or filled ##
-Draw Round_Rect outer and inner
+Draws Round_Rect outer and inner
using Clip, Matrix, and Paint paint.
outer must contain inner or the drawing is undefined.
In paint: Paint_Style determines if Round_Rect is stroked or filled;
@@ -3629,7 +3633,7 @@ void draw(SkCanvas* canvas) {
#Method void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint)
#In Draw
#Line # draws Circle using Clip, Matrix, and Paint ##
-Draw Circle at (cx, cy) with radius using Clip, Matrix, and Paint paint.
+Draws Circle at (cx, cy) with radius using Clip, Matrix, and Paint paint.
If radius is zero or less, nothing is drawn.
In paint: Paint_Style determines if Circle is stroked or filled;
if stroked, Paint_Stroke_Width describes the line thickness.
@@ -3657,7 +3661,7 @@ if stroked, Paint_Stroke_Width describes the line thickness.
#Method void drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint)
-Draw Circle at center with radius using Clip, Matrix, and Paint paint.
+Draws Circle at center with radius using Clip, Matrix, and Paint paint.
If radius is zero or less, nothing is drawn.
In paint: Paint_Style determines if Circle is stroked or filled;
if stroked, Paint_Stroke_Width describes the line thickness.
@@ -3689,7 +3693,7 @@ if stroked, Paint_Stroke_Width describes the line thickness.
#In Draw
#Line # draws Arc using Clip, Matrix, and Paint ##
-Draw Arc using Clip, Matrix, and Paint paint.
+Draws Arc using Clip, Matrix, and Paint paint.
Arc is part of Oval bounded by oval, sweeping from startAngle to startAngle plus
sweepAngle. startAngle and sweepAngle are in degrees.
@@ -3753,7 +3757,7 @@ If Rect oval is empty or sweepAngle is zero, nothing is drawn.
#Method void drawRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, const SkPaint& paint)
#In Draw
#Line # draws Round_Rect using Clip, Matrix, and Paint ##
-Draw Round_Rect bounded by Rect rect, with corner radii (rx, ry) using Clip,
+Draws Round_Rect bounded by Rect rect, with corner radii (rx, ry) using Clip,
Matrix, and Paint paint.
In paint: Paint_Style determines if Round_Rect is stroked or filled;
@@ -3801,7 +3805,7 @@ Paint_Stroke_Join.
#Method void drawPath(const SkPath& path, const SkPaint& paint)
#In Draw
#Line # draws Path using Clip, Matrix, and Paint ##
-Draw Path path using Clip, Matrix, and Paint paint.
+Draws Path path using Clip, Matrix, and Paint paint.
Path contains an array of Path_Contour, each of which may be open or closed.
In paint: Paint_Style determines if Round_Rect is stroked or filled:
@@ -3871,7 +3875,7 @@ a smart pointer as a convenience. The pairs of calls are otherwise identical.
#In Draw_Image
#In Draw
#Line # draws Image at (x, y) position ##
-Draw Image image, with its top-left corner at (left, top),
+Draws Image image, with its top-left corner at (left, top),
using Clip, Matrix, and optional Paint paint.
If paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter, Blend_Mode,
@@ -3911,7 +3915,7 @@ void draw(SkCanvas* canvas) {
#Method void drawImage(const sk_sp<SkImage>& image, SkScalar left, SkScalar top,
const SkPaint* paint = nullptr)
-Draw Image image, with its top-left corner at (left, top),
+Draws Image image, with its top-left corner at (left, top),
using Clip, Matrix, and optional Paint paint.
If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
@@ -4025,7 +4029,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws Image, source Rect to destination Rect ##
-Draw Rect src of Image image, scaled and translated to fill Rect dst.
+Draws Rect src of Image image, scaled and translated to fill Rect dst.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
@@ -4091,7 +4095,7 @@ void draw(SkCanvas* canvas) {
#In Draw_Image
#In Draw
-Draw IRect isrc of Image image, scaled and translated to fill Rect dst.
+Draws IRect isrc of Image image, scaled and translated to fill Rect dst.
Note that isrc is on integer pixel boundaries; dst may include fractional
boundaries. Additionally transform draw using Clip, Matrix, and optional Paint
paint.
@@ -4138,7 +4142,7 @@ void draw(SkCanvas* canvas) {
#In Draw_Image
#In Draw
-Draw Image image, scaled and translated to fill Rect dst, using Clip, Matrix,
+Draws Image image, scaled and translated to fill Rect dst, using Clip, Matrix,
and optional Paint paint.
If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
@@ -4181,7 +4185,7 @@ void draw(SkCanvas* canvas) {
SrcRectConstraint constraint = kStrict_SrcRectConstraint)
#In Draw_Image
#In Draw
-Draw Rect src of Image image, scaled and translated to fill Rect dst.
+Draws Rect src of Image image, scaled and translated to fill Rect dst.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
@@ -4237,7 +4241,7 @@ void draw(SkCanvas* canvas) {
const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint)
#In Draw_Image
#In Draw
-Draw IRect isrc of Image image, scaled and translated to fill Rect dst.
+Draws IRect isrc of Image image, scaled and translated to fill Rect dst.
isrc is on integer pixel boundaries; dst may include fractional boundaries.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
@@ -4290,7 +4294,7 @@ void draw(SkCanvas* canvas) {
SrcRectConstraint constraint = kStrict_SrcRectConstraint)
#In Draw_Image
#In Draw
-Draw Image image, scaled and translated to fill Rect dst,
+Draws Image image, scaled and translated to fill Rect dst,
using Clip, Matrix, and optional Paint paint.
If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
@@ -4343,7 +4347,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws Nine_Patch Image ##
-Draw Image image stretched proportionally to fit into Rect dst.
+Draws Image image stretched proportionally to fit into Rect dst.
IRect center divides the image into nine sections: four sides, four corners, and
the center. Corners are unmodified or scaled down proportionately if their sides
are larger than dst; center and four sides are scaled to fit remaining space, if any.
@@ -4408,7 +4412,7 @@ void draw(SkCanvas* canvas) {
const SkPaint* paint = nullptr)
#In Draw_Image
#In Draw
-Draw Image image stretched proportionally to fit into Rect dst.
+Draws Image image stretched proportionally to fit into Rect dst.
IRect center divides the image into nine sections: four sides, four corners, and
the center. Corners are not scaled, or scaled down proportionately if their sides
are larger than dst; center and four sides are scaled to fit remaining space, if any.
@@ -4476,7 +4480,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws Bitmap at (x, y) position ##
-Draw Bitmap bitmap, with its top-left corner at (left, top),
+Draws Bitmap bitmap, with its top-left corner at (left, top),
using Clip, Matrix, and optional Paint paint.
If Paint paint is not nullptr, apply Color_Filter, Color_Alpha, Image_Filter,
@@ -4531,7 +4535,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws Bitmap, source Rect to destination Rect ##
-Draw Rect src of Bitmap bitmap, scaled and translated to fill Rect dst.
+Draws Rect src of Bitmap bitmap, scaled and translated to fill Rect dst.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
@@ -4589,7 +4593,7 @@ void draw(SkCanvas* canvas) {
const SkPaint* paint, SrcRectConstraint constraint = kStrict_SrcRectConstraint)
#In Draw_Image
#In Draw
-Draw IRect isrc of Bitmap bitmap, scaled and translated to fill Rect dst.
+Draws IRect isrc of Bitmap bitmap, scaled and translated to fill Rect dst.
isrc is on integer pixel boundaries; dst may include fractional boundaries.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
@@ -4648,7 +4652,7 @@ void draw(SkCanvas* canvas) {
SrcRectConstraint constraint = kStrict_SrcRectConstraint)
#In Draw_Image
#In Draw
-Draw Bitmap bitmap, scaled and translated to fill Rect dst.
+Draws Bitmap bitmap, scaled and translated to fill Rect dst.
bitmap bounds is on integer pixel boundaries; dst may include fractional boundaries.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
@@ -4711,7 +4715,7 @@ Any SkMaskFilter on paint is ignored as is paint Anti_Aliasing state.
#In Draw
#Line # draws Nine_Patch Bitmap ##
-Draw Bitmap bitmap stretched proportionally to fit into Rect dst.
+Draws Bitmap bitmap stretched proportionally to fit into Rect dst.
IRect center divides the bitmap into nine sections: four sides, four corners,
and the center. Corners are not scaled, or scaled down proportionately if their
sides are larger than dst; center and four sides are scaled to fit remaining
@@ -4911,7 +4915,7 @@ remaining space, if any.
#In Draw
#Line # draws proportionally stretched Bitmap ##
-Draw Bitmap bitmap stretched proportionally to fit into Rect dst.
+Draws Bitmap bitmap stretched proportionally to fit into Rect dst.
Lattice lattice divides bitmap into a rectangular grid.
Each intersection of an even-numbered row and column is fixed; like the corners
@@ -4990,7 +4994,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws proportionally stretched Image ##
-Draw Image image stretched proportionally to fit into Rect dst.
+Draws Image image stretched proportionally to fit into Rect dst.
Lattice lattice divides image into a rectangular grid.
Each intersection of an even-numbered row and column is fixed; like the corners
@@ -5069,7 +5073,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws text at (x, y), using font advance ##
-Draw text, with origin at (x, y), using Clip, Matrix, and Paint paint.
+Draws text, with origin at (x, y), using Clip, Matrix, and Paint paint.
text meaning depends on Paint_Text_Encoding; by default, text is encoded as
UTF-8.
@@ -5159,7 +5163,7 @@ filled 12 point black Glyphs.
#Method void drawString(const SkString& string, SkScalar x, SkScalar y, const SkPaint& paint)
-Draw null terminated string, with origin at (x, y), using Clip, Matrix, and
+Draws null terminated string, with origin at (x, y), using Clip, Matrix, and
Paint paint.
string meaning depends on Paint_Text_Encoding; by default, strings are encoded
@@ -5199,7 +5203,7 @@ filled 12 point black Glyphs.
#In Draw
#Line # draws text at array of (x, y) positions ##
-Draw each glyph in text with the origin in pos array, using Clip, Matrix, and
+Draws each glyph in text with the origin in pos array, using Clip, Matrix, and
Paint paint. The number of entries in pos array must match the number of Glyphs
described by byteLength of text.
@@ -5244,7 +5248,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws text at x positions with common baseline ##
-Draw each glyph in text with its (x, y) origin composed from xpos array and
+Draws each glyph in text with its (x, y) origin composed from xpos array and
constY, using Clip, Matrix, and Paint paint. The number of entries in xpos array
must match the number of Glyphs described by byteLength of text.
@@ -5289,7 +5293,7 @@ baseline.
#In Draw
#Line # draws text following Path with offsets ##
-Draw text on Path path, using Clip, Matrix, and Paint paint.
+Draws text on Path path, using Clip, Matrix, and Paint paint.
Origin of text is at distance hOffset along the path, offset by a perpendicular
vector of length vOffset. If the path section corresponding the glyph advance is
@@ -5340,7 +5344,7 @@ filled 12 point black Glyphs.
#In Draw
#Line # draws text following Path contour ##
-Draw text on Path path, using Clip, Matrix, and Paint paint.
+Draws text on Path path, using Clip, Matrix, and Paint paint.
Origin of text is at beginning of path offset by matrix, if not nullptr.
matrix transforms text before text is mapped to path. If the path section
@@ -5400,7 +5404,7 @@ filled 12 point black Glyphs.
#In Draw
#Line # draws text with array of RSXform ##
-Draw text, transforming each glyph by the corresponding SkRSXform,
+Draws text, transforming each glyph by the corresponding SkRSXform,
using Clip, Matrix, and Paint paint.
RSXform xform array specifies a separate square scale, rotation, and translation
@@ -5451,7 +5455,7 @@ void draw(SkCanvas* canvas) {
#In Draw_Text
#In Draw
#Line # draws text with arrays of positions and Paint ##
-Draw Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
+Draws Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
blob contains Glyphs, their positions, and paint attributes specific to text:
Typeface, Paint_Text_Size, Paint_Text_Scale_X, Paint_Text_Skew_X,
@@ -5504,7 +5508,7 @@ Image_Filter, and Draw_Looper; apply to blob.
#Method void drawTextBlob(const sk_sp<SkTextBlob>& blob, SkScalar x, SkScalar y, const SkPaint& paint)
-Draw Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
+Draws Text_Blob blob at (x, y), using Clip, Matrix, and Paint paint.
blob contains Glyphs, their positions, and paint attributes specific to text:
Typeface, Paint_Text_Size, Paint_Text_Scale_X, Paint_Text_Skew_X,
@@ -5553,7 +5557,7 @@ Paint attributes related to text, like text size, have no effect on paint passed
#Method void drawPicture(const SkPicture* picture)
#In Draw
#Line # draws Picture using Clip and Matrix ##
-Draw Picture picture, using Clip and Matrix.
+Draws Picture picture, using Clip and Matrix.
Clip and Matrix are unchanged by picture contents, as if
save() was called before and restore() was called after drawPicture.
@@ -5588,7 +5592,7 @@ void draw(SkCanvas* canvas) {
#Method void drawPicture(const sk_sp<SkPicture>& picture)
-Draw Picture picture, using Clip and Matrix.
+Draws Picture picture, using Clip and Matrix.
Clip and Matrix are unchanged by picture contents, as if
save() was called before and restore() was called after drawPicture.
@@ -5623,7 +5627,7 @@ void draw(SkCanvas* canvas) {
#Method void drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint)
-Draw Picture picture, using Clip and Matrix; transforming picture with
+Draws Picture picture, using Clip and Matrix; transforming picture with
Matrix matrix, if provided; and use Paint paint Color_Alpha, Color_Filter,
Image_Filter, and Blend_Mode, if provided.
@@ -5665,7 +5669,7 @@ void draw(SkCanvas* canvas) {
#Method void drawPicture(const sk_sp<SkPicture>& picture, const SkMatrix* matrix, const SkPaint* paint)
-Draw Picture picture, using Clip and Matrix; transforming picture with
+Draws Picture picture, using Clip and Matrix; transforming picture with
Matrix matrix, if provided; and use Paint paint Color_Alpha, Color_Filter,
Image_Filter, and Blend_Mode, if provided.
@@ -5707,7 +5711,7 @@ void draw(SkCanvas* canvas) {
#Method void drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint)
#In Draw
#Line # draws Vertices, a triangle mesh ##
-Draw Vertices vertices, a triangle mesh, using Clip and Matrix.
+Draws Vertices vertices, a triangle mesh, using Clip and Matrix.
If Vertices_Texs and Vertices_Colors are defined in vertices, and Paint paint
contains Shader, Blend_Mode mode combines Vertices_Colors with Shader.
@@ -5734,7 +5738,7 @@ void draw(SkCanvas* canvas) {
#Method void drawVertices(const sk_sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint)
-Draw Vertices vertices, a triangle mesh, using Clip and Matrix.
+Draws Vertices vertices, a triangle mesh, using Clip and Matrix.
If Vertices_Texs and Vertices_Colors are defined in vertices, and Paint paint
contains Shader, Blend_Mode mode combines Vertices_Colors with Shader.
@@ -5765,7 +5769,7 @@ void draw(SkCanvas* canvas) {
#Method void drawVertices(const SkVertices* vertices, const SkMatrix* bones, int boneCount,
SkBlendMode mode, const SkPaint& paint)
-Draw Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to
+Draws Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to
deform vertices with bone weights.
If Vertices_Texs and Vertices_Colors are defined in vertices, and Paint paint
contains Shader, Blend_Mode mode combines Vertices_Colors with Shader.
@@ -5815,7 +5819,7 @@ void draw(SkCanvas* canvas) {
#Method void drawVertices(const sk_sp<SkVertices>& vertices, const SkMatrix* bones, int boneCount,
SkBlendMode mode, const SkPaint& paint)
-Draw Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to
+Draws Vertices vertices, a triangle mesh, using Clip and Matrix. Bone data is used to
deform vertices with bone weights.
If Vertices_Texs and Vertices_Colors are defined in vertices, and Paint paint
contains Shader, Blend_Mode mode combines Vertices_Colors with Shader.
@@ -6011,7 +6015,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#Line # draws sprites using Clip, Matrix, and Paint ##
-Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
+Draws a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
@@ -6055,7 +6059,7 @@ void draw(SkCanvas* canvas) {
const SkColor colors[], int count, SkBlendMode mode, const SkRect* cullRect,
const SkPaint* paint)
-Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
+Draws a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
@@ -6098,7 +6102,7 @@ void draw(SkCanvas* canvas) {
#Method void drawAtlas(const SkImage* atlas, const SkRSXform xform[], const SkRect tex[], int count,
const SkRect* cullRect, const SkPaint* paint)
-Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
+Draws a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
@@ -6134,7 +6138,7 @@ void draw(SkCanvas* canvas) {
#Method void drawAtlas(const sk_sp<SkImage>& atlas, const SkRSXform xform[], const SkRect tex[],
int count, const SkRect* cullRect, const SkPaint* paint)
-Draw a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
+Draws a set of sprites from atlas, using Clip, Matrix, and optional Paint paint.
paint uses Anti_Alias, Color_Alpha, Color_Filter, Image_Filter, and Blend_Mode
to draw, if present. For each entry in the array, Rect tex locates sprite in
atlas, and RSXform xform transforms it into destination space.
@@ -6169,7 +6173,7 @@ void draw(SkCanvas* canvas) {
#Method void drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr)
#In Draw
#Line # draws Drawable, encapsulated drawing commands ##
-Draw Drawable drawable using Clip and Matrix, concatenated with
+Draws Drawable drawable using Clip and Matrix, concatenated with
optional matrix.
If Canvas has an asynchronous implementation, as is the case
@@ -6215,7 +6219,7 @@ void draw(SkCanvas* canvas) {
#Method void drawDrawable(SkDrawable* drawable, SkScalar x, SkScalar y)
-Draw Drawable drawable using Clip and Matrix, offset by (x, y).
+Draws Drawable drawable using Clip and Matrix, offset by (x, y).
If Canvas has an asynchronous implementation, as is the case
when it is recording into Picture, then drawable will be referenced,
@@ -6261,7 +6265,7 @@ void draw(SkCanvas* canvas) {
#In Draw
#In Utility
#Line # associates a Rect with a key-value pair ##
-Associate Rect on Canvas with an annotation; a key-value pair, where the key is
+Associates Rect on Canvas with an annotation; a key-value pair, where the key is
a null-terminated utf8 string, and optional value is stored as Data.
Only some canvas implementations, such as recording to Picture, or drawing to
@@ -6291,7 +6295,7 @@ Document_PDF, use annotations.
#Method void drawAnnotation(const SkRect& rect, const char key[], const sk_sp<SkData>& value)
-Associate Rect on Canvas when an annotation; a key-value pair, where the key is
+Associates Rect on Canvas when an annotation; a key-value pair, where the key is
a null-terminated utf8 string, and optional value is stored as Data.
Only some canvas implementations, such as recording to Picture, or drawing to
diff --git a/docs/SkMatrix_Reference.bmh b/docs/SkMatrix_Reference.bmh
index 52c301a18e..6f37e7856a 100644
--- a/docs/SkMatrix_Reference.bmh
+++ b/docs/SkMatrix_Reference.bmh
@@ -44,6 +44,7 @@ Sets Matrix to scale by (sx, sy). Returned matrix is:
| 0 sy 0 |
| 0 0 1 |
##
+.
#Param sx horizontal scale factor ##
#Param sy vertical scale factor ##
@@ -72,6 +73,7 @@ Sets Matrix to scale by (scale, scale). Returned matrix is:
| 0 scale 0 |
| 0 0 1 |
##
+.
#Param scale horizontal and vertical scale factor ##
@@ -100,6 +102,7 @@ Sets Matrix to translate by (dx, dy). Returned matrix is:
| 0 1 dy |
| 0 0 1 |
##
+.
#Param dx horizontal translation ##
#Param dy vertical translation ##
@@ -136,6 +139,7 @@ Sets Matrix to:
| skewY scaleY transY |
| pers0 pers1 pers2 |
##
+.
#Param scaleX horizontal scale factor ##
#Param skewX horizontal skew factor ##
@@ -288,6 +292,7 @@ Returns true if Matrix is identity. Identity matrix is:
| 0 1 0 |
| 0 0 1 |
##
+.
#Return true if Matrix has no effect ##
@@ -321,6 +326,7 @@ contain only scale elements, only translate elements, or both. Matrix form is:
| 0 scale-y translate-y |
| 0 0 1 |
##
+.
#Return true if Matrix is identity; or scales, translates, or both ##
@@ -357,6 +363,7 @@ Returns true if Matrix is identity, or translates. Matrix form is:
| 0 1 translate-y |
| 0 0 1 |
##
+.
#Return true if Matrix is identity, or translates ##
@@ -1308,6 +1315,7 @@ Sets all values from parameters. Sets matrix to:
| skewY scaleY transY |
| persp0 persp1 persp2 |
##
+.
#Param scaleX horizontal scale factor to store ##
#Param skewX horizontal skew factor to store ##
@@ -1386,6 +1394,7 @@ Sets matrix to:
| buffer[3] buffer[4] buffer[5] |
| buffer[6] buffer[7] buffer[8] |
##
+.
In the future, set9 followed by get9 may not return the same values. Since Matrix
maps non-homogeneous coordinates, scaling all nine values produces an equivalent
@@ -1420,6 +1429,7 @@ Sets Matrix to identity; which has no effect on mapped Points. Sets Matrix to:
| 0 1 0 |
| 0 0 1 |
##
+.
Also called setIdentity(); use the one that provides better inline
documentation.
@@ -1451,6 +1461,7 @@ Sets Matrix to identity; which has no effect on mapped Points. Sets Matrix to:
| 0 1 0 |
| 0 0 1 |
##
+.
Also called reset(); use the one that provides better inline
documentation.
@@ -1842,6 +1853,7 @@ sets Matrix to:
a * b = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
| G H I | | P Q R | | GJ+HM+IP GK+HN+IQ GL+HO+IR |
##
+.
#Param a Matrix on left side of multiply expression ##
#Param b Matrix on right side of multiply expression ##
@@ -1892,6 +1904,7 @@ sets Matrix to:
Matrix * T(dx, dy) = | D E F | | 0 1 dy | = | D E D*dx+E*dy+F |
| G H I | | 0 0 1 | | G H G*dx+H*dy+I |
##
+.
#Param dx x-axis translation before applying Matrix ##
#Param dy y-axis translation before applying Matrix ##
@@ -1959,6 +1972,7 @@ sets Matrix to:
Matrix * S(sx, sy, px, py) = | D E F | | 0 sy dy | = | D*sx E*sy D*dx+E*dy+F |
| G H I | | 0 0 1 | | G*sx H*sy G*dx+H*dy+I |
##
+.
#Param sx horizontal scale factor ##
#Param sy vertical scale factor ##
@@ -2006,6 +2020,7 @@ sets Matrix to:
Matrix * S(sx, sy) = | D E F | | 0 sy 0 | = | D*sx E*sy F |
| G H I | | 0 0 1 | | G*sx H*sy I |
##
+.
#Param sx horizontal scale factor ##
#Param sy vertical scale factor ##
@@ -2064,6 +2079,7 @@ sets Matrix to:
Matrix * R(degrees, px, py) = | D E F | | s c dy | = | Dc+Es -Ds+Ec D*dx+E*dy+F |
| G H I | | 0 0 1 | | Gc+Hs -Gs+Hc G*dx+H*dy+I |
##
+.
#Param degrees angle of axes relative to upright axes ##
#Param px pivot x ##
@@ -2119,6 +2135,7 @@ sets Matrix to:
Matrix * R(degrees, px, py) = | D E F | | s c 0 | = | Dc+Es -Ds+Ec F |
| G H I | | 0 0 1 | | Gc+Hs -Gs+Hc I |
##
+.
#Param degrees angle of axes relative to upright axes ##
@@ -2172,6 +2189,7 @@ sets Matrix to:
Matrix * K(kx, ky, px, py) = | D E F | | ky 1 dy | = | D+E*ky D*kx+E D*dx+E*dy+F |
| G H I | | 0 0 1 | | G+H*ky G*kx+H G*dx+H*dy+I |
##
+.
#Param kx horizontal skew factor ##
#Param ky vertical skew factor ##
@@ -2218,6 +2236,7 @@ sets Matrix to:
Matrix * K(kx, ky) = | D E F | | ky 1 0 | = | D+E*ky D*kx+E F |
| G H I | | 0 0 1 | | G+H*ky G*kx+H I |
##
+.
#Param kx horizontal skew factor ##
#Param ky vertical skew factor ##
@@ -2263,6 +2282,7 @@ sets Matrix to:
Matrix * other = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
| G H I | | P Q R | | GJ+HM+IP GK+HN+IQ GL+HO+IR |
##
+.
#Param other Matrix on right side of multiply expression ##
@@ -2312,6 +2332,7 @@ sets Matrix to:
T(dx, dy) * Matrix = | 0 1 dy | | M N O | = | M+dy*P N+dy*Q O+dy*R |
| 0 0 1 | | P Q R | | P Q R |
##
+.
#Param dx x-axis translation after applying Matrix ##
#Param dy y-axis translation after applying Matrix ##
@@ -2382,6 +2403,7 @@ sets Matrix to:
S(sx, sy, px, py) * Matrix = | 0 sy dy | | M N O | = | sy*M+dy*P sy*N+dy*Q sy*O+dy*R |
| 0 0 1 | | P Q R | | P Q R |
##
+.
#Param sx horizontal scale factor ##
#Param sy vertical scale factor ##
@@ -2428,6 +2450,7 @@ sets Matrix to:
S(sx, sy) * Matrix = | 0 sy 0 | | M N O | = | sy*M sy*N sy*O |
| 0 0 1 | | P Q R | | P Q R |
##
+.
#Param sx horizontal scale factor ##
#Param sy vertical scale factor ##
@@ -2486,6 +2509,7 @@ sets Matrix to:
I(divx, divy) * Matrix = | 0 sy 0 | | M N O | = | sy*M sy*N sy*O |
| 0 0 1 | | P Q R | | P Q R |
##
+.
#Param divx integer divisor for inverse scale in x ##
#Param divy integer divisor for inverse scale in y ##
@@ -2546,6 +2570,7 @@ sets Matrix to:
R(degrees, px, py) * Matrix = |s c dy| |M N O| = |sJ+cM+dy*P sK+cN+dy*Q sL+cO+dy*R|
|0 0 1| |P Q R| | P Q R|
##
+.
#Param degrees angle of axes relative to upright axes ##
#Param px pivot x ##
@@ -2601,6 +2626,7 @@ sets Matrix to:
R(degrees, px, py) * Matrix = | s c dy | | M N O | = | sJ+cM sK+cN sL+cO |
| 0 0 1 | | P Q R | | P Q R |
##
+.
#Param degrees angle of axes relative to upright axes ##
@@ -2654,6 +2680,7 @@ sets Matrix to:
K(kx, ky, px, py) * Matrix = |ky 1 dy| |M N O| = |ky*J+M+dy*P ky*K+N+dy*Q ky*L+O+dy*R|
| 0 0 1| |P Q R| | P Q R|
##
+.
#Param kx horizontal skew factor ##
#Param ky vertical skew factor ##
@@ -2700,6 +2727,7 @@ sets Matrix to:
K(kx, ky) * Matrix = | ky 1 0 | | M N O | = | ky*J+M ky*K+N ky*L+O |
| 0 0 1 | | P Q R | | P Q R |
##
+.
#Param kx horizontal skew factor ##
#Param ky vertical skew factor ##
@@ -2745,6 +2773,7 @@ sets Matrix to:
other * Matrix = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
| G H I | | P Q R | | GJ+HM+IP GK+HN+IQ GL+HO+IR |
##
+.
#Param other Matrix on left side of multiply expression ##
@@ -2851,6 +2880,7 @@ Returns true if dst is empty, and sets Matrix to:
| 0 0 0 |
| 0 0 1 |
##
+.
#Param src Rect to map from ##
#Param dst Rect to map to ##
@@ -2906,6 +2936,7 @@ empty, returns Matrix set to:
| 0 0 0 |
| 0 0 1 |
##
+.
#Param src Rect to map from ##
#Param dst Rect to map to ##
@@ -3045,6 +3076,7 @@ Sets affine to:
| 1 0 0 |
| 0 1 0 |
##
+.
Affine 3x2 matrices in column major order are used by OpenGL and XPS.
@@ -3079,6 +3111,7 @@ Fills affine in column major order. Sets affine to:
| scale-x skew-x translate-x |
| skew-y scale-y translate-y |
##
+.
If Matrix contains perspective, returns false and leaves affine unchanged.
@@ -3129,6 +3162,7 @@ Matrix is set, row, then column, to:
| skew-y scale-y translate-y |
| 0 0 1 |
##
+.
#Param affine 3x2 affine matrix ##
@@ -3193,6 +3227,7 @@ each dst Point is computed as:
Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
##
+.
src and dst may point to the same storage.
@@ -3252,6 +3287,7 @@ each resulting pts Point is computed as:
Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
##
+.
#Param pts storage for mapped Points ##
#Param count number of Points to transform ##
@@ -3297,6 +3333,7 @@ each resulting dst Point is computed as:
Matrix * src = |D E F| |y| = |Ax+By+Cz Dx+Ey+Fz Gx+Hy+Iz|
|G H I| |z|
##
+.
#Param dst storage for mapped Point3 array ##
#Param src Point3 array to transform ##
@@ -3354,6 +3391,7 @@ result is computed as:
Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
##
+.
#Param x x-axis value of Point to map ##
#Param y y-axis value of Point to map ##
@@ -3399,6 +3437,7 @@ result is computed as:
Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
##
+.
#Param x x-axis value of Point to map ##
#Param y y-axis value of Point to map ##
@@ -3522,6 +3561,7 @@ each result Vector is computed as:
Matrix * vec = |D E 0| |y| = |Ax+By Dx+Ey Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
##
+.
#Param vecs Vectors to transform, and storage for mapped Vectors ##
#Param count number of Vectors to transform ##
@@ -3570,6 +3610,7 @@ each result Vector is computed as:
Matrix * vec = |D E 0| |dy| = |A*dx+B*dy D*dx+E*dy G*dx+H*dy+I| = ----------- , -----------
|G H I| | 1| G*dx+H*dy+I G*dx+*dHy+I
##
+.
#Param dx x-axis value of Vector to map ##
#Param dy y-axis value of Vector to map ##
@@ -3619,6 +3660,7 @@ each result Vector is computed as:
Matrix * vec = |D E 0| |dy| = |A*dx+B*dy D*dx+E*dy G*dx+H*dy+I| = ----------- , -----------
|G H I| | 1| G*dx+H*dy+I G*dx+*dHy+I
##
+.
#Param dx x-axis value of Vector to map ##
#Param dy y-axis value of Vector to map ##
@@ -3768,6 +3810,7 @@ each dst Point is computed as:
Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
##
+.
#Param dst storage for mapped corner Points ##
#Param rect Rect to map ##
@@ -4212,6 +4255,7 @@ On success
#Formula
Matrix = scale * Remaining
##
+.
#Param scale axes scaling factors; may be nullptr ##
#Param remaining Matrix without scaling; may be nullptr ##
@@ -4258,6 +4302,7 @@ Returns reference to const identity Matrix. Returned Matrix is set to:
| 0 1 0 |
| 0 0 1 |
##
+.
#Return const identity Matrix ##
@@ -4292,6 +4337,7 @@ to:
| SK_ScalarMax SK_ScalarMax SK_ScalarMax |
| SK_ScalarMax SK_ScalarMax SK_ScalarMax |
##
+.
#Return const invalid Matrix ##
@@ -4330,6 +4376,7 @@ sets Matrix to:
a * b = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
| G H I | | P Q R | | GJ+HM+IP GK+HN+IQ GL+HO+IR |
##
+.
#Param a Matrix on left side of multiply expression ##
#Param b Matrix on right side of multiply expression ##
@@ -4402,6 +4449,7 @@ Initializes Matrix with scale and translate elements.
| 0 sy ty |
| 0 0 1 |
##
+.
#Param sx horizontal scale factor to store ##
#Param sy vertical scale factor to store ##
diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh
index 2b844fc9eb..8a5e87a5b2 100644
--- a/docs/SkPaint_Reference.bmh
+++ b/docs/SkPaint_Reference.bmh
@@ -718,7 +718,7 @@ at compile time.
#In Anti_alias
#Line # returns true if Anti_Alias is set ##
- If true, pixels on the active edges of Path may be drawn with partial transparency.
+ Returns true if pixels on the active edges of Path may be drawn with partial transparency.
Equivalent to getFlags masked with kAntiAlias_Flag.
@@ -850,7 +850,7 @@ void draw(SkCanvas* canvas) {
#In Dither
#Line # returns true if Dither is set ##
- If true, color error may be distributed to smooth color transition.
+ Returns true if color error may be distributed to smooth color transition.
Equivalent to getFlags masked with kDither_Flag.
@@ -962,7 +962,7 @@ If kLinearText_Flag is clear, it is the same as setting Hinting to kNo_Hinting.
#Line # returns true if text is converted to Path ##
#In Linear_Text
- If true, text is converted to Path before drawing and measuring.
+ Returns true if text is converted to Path before drawing and measuring.
Equivalent to getFlags masked with kLinearText_Flag.
@@ -994,7 +994,7 @@ If kLinearText_Flag is clear, it is the same as setting Hinting to kNo_Hinting.
#Line # converts to Path before draw or measure ##
#In Linear_Text
- If true, text is converted to Path before drawing and measuring.
+ Returns true if text is converted to Path before drawing and measuring.
By default, kLinearText_Flag is clear.
Sets kLinearText_Flag if linearText is true.
@@ -1039,7 +1039,7 @@ of the color increases, the edge of the glyph appears to move towards the outsid
#In Subpixel_Text
#Line # returns true if Subpixel_Text is set ##
- If true, Glyphs at different sub-pixel positions may differ on pixel edge coverage.
+ Returns true if Glyphs at different sub-pixel positions may differ on pixel edge coverage.
Equivalent to getFlags masked with kSubpixelText_Flag.
@@ -1105,7 +1105,7 @@ the color components as RGB or BGR.
#In LCD_Text
#Line # returns true if LCD_Text is set ##
- If true, Glyphs may use LCD striping to improve glyph edges.
+ Returns true if Glyphs may use LCD striping to improve glyph edges.
Returns true if Flags kLCDRenderText_Flag is set.
@@ -1205,7 +1205,7 @@ kEmbeddedBitmapText_Flag at compile time.
#In Font_Embedded_Bitmaps
#Line # returns true if Font_Embedded_Bitmaps is set ##
- If true, Font_Engine may return Glyphs from font bitmaps instead of from outlines.
+ Returns true if Font_Engine may return Glyphs from font bitmaps instead of from outlines.
Equivalent to getFlags masked with kEmbeddedBitmapText_Flag.
@@ -1272,9 +1272,9 @@ Automatic_Hinting only affects platforms that use FreeType as the Font_Manager.
#In Automatic_Hinting
#Line # returns true if Glyphs are always hinted ##
- If true, and if Hinting is set to kNormal_Hinting or kFull_Hinting, and if
- platform uses FreeType as the Font_Manager, instruct the Font_Manager to always hint
- Glyphs.
+ Returns true if Hinting is set to kNormal_Hinting or kFull_Hinting, and if
+ platform uses FreeType as the Font_Manager. If true, instructs
+ the Font_Manager to always hint Glyphs.
Equivalent to getFlags masked with kAutoHinting_Flag.
@@ -1303,8 +1303,9 @@ Automatic_Hinting only affects platforms that use FreeType as the Font_Manager.
#In Automatic_Hinting
#Line # sets Glyphs to always be hinted ##
+ Sets whether to always hint Glyphs.
If Hinting is set to kNormal_Hinting or kFull_Hinting and useAutohinter is set,
- instruct the Font_Manager to always hint Glyphs.
+ instructs the Font_Manager to always hint Glyphs.
Automatic_Hinting has no effect if Hinting is set to kNo_Hinting or
kSlight_Hinting.
@@ -1382,7 +1383,7 @@ void draw(SkCanvas* canvas) {
#In Vertical_Text
#Line # returns true if Vertical_Text is set ##
- If true, Glyphs are drawn top to bottom instead of left to right.
+ Returns true if Glyphs are drawn top to bottom instead of left to right.
Equivalent to getFlags masked with kVerticalText_Flag.
@@ -1408,7 +1409,7 @@ void draw(SkCanvas* canvas) {
#In Vertical_Text
#Line # sets or clears Vertical_Text ##
- If true, text advance positions the next glyph below the previous glyph instead of to the
+ Returns true if text advance positions the next glyph below the previous glyph instead of to the
right of previous glyph.
Sets kVerticalText_Flag if vertical is true.
@@ -1469,7 +1470,7 @@ void draw(SkCanvas* canvas) {
#In Fake_Bold
#Line # returns true if Fake_Bold is set ##
- If true, approximate bold by increasing the stroke width when creating glyph bitmaps
+ Returns true if approximate bold by increasing the stroke width when creating glyph bitmaps
from outlines.
Equivalent to getFlags masked with kFakeBoldText_Flag.
@@ -1496,7 +1497,7 @@ void draw(SkCanvas* canvas) {
#In Fake_Bold
#Line # sets or clears Fake_Bold ##
- Use increased stroke width when creating glyph bitmaps to approximate a bold typeface.
+ Increases stroke width when creating glyph bitmaps to approximate a bold typeface.
Sets kFakeBoldText_Flag if fakeBoldText is true.
Clears kFakeBoldText_Flag if fakeBoldText is false.
@@ -1912,7 +1913,7 @@ May be used to verify that Style is a legal value.
#In Style
#Line # returns Style: stroke, fill, or both ##
- Whether the geometry is filled, stroked, or filled and stroked.
+ Returns whether the geometry is filled, stroked, or filled and stroked.
#Return one of:kFill_Style, kStroke_Style, kStrokeAndFill_Style ##
@@ -2142,7 +2143,7 @@ Here are some miter limits and the angles that triggers them.
#In Miter_Limit
#Line # returns Miter_Limit, angles with sharp corners ##
- The limit at which a sharp corner is drawn beveled.
+ Returns the limit at which a sharp corner is drawn beveled.
#Return zero and greater Miter_Limit ##
@@ -2163,7 +2164,7 @@ Here are some miter limits and the angles that triggers them.
#In Miter_Limit
#Line # sets Miter_Limit, angles with sharp corners ##
- The limit at which a sharp corner is drawn beveled.
+ Sets the limit at which a sharp corner is drawn beveled.
Valid values are zero and greater.
Has no effect if miter is less than zero.
@@ -2275,7 +2276,7 @@ Stroke_Cap is kButt_Cap by default.
#In Stroke_Cap
#Line # returns Cap, the area drawn at path ends ##
- The geometry drawn at the beginning and end of strokes.
+ Returns the geometry drawn at the beginning and end of strokes.
#Return one of: kButt_Cap, kRound_Cap, kSquare_Cap ##
@@ -2296,7 +2297,7 @@ Stroke_Cap is kButt_Cap by default.
#In Stroke_Cap
#Line # sets Cap, the area drawn at path ends ##
- The geometry drawn at the beginning and end of strokes.
+ Sets the geometry drawn at the beginning and end of strokes.
#Param cap one of: kButt_Cap, kRound_Cap, kSquare_Cap;
has no effect if cap is not valid
@@ -2433,7 +2434,7 @@ void draw(SkCanvas* canvas) {
#In Stroke_Join
#Line # returns Join, geometry on path corners ##
- The geometry drawn at the corners of strokes.
+ Returns the geometry drawn at the corners of strokes.
#Return one of: kMiter_Join, kRound_Join, kBevel_Join ##
@@ -2454,7 +2455,7 @@ void draw(SkCanvas* canvas) {
#In Stroke_Join
#Line # sets Join, geometry on path corners ##
- The geometry drawn at the corners of strokes.
+ Sets the geometry drawn at the corners of strokes.
#Param join one of: kMiter_Join, kRound_Join, kBevel_Join;
otherwise, has no effect
@@ -2505,7 +2506,7 @@ returns false since Hairline has no filled equivalent.
#In Fill_Path
#Line # returns fill path equivalent to stroke ##
- The filled equivalent of the stroked path.
+ Returns the filled equivalent of the stroked path.
#Param src Path read to create a filled version ##
#Param dst resulting Path; may be the same as src, but may not be nullptr ##
@@ -2552,7 +2553,7 @@ returns false since Hairline has no filled equivalent.
#Method bool getFillPath(const SkPath& src, SkPath* dst) const
#In Fill_Path
- The filled equivalent of the stroked path.
+ Returns the filled equivalent of the stroked path.
Replaces dst with the src path modified by Path_Effect and Style_Stroke.
Path_Effect, if any, is not culled. Stroke_Width is created with default precision.
@@ -2637,7 +2638,7 @@ void draw(SkCanvas* canvas) {
#In Shader_Methods
#Line # returns Shader, multiple drawing colors; gradients ##
- Optional colors used when filling a path, such as a gradient.
+ Returns optional colors used when filling a path, such as a gradient.
Does not alter Shader Reference_Count.
@@ -2663,7 +2664,7 @@ void draw(SkCanvas* canvas) {
#In Shader_Methods
#Line # references Shader, multiple drawing colors; gradients ##
- Optional colors used when filling a path, such as a gradient.
+ Returns optional colors used when filling a path, such as a gradient.
Increases Shader Reference_Count by one.
@@ -2690,7 +2691,7 @@ void draw(SkCanvas* canvas) {
#In Shader_Methods
#Line # sets Shader, multiple drawing colors; gradients ##
- Optional colors used when filling a path, such as a gradient.
+ Sets optional colors used when filling a path, such as a gradient.
Sets Shader to shader, decreasing Reference_Count of the previous Shader.
Increments shader Reference_Count by one.
@@ -4147,7 +4148,7 @@ void draw(SkCanvas* canvas) {
#Method bool hasUnderlineThickness(SkScalar* thickness) const
#Line # returns underline thickness if set ##
- If Font_Metrics has a valid underline thickness, return true, and set
+ Returns true if Font_Metrics has a valid underline thickness, and sets
thickness to that value. If the underline thickness is not valid,
return false, and ignore thickness.
@@ -4162,7 +4163,7 @@ void draw(SkCanvas* canvas) {
#Method bool hasUnderlinePosition(SkScalar* position) const
#Line # returns underline position if set ##
- If Font_Metrics has a valid underline position, return true, and set
+ Returns true if Font_Metrics has a valid underline position, and sets
position to that value. If the underline position is not valid,
return false, and ignore position.
@@ -4177,7 +4178,7 @@ void draw(SkCanvas* canvas) {
#Method bool hasStrikeoutThickness(SkScalar* thickness) const
#Line # returns strikeout thickness if set ##
- If Font_Metrics has a valid strikeout thickness, return true, and set
+ Returns true if Font_Metrics has a valid strikeout thickness, and sets
thickness to that value. If the underline thickness is not valid,
return false, and ignore thickness.
@@ -4192,7 +4193,7 @@ void draw(SkCanvas* canvas) {
#Method bool hasStrikeoutPosition(SkScalar* position) const
#Line # returns strikeout position if set ##
- If Font_Metrics has a valid strikeout position, return true, and set
+ Returns true if Font_Metrics has a valid strikeout position, and sets
position to that value. If the underline position is not valid,
return false, and ignore position.
diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh
index f82654a511..28847b8951 100644
--- a/docs/SkPath_Reference.bmh
+++ b/docs/SkPath_Reference.bmh
@@ -397,7 +397,7 @@ void draw(SkCanvas* canvas) {
#Method SkPath()
#Line # constructs with default values ##
-By default, Path has no Verbs, no Points, and no Weights.
+Constucts an empty path. By default, Path has no Verbs, no Points, and no Weights.
Fill_Type is set to kWinding_FillType.
#Return empty Path ##
@@ -419,6 +419,7 @@ path is empty
#Method SkPath(const SkPath& path)
#Line # makes a shallow copy ##
+Constructs a copy of an existing path.
Copy constructor makes two paths identical by value. Internally, path and
the returned result share pointer values. The underlying Verb_Array, Point_Array
and Weights are copied when modified.
@@ -487,6 +488,7 @@ void draw(SkCanvas* canvas) {
#Method SkPath& operator=(const SkPath& path)
#Line # makes a shallow copy ##
+Constructs a copy of an existing path.
Path assignment makes two paths identical by value. Internally, assignment
shares pointer values. The underlying Verb_Array, Point_Array and Weights
are copied when modified.
@@ -612,7 +614,7 @@ convexity !=
#In Property
#In Interpolate
#Line # returns if pair contains equal counts of Verb_Array and Weights ##
-Return true if Paths contain equal Verbs and equal Weights.
+Returns true if Paths contain equal Verbs and equal Weights.
If Paths contain one or more Conics, the Weights must match.
conicTo may add different Verbs depending on Conic_Weight, so it is not
@@ -651,7 +653,7 @@ paths are interpolatable
#Method bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const
#In Interpolate
#Line # interpolates between Path pair ##
-Interpolate between Paths with Point_Array of equal size.
+Interpolates between Paths with Point_Array of equal size.
Copy Verb_Array and Weights to out, and set out Point_Array to a weighted
average of this Point_Array and ending Point_Array, using the formula:
#Formula
@@ -902,7 +904,7 @@ default path fill type is inverse: false
#In Fill_Type
#Line # toggles Fill_Type between inside and outside geometry ##
-Replace FillType with its inverse. The inverse of FillType describes the area
+Replaces FillType with its inverse. The inverse of FillType describes the area
unmodified by the original FillType.
#Table
@@ -1271,6 +1273,7 @@ a newly initialized path.
#Method bool isEmpty() const
#In Property
#Line # returns if verb count is zero ##
+Returns if Path is empty.
Empty Path may have FillType but has no SkPoint, Verb, or Conic_Weight.
SkPath() constructs empty Path; reset() and (rewind) make Path empty.
@@ -1310,6 +1313,7 @@ after reset path is empty
#Method bool isLastContourClosed() const
#In Property
#Line # returns if final Contour forms a loop ##
+Returns if Contour is closed.
Contour is closed if Path Verb array was last modified by close(). When stroked,
closed Contour draws Paint_Stroke_Join instead of Paint_Stroke_Cap at first and last Point.
@@ -1415,7 +1419,7 @@ volatile by default is false
#Method void setIsVolatile(bool isVolatile)
#In Volatile
#Line # sets if Device should not cache ##
-Specify whether Path is volatile; whether it will be altered or discarded
+Specifies whether Path is volatile; whether it will be altered or discarded
by the caller after it is drawn. Paths by default have volatile set false, allowing
Device to attach a cache of data which speeds repeated drawing.
@@ -1456,7 +1460,7 @@ GPU_Surface Path draws are affected by volatile for some shadows and concave geo
#Method static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact)
#In Property
#Line # returns if Line is very small ##
-Test if Line between Point pair is degenerate.
+Tests if Line between Point pair is degenerate.
Line with no length or that moves a very short distance is degenerate; it is
treated as a point.
@@ -1504,7 +1508,7 @@ line from (100,100) to (100.0001,100.0001) is not degenerate, exactly
#In Property
#Line # returns if Quad is very small ##
-Test if Quad is degenerate.
+Tests if Quad is degenerate.
Quad with no length or that moves a very short distance is degenerate; it is
treated as a point.
@@ -1558,7 +1562,7 @@ quad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly
#In Property
#Line # returns if Cubic is very small ##
-Test if Cubic is degenerate.
+Tests if Cubic is degenerate.
Cubic with no length or that moves a very short distance is degenerate; it is
treated as a point.
@@ -1939,7 +1943,7 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553
#Method void updateBoundsCache() const
#In Utility
#Line # refreshes result of getBounds ##
-Update internal bounds so that subsequent calls to getBounds are instantaneous.
+Updates internal bounds so that subsequent calls to getBounds are instantaneous.
Unaltered copies of Path may also access cached bounds through getBounds.
For now, identical to calling getBounds and ignoring the returned value.
@@ -2072,7 +2076,7 @@ void draw(SkCanvas* canvas) {
#Method void incReserve(unsigned extraPtCount)
#In Utility
#Line # reserves space for additional data ##
-grows Path Verb_Array and Point_Array to contain extraPtCount additional Points.
+Grows Path Verb_Array and Point_Array to contain extraPtCount additional Points.
May improve performance and use less memory by
reducing the number and size of allocations when creating Path.
@@ -3145,7 +3149,7 @@ void draw(SkCanvas* canvas) {
#In Build
#In Arc
#Line # appends Arc ##
-Append Arc to Path. Arc added is part of ellipse
+Appends Arc to Path. Arc added is part of ellipse
bounded by oval, from startAngle through sweepAngle. Both startAngle and
sweepAngle are measured in degrees, where zero degrees is aligned with the
positive x-axis, and positive sweeps extends Arc clockwise.
@@ -3192,7 +3196,7 @@ void draw(SkCanvas* canvas) {
#Method void arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius)
#In Build
#In Arc
-Append Arc to Path, after appending Line if needed. Arc is implemented by Conic
+Appends Arc to Path, after appending Line if needed. Arc is implemented by Conic
weighted to describe part of Circle. Arc is contained by tangent from
last Path point (x0, y0) to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc
is part of Circle sized to radius, positioned so it touches both tangent lines.
@@ -3341,7 +3345,7 @@ conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683
#Method void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius)
#In Build
#In Arc
-Append Arc to Path, after appending Line if needed. Arc is implemented by Conic
+Appends Arc to Path, after appending Line if needed. Arc is implemented by Conic
weighted to describe part of Circle. Arc is contained by tangent from
last Path point to p1, and tangent from p1 to p2. Arc
is part of Circle sized to radius, positioned so it touches both tangent lines.
@@ -3457,7 +3461,7 @@ void draw(SkCanvas* canvas) {
#In Build
#In Arc
-Append Arc to Path. Arc is implemented by one or more Conics weighted to
+Appends Arc to Path. Arc is implemented by one or more Conics weighted to
describe part of Oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc
curves from last Path Point to (x, y), choosing one of four possible routes:
clockwise or counterclockwise, and smaller or larger.
@@ -3512,7 +3516,7 @@ void draw(SkCanvas* canvas) {
#In Build
#In Arc
-Append Arc to Path. Arc is implemented by one or more Conic weighted to describe part of Oval
+Appends Arc to Path. Arc is implemented by one or more Conic weighted to describe part of Oval
with radii (r.fX, r.fY) rotated by xAxisRotate degrees. Arc curves from last Path Point to
(xy.fX, xy.fY), choosing one of four possible routes: clockwise or counterclockwise,
and smaller or larger.
@@ -3558,7 +3562,7 @@ void draw(SkCanvas* canvas) {
#In Arc
#Line # appends Arc relative to Last_Point ##
-Append Arc to Path, relative to last Path Point. Arc is implemented by one or
+Appends Arc to Path, relative to last Path Point. Arc is implemented by one or
more Conic, weighted to describe part of Oval with radii (rx, ry) rotated by
xAxisRotate degrees. Arc curves from last Path Point (x0, y0) to end Point:
@@ -3612,7 +3616,7 @@ void draw(SkCanvas* canvas) {
#Method void close()
#In Build
#Line # makes last Contour a loop ##
-Append kClose_Verb to Path. A closed Contour connects the first and last Point
+Appends kClose_Verb to Path. A closed Contour connects the first and last Point
with Line, forming a continuous loop. Open and closed Contour draw the same
with SkPaint::kFill_Style. With SkPaint::kStroke_Style, open Contour draws
Paint_Stroke_Cap at Contour start and end; closed Contour draws
@@ -3949,7 +3953,7 @@ inner (12.5, 22.5, 27.5, 37.5); direction CCW
#Method void addRect(const SkRect& rect, Direction dir = kCW_Direction)
#In Build
#Line # adds one Contour containing Rect ##
-Add Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,
+Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,
starting with top-left corner of Rect; followed by top-right, bottom-right,
and bottom-left if dir is kCW_Direction; or followed by bottom-left,
bottom-right, and top-right if dir is kCCW_Direction.
@@ -3987,7 +3991,7 @@ void draw(SkCanvas* canvas) {
#Method void addRect(const SkRect& rect, Direction dir, unsigned start)
-Add Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb.
+Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb.
If dir is kCW_Direction, Rect corners are added clockwise; if dir is
kCCW_Direction, Rect corners are added counterclockwise.
start determines the first corner added.
@@ -4045,7 +4049,7 @@ void draw(SkCanvas* canvas) {
#Method void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom,
Direction dir = kCW_Direction)
-Add Rect (left, top, right, bottom) to Path,
+Adds Rect (left, top, right, bottom) to Path,
appending kMove_Verb, three kLine_Verb, and kClose_Verb,
starting with top-left corner of Rect; followed by top-right, bottom-right,
and bottom-left if dir is kCW_Direction; or followed by bottom-left,
@@ -4088,7 +4092,7 @@ void draw(SkCanvas* canvas) {
#Method void addOval(const SkRect& oval, Direction dir = kCW_Direction)
#In Build
#Line # adds one Contour containing Oval ##
-Add Oval to path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
+Adds Oval to path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
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.
@@ -4112,7 +4116,7 @@ clockwise if dir is kCW_Direction, counterclockwise if dir is kCCW_Direction.
#Method void addOval(const SkRect& oval, Direction dir, unsigned start)
-Add Oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
+Adds Oval to Path, appending kMove_Verb, four kConic_Verb, and kClose_Verb.
Oval is upright ellipse bounded by Rect oval with radii equal to half oval width
and half oval height. Oval begins at start and continues
clockwise if dir is kCW_Direction, counterclockwise if dir is kCCW_Direction.
@@ -4173,7 +4177,7 @@ void draw(SkCanvas* canvas) {
#In Build
#Line # adds one Contour containing Circle ##
-Add Circle centered at (x, y) of size radius to Path, appending kMove_Verb,
+Adds Circle centered at (x, y) of size radius to Path, appending kMove_Verb,
four kConic_Verb, and kClose_Verb. Circle begins at:
#Formula
(x + radius, y)
@@ -4211,7 +4215,7 @@ void draw(SkCanvas* canvas) {
#Method void addArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle)
#In Build
#Line # adds one Contour containing Arc ##
-Append Arc to Path, as the start of new Contour. Arc added is part of ellipse
+Appends Arc to Path, as the start of new Contour. Arc added is part of ellipse
bounded by oval, from startAngle through sweepAngle. Both startAngle and
sweepAngle are measured in degrees, where zero degrees is aligned with the
positive x-axis, and positive sweeps extends Arc clockwise.
@@ -4255,7 +4259,7 @@ void draw(SkCanvas* canvas) {
#In Build
#Line # adds one Contour containing Round_Rect with common corner radii ##
-Append Round_Rect to Path, creating a new closed Contour. Round_Rect has bounds
+Appends Round_Rect to Path, creating a new closed Contour. Round_Rect has bounds
equal to rect; each corner is 90 degrees of an ellipse with radii (rx, ry). If
dir is kCW_Direction, Round_Rect starts at top-left of the lower-left corner and
winds clockwise. If dir is kCCW_Direction, Round_Rect starts at the bottom-left
@@ -4306,7 +4310,7 @@ void draw(SkCanvas* canvas) {
#Method void addRoundRect(const SkRect& rect, const SkScalar radii[],
Direction dir = kCW_Direction)
-Append Round_Rect to Path, creating a new closed Contour. Round_Rect has bounds
+Appends Round_Rect to Path, creating a new closed Contour. Round_Rect has bounds
equal to rect; each corner is 90 degrees of an ellipse with radii from the
array.
@@ -4363,7 +4367,7 @@ void draw(SkCanvas* canvas) {
#Method void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction)
#In Build
#Line # adds one Contour containing Round_Rect ##
-Add rrect to Path, creating a new closed Contour. If
+Adds rrect to Path, creating a new closed Contour. If
dir is kCW_Direction, rrect starts at top-left of the lower-left corner and
winds clockwise. If dir is kCCW_Direction, rrect starts at the bottom-left
of the upper-left corner and winds counterclockwise.
@@ -4399,7 +4403,7 @@ void draw(SkCanvas* canvas) {
#Method void addRRect(const SkRRect& rrect, Direction dir, unsigned start)
-Add rrect to Path, creating a new closed Contour. If dir is kCW_Direction, rrect
+Adds rrect to Path, creating a new closed Contour. If dir is kCW_Direction, rrect
winds clockwise; if dir is kCCW_Direction, rrect winds counterclockwise.
start determines the first point of rrect to add.
@@ -4449,7 +4453,7 @@ void draw(SkCanvas* canvas) {
#Method void addPoly(const SkPoint pts[], int count, bool close)
#In Build
#Line # adds one Contour containing connected lines ##
-Add Contour created from Line array, adding (count - 1) Line segments.
+Adds Contour created from Line array, adding (count - 1) Line segments.
Contour added starts at pts[0], then adds a line for every additional Point
in pts array. If close is true,appends kClose_Verb to Path, connecting
pts[count - 1] and pts[0].
@@ -4552,7 +4556,7 @@ The top right composition is made up of one contour; the other three have two.
#In Build
#Line # adds contents of Path ##
-Append src to Path, offset by (dx, dy).
+Appends src to Path, offset by (dx, dy).
If mode is kAppend_AddPathMode, src Verb_Array, Point_Array, and Conic_Weights are
added unaltered. If mode is kExtend_AddPathMode, add Line before appending
@@ -4587,7 +4591,7 @@ Verbs, Points, and Conic_Weights.
#Method void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode)
-Append src to Path.
+Appends src to Path.
If mode is kAppend_AddPathMode, src Verb_Array, Point_Array, and Conic_Weights are
added unaltered. If mode is kExtend_AddPathMode, add Line before appending
@@ -4617,7 +4621,7 @@ Verbs, Points, and Conic_Weights.
#Method void addPath(const SkPath& src, const SkMatrix& matrix, AddPathMode mode = kAppend_AddPathMode)
-Append src to Path, transformed by matrix. Transformed curves may have different
+Appends src to Path, transformed by matrix. Transformed curves may have different
Verbs, Points, and Conic_Weights.
If mode is kAppend_AddPathMode, src Verb_Array, Point_Array, and Conic_Weights are
@@ -4652,7 +4656,7 @@ Verbs, Points, and Conic_Weights.
#Method void reverseAddPath(const SkPath& src)
#In Build
#Line # adds contents of Path back to front ##
-Append src to Path, from back to front.
+Appends src to Path, from back to front.
Reversed src always appends a new Contour to Path.
#Param src Path Verbs, Points, and Conic_Weights to add ##
@@ -4691,7 +4695,7 @@ Reversed src always appends a new Contour to Path.
#Method void offset(SkScalar dx, SkScalar dy, SkPath* dst) const
#In Transform
#Line # translates Point_Array ##
-Offset Point_Array by (dx, dy). Offset Path replaces dst.
+Offsets Point_Array by (dx, dy). Offset Path replaces dst.
If dst is nullptr, Path is replaced by offset data.
#Param dx offset added to Point_Array x-axis coordinates ##
@@ -4725,7 +4729,7 @@ If dst is nullptr, Path is replaced by offset data.
#Method void offset(SkScalar dx, SkScalar dy)
#In Transform
-Offset Point_Array by (dx, dy). Path is replaced by offset data.
+Offsets Point_Array by (dx, dy). Path is replaced by offset data.
#Param dx offset added to Point_Array x-axis coordinates ##
#Param dy offset added to Point_Array y-axis coordinates ##
@@ -4753,7 +4757,7 @@ Offset Point_Array by (dx, dy). Path is replaced by offset data.
#Method void transform(const SkMatrix& matrix, SkPath* dst) const
#In Transform
#Line # applies Matrix to Point_Array and Weights ##
-Transform Verb_Array, Point_Array, and weight by matrix.
+Transforms Verb_Array, Point_Array, and weight by matrix.
transform may change Verbs and increase their number.
Transformed Path replaces dst; if dst is nullptr, original data
is replaced.
@@ -4786,7 +4790,7 @@ is replaced.
#Method void transform(const SkMatrix& matrix)
-Transform Verb_Array, Point_Array, and weight by matrix.
+Transforms Verb_Array, Point_Array, and weight by matrix.
transform may change Verbs and increase their number.
Path is replaced by transformed data.
@@ -4854,7 +4858,7 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
#In Utility
#In Last_Point
#Line # replaces Last_Point ##
- Set Last_Point to (x, y). If Point_Array is empty, append kMove_Verb to
+ Sets Last_Point to (x, y). If Point_Array is empty, append kMove_Verb to
Verb_Array and append (x, y) to Point_Array.
#Param x set x-axis value of Last_Point ##
@@ -4876,7 +4880,7 @@ 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 Point_Array is empty, append kMove_Verb to
+ Sets 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 ##
@@ -5194,7 +5198,7 @@ path is equal to copy
#Method sk_sp<SkData> serialize() const
#In Utility
#Line # copies data to buffer ##
-Write Path to buffer, returning the buffer written to, wrapped in Data.
+Writes Path to buffer, returning the buffer written to, wrapped in Data.
serialize() writes Fill_Type, Verb_Array, Point_Array, Conic_Weight, and
additionally writes computed information like Convexity and bounds.
diff --git a/docs/SkPicture_Reference.bmh b/docs/SkPicture_Reference.bmh
index a722a1deb6..64561de50e 100644
--- a/docs/SkPicture_Reference.bmh
+++ b/docs/SkPicture_Reference.bmh
@@ -22,10 +22,15 @@ This base class handles serialization and a few other miscellany.
# ------------------------------------------------------------------------------
#Class AbortCallback
-#Line # incomplete ##
+#Line # utility to stop picture playback ##
#Code
-#ToDo fill this in manually ##
+ class AbortCallback {
+ public:
+ AbortCallback() {}
+ virtual ~AbortCallback() {}
+ virtual bool abort() = 0;
+ };
##
Subclasses of this can be passed to playback(). During the playback
@@ -39,16 +44,16 @@ to the same level it was before the playback call was made.
# ------------------------------------------------------------------------------
#Method AbortCallback()
-#In incomplete
-#Line # incomplete ##
+#In Constructor
+#Line # defines default constructor ##
+Has no effect.
-#Return incomplete ##
+#Return abstract class cannot be instantiated ##
-#Example
-// incomplete
+#NoExample
##
-#SeeAlso incomplete
+#SeeAlso playback
#Method ##
@@ -56,53 +61,95 @@ to the same level it was before the playback call was made.
#Method virtual ~AbortCallback()
#In Constructor
-#Line # incomplete ##
+#Line # defines default destructor ##
+Has no effect.
-#Example
-// incomplete
+#NoExample
##
-#SeeAlso incomplete
+#SeeAlso playback
#Method ##
# ------------------------------------------------------------------------------
#Method virtual bool abort() = 0
-#In incomplete
-#Line # incomplete ##
+#In Utility
+#Line # aborts playback by callback ##
-#Return incomplete ##
+Stops Picture playback when some condition is met. A subclass of
+AbortCallback provides an override for abort() that can stop playback() from
+drawing the entire picture.
-#Example
-// incomplete
+#Return true to stop playback ##
+
+#NoExample
##
-#SeeAlso incomplete
+#SeeAlso playback
#Method ##
+#Example
+#Description
+JustOneDraw allows the black rectangle to draw but stops playback before the
+white rectangle appears.
+##
+#Function
+class JustOneDraw : public SkPicture::AbortCallback {
+public:
+ bool abort() override { return fCalls++ > 0; }
+private:
+ int fCalls = 0;
+};
+##
+
+void draw(SkCanvas* canvas) {
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ JustOneDraw callback;
+ picture->playback(canvas, &callback);
+}
+
+##
+
#Class AbortCallback ##
# ------------------------------------------------------------------------------
#Method static sk_sp<SkPicture> MakeFromStream(SkStream* stream,
const SkDeserialProcs* procs = nullptr)
-#In incomplete
-#Line # incomplete ##
+#In Constructor
+#Line # constructs Picture from stream ##
-Recreate a picture that was serialized into a stream or data.
+Recreates a picture that was serialized into a stream.
-#Param stream incomplete ##
-#Param procs incomplete ##
+#Param stream container for serial data ##
+#Param procs custom serial data decoders; may be nullptr ##
-#Return incomplete ##
+#Return Picture constructed from stream data ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ SkDynamicMemoryWStream writableStream;
+ picture->serialize(&writableStream);
+ std::unique_ptr<SkStreamAsset> readableStream = writableStream.detachAsStream();
+ sk_sp<SkPicture> copy = SkPicture::MakeFromStream(readableStream.get());
+ copy->playback(canvas);
##
-#SeeAlso incomplete
+#SeeAlso MakeFromData SkPictureRecorder
#Method ##
@@ -110,19 +157,32 @@ Recreate a picture that was serialized into a stream or data.
#Method static sk_sp<SkPicture> MakeFromData(const SkData* data,
const SkDeserialProcs* procs = nullptr)
-#In incomplete
-#Line # incomplete ##
+#In Constructor
+#Line # constructs Picture from data ##
+
+Recreates a picture that was serialized into data.
-#Param data incomplete ##
-#Param procs incomplete ##
+#Param data container for serial data ##
+#Param procs custom serial data decoders; may be nullptr ##
-#Return incomplete ##
+#Return Picture constructed from data ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ SkDynamicMemoryWStream writableStream;
+ picture->serialize(&writableStream);
+ sk_sp<SkData> readableData = writableStream.detachAsData();
+ sk_sp<SkPicture> copy = SkPicture::MakeFromData(readableData.get());
+ copy->playback(canvas);
##
-#SeeAlso incomplete
+#SeeAlso MakeFromStream SkPictureRecorder
#Method ##
@@ -130,180 +190,266 @@ Recreate a picture that was serialized into a stream or data.
#Method static sk_sp<SkPicture> MakeFromData(const void* data, size_t size,
const SkDeserialProcs* procs = nullptr)
-#In incomplete
-#Line # incomplete ##
-#Param data incomplete ##
-#Param size incomplete ##
-#Param procs incomplete ##
+#Param data pointer to serial data ##
+#Param size size of data ##
+#Param procs custom serial data decoders; may be nullptr ##
-#Return incomplete ##
+Recreates a picture that was serialized into data.
+
+#Return Picture constructed from data ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ SkDynamicMemoryWStream writableStream;
+ picture->serialize(&writableStream);
+ sk_sp<SkData> readableData = writableStream.detachAsData();
+ sk_sp<SkPicture> copy = SkPicture::MakeFromData(readableData->data(), readableData->size());
+ copy->playback(canvas);
##
-#SeeAlso incomplete
+#SeeAlso MakeFromStream SkPictureRecorder
#Method ##
# ------------------------------------------------------------------------------
#Method virtual void playback(SkCanvas* canvas, AbortCallback* callback = nullptr) const = 0
-#In incomplete
-#Line # incomplete ##
+#In Action
+#Line # replays drawing commands on canvas ##
Replays the drawing commands on the specified canvas. Note that
this has the effect of unfurling this picture into the destination
canvas. Using the SkCanvas::drawPicture entry point gives the destination
canvas the option of just taking a ref.
-#Param canvas the canvas receiving the drawing commands.
-##
-#Param callback a callback that allows interruption of playback
-##
-
-#Return incomplete ##
+#Param canvas receiver of drawing commands ##
+#Param callback allows interruption of playback ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ picture->playback(canvas);
##
-#SeeAlso incomplete
+#SeeAlso SkCanvas::drawPicture
#Method ##
# ------------------------------------------------------------------------------
#Method virtual SkRect cullRect() const = 0
-#In incomplete
-#Line # incomplete ##
+#In Property
+#Line # returns bounds used to record Picture ##
-Return a cull rect for this picture.
+Returns cull Rect for this picture.
Ops recorded into this picture that attempt to draw outside the cull might not be drawn.
-#Return incomplete ##
+#Return bounds passed when Picture was created ##
#Example
-// incomplete
+#Description
+Picture recorded bounds are smaller than contents; contents outside recorded
+bounds may be drawn, and are drawn in this example.
+##
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({64, 64, 192, 192});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ picture->playback(canvas);
+ paint.setBlendMode(SkBlendMode::kModulate);
+ paint.setColor(0x40404040);
+ canvas->drawRect(picture->cullRect(), paint);
##
-#SeeAlso incomplete
+#SeeAlso SkCanvas::clipRect
#Method ##
# ------------------------------------------------------------------------------
#Method uint32_t uniqueID() const
-#In incomplete
-#Line # incomplete ##
+#In Property
+#Line # returns identifier for Picture ##
Returns a non-zero value unique among all pictures.
-#Return incomplete ##
+#Return identifier for Picture ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ recorder.beginRecording({0, 0, 0, 0});
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ SkDebugf("empty picture id = %d\n", picture->uniqueID());
+ sk_sp<SkPicture> placeholder = SkPicture::MakePlaceholder({0, 0, 0, 0});
+ SkDebugf("placeholder id = %d\n", placeholder->uniqueID());
+#StdOut
+empty picture id = 1
+placeholder id = 2
+##
##
-#SeeAlso incomplete
+#SeeAlso SkRefCnt
#Method ##
# ------------------------------------------------------------------------------
#Method sk_sp<SkData> serialize(const SkSerialProcs* procs = nullptr) const
-#In incomplete
-#Line # incomplete ##
+#In Utility
+#Line # writes Picture to data ##
+Returns storage containing data describing Picture, using optional custom encoders.
-#Param procs incomplete ##
+#Param procs custom serial data encoders; may be nullptr ##
-#Return incomplete ##
+#Return storage containing serialized Picture ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ sk_sp<SkData> readableData = picture->serialize();
+ sk_sp<SkPicture> copy = SkPicture::MakeFromData(readableData->data(), readableData->size());
+ copy->playback(canvas);
##
-#SeeAlso incomplete
+#SeeAlso MakeFromData SkData SkSerialProcs
#Method ##
# ------------------------------------------------------------------------------
#Method void serialize(SkWStream* stream, const SkSerialProcs* procs = nullptr) const
-#In incomplete
-#Line # incomplete ##
+Writes picture to stream, using optional custom encoders.
-#Param stream incomplete ##
-#Param procs incomplete ##
+#Param stream writable serial data stream ##
+#Param procs custom serial data encoders; may be nullptr ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ SkDynamicMemoryWStream writableStream;
+ picture->serialize(&writableStream);
+ sk_sp<SkData> readableData = writableStream.detachAsData();
+ sk_sp<SkPicture> copy = SkPicture::MakeFromData(readableData->data(), readableData->size());
+ copy->playback(canvas);
##
-#SeeAlso incomplete
+#SeeAlso MakeFromStream SkWStream SkSerialProcs
#Method ##
# ------------------------------------------------------------------------------
#Method static sk_sp<SkPicture> MakePlaceholder(SkRect cull)
-#In incomplete
-#Line # incomplete ##
+#In Constructor
+#Line # constructs placeholder with unique identifier ##
-Return a placeholder SkPicture.
+Returns a placeholder SkPicture.
This placeholder does not draw anything itself. It has a distinct uniqueID()
(just like all Pictures) and will always be visible to SkSerialProcs.
-#Param cull the placeholder's dimensions
+#Param cull placeholder dimensions
##
-#Return incomplete ##
+#Return placeholder with unique identifier ##
#Example
-// incomplete
+sk_sp<SkPicture> pict1 = SkPicture::MakePlaceholder({10, 40, 80, 110});
+sk_sp<SkPicture> pict2 = SkPicture::MakePlaceholder({10, 40, 80, 110});
+for (auto pict : { pict1, pict2 } ) {
+ SkRect bounds = pict->cullRect();
+ SkDebugf("id:%d bounds:{%g, %g, %g, %g}\n", pict->uniqueID(),
+ bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
+}
+#StdOut
+id:1 bounds:{10, 40, 80, 110}
+id:2 bounds:{10, 40, 80, 110}
+##
##
-#SeeAlso incomplete
+#SeeAlso MakeFromStream MakeFromData
#Method ##
# ------------------------------------------------------------------------------
#Method virtual int approximateOpCount() const = 0
-#In incomplete
-#Line # incomplete ##
+#In Property
+#Line # returns approximate operation count ##
-Return the approximate number of operations in this picture. This
+Returns the approximate number of operations in this picture. This
number may be greater or less than the number of SkCanvas calls
recorded: some calls may be recorded as more than one operation, or some
calls may be optimized away.
-#Return incomplete ##
+#Return approximate operation count ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ picture->playback(canvas);
+ std::string opCount = "approximate op count: " + std::to_string(picture->approximateOpCount());
+ canvas->drawString(opCount.c_str(), 50, 220, SkPaint());
##
-#SeeAlso incomplete
+#SeeAlso approximateBytesUsed
#Method ##
# ------------------------------------------------------------------------------
#Method virtual size_t approximateBytesUsed() const = 0
-#In incomplete
-#Line # incomplete ##
+#In Property
+#Line # returns approximate size ##
-Returns the approximate byte size of this picture, not including large ref'd objects.
+Returns the approximate byte size of Picture. Does not include large objects
+referenced Picture.
-#Return incomplete ##
+#Return approximate size ##
#Example
-// incomplete
+ SkPictureRecorder recorder;
+ SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});
+ SkPaint paint;
+ pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);
+ paint.setColor(SK_ColorWHITE);
+ pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);
+ sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture();
+ picture->playback(canvas);
+ std::string opCount = "approximate bytes used: " + std::to_string(picture->approximateBytesUsed());
+ canvas->drawString(opCount.c_str(), 20, 220, SkPaint());
##
-#SeeAlso incomplete
+#SeeAlso approximateOpCount
#Method ##
diff --git a/docs/SkPoint_Reference.bmh b/docs/SkPoint_Reference.bmh
index 87f1b618e6..598f963ca9 100644
--- a/docs/SkPoint_Reference.bmh
+++ b/docs/SkPoint_Reference.bmh
@@ -777,6 +777,7 @@ Multiplies Point by scale. Sets Point to:
#Formula
(fX * scale, fY * scale)
##
+.
#Param scale Scalar to multiply by ##
diff --git a/docs/SkRRect_Reference.bmh b/docs/SkRRect_Reference.bmh
index a96237cdc5..638e356a6b 100644
--- a/docs/SkRRect_Reference.bmh
+++ b/docs/SkRRect_Reference.bmh
@@ -22,18 +22,17 @@ Path forward:
detect and triangulate RRectorii rather than falling back to SW in Ganesh
##
-The SkRRect class represents a rounded rect with a potentially different
-radii for each corner. It does not have a constructor so must be
-initialized with one of the initialization functions (e.g., setEmpty,
-setRectRadii, etc.)
+SkRRect describes a rounded rectangle with a bounds and a pair of radii for each corner.
+The bounds and radii can be set so that SkRRect describes a rectangle with sharp corners,
+a Circle, an Oval, or a rectangle with one or more rounded corners.
-This class allows implementing CSS properties that describe rounded corners.
-A rectangle may have up to eight radii, one for each axis on each of its four
+SkRRect allows implementing CSS properties that describe rounded corners.
+SkRRect may have up to eight different radii, one for each axis on each of its four
corners.
-If either corner's radii are zero, the corner is square.
-Negative radii are treated as zero.
-If corner curves overlap, they are proportionally reduced to fit.
+SkRRect may modify the provided parameters when initializing bounds and radii.
+If either axis radii is zero or less, radii are stored as zero; corner is square.
+If corner curves overlap, radii are proportionally reduced to fit within bounds.
#Subtopic Overview
#Populate
@@ -91,6 +90,7 @@ Initializes to copy of rrect bounds and corner radii.
#Bug 8115
#Example
+#Height 60
SkRRect rrect = SkRRect::MakeRect({10, 10, 100, 50});
SkRRect rrect2(rrect);
rrect2.inset(20, 20);
@@ -118,6 +118,7 @@ Copies rrect bounds and corner radii.
#Return copy of rrect ##
#Example
+#Height 110
SkRRect rrect = SkRRect::MakeRect({40, 40, 100, 70});
SkRRect rrect2 = rrect;
rrect2.inset(-20, -20);
@@ -159,31 +160,31 @@ kComplex_Type
Type describes possible specializations of Round_Rect. Each Type is
exclusive; a Round_Rect may only have one type.
-The enum members become progressively less restrictive; larger values of
+Type members become progressively less restrictive; larger values of
Type have more degrees of freedom than smaller values.
-#Const kEmpty_Type
+#Const kEmpty_Type 0
#Line # zero width or height ##
Round_Rect has zero width or height. All radii are zero.
##
-#Const kRect_Type
+#Const kRect_Type 1
#Line # non-zero width and height, and zeroed radii ##
Round_Rect has width and height. All radii are zero.
##
-#Const kOval_Type
+#Const kOval_Type 2
#Line # non-zero width and height filled with radii ##
Round_Rect has width and height. All four x-radii are equal,
and at least half the width. All four y-radii are equal,
and at least half the height.
##
-#Const kSimple_Type
+#Const kSimple_Type 3
#Line # non-zero width and height with equal radii ##
Round_Rect has width and height. All four x-radii are equal and
greater than zero, and all four y-radii are equal and greater than
zero. Either x-radii are less than half the width, or y-radii is
less than half the height, or both.
##
-#Const kNinePatch_Type
+#Const kNinePatch_Type 4
#Line # non-zero width and height with axis-aligned radii ##
Round_Rect has width and height. Left x-radii are equal, top
y-radii are equal, right x-radii are equal, and bottom y-radii
@@ -193,11 +194,11 @@ The centers of the corner ellipses form an axis-aligned rectangle
that divides the Round_Rect into nine rectangular patches; an
interior rectangle, four edges, and four corners.
##
-#Const kComplex_Type
+#Const kComplex_Type 5
#Line # non-zero width and height with arbitrary radii ##
both radii are non-zero.
##
-#Const kLastType = kComplex_Type
+#Const kLastType 5
#Line # largest Type value ##
##
@@ -238,6 +239,7 @@ Returns Type, one of: #list_of_rrect_types#.
#Return Type ##
#Example
+#Height 100
#Description
rrect2 is not a Rect; inset() has made it empty.
##
@@ -269,6 +271,7 @@ Returns Type, one of: #list_of_rrect_types#.
#Return Type ##
#Example
+#Height 100
#Description
inset() has made rrect2 empty.
##
@@ -325,7 +328,8 @@ to rect().fBottom.
#Method inline bool isRect() const
#In Property
#Line # returns true if not empty, and one radius at each corner is zero ##
-Returns true if not empty, and if either x or y radius at each corner is zero.
+Returns true if not empty, and if either x-axis or y-axis radius at each corner
+is zero.
#Return true if not empty, and one radius at each corner is zero ##
@@ -365,8 +369,8 @@ least half the height.
#Description
The first radii are scaled down proportionately until both x-axis and y-axis fit
within the bounds. After scaling, x-axis radius is smaller than half the width;
-left round rect is not an oval. The second radii are equal to half the
-dimensions; right round rect is an oval.
+left Round_Rect is not an oval. The second radii are equal to half the
+dimensions; right Round_Rect is an oval.
##
SkPaint paint;
paint.setAntiAlias(true);
@@ -389,12 +393,12 @@ dimensions; right round rect is an oval.
#Method inline bool isSimple() const
#In Property
-#Line # returns true if not empty, rect or oval; and axes radii are equal ##
+#Line # returns true if not empty, Rect or Oval; and axes radii are equal ##
Returns true if not empty, if all x-axis radii are equal but not zero,
if all y-axis radii are equal but not zero; and x-axis radius is less than half
width(), or y-axis radius is less than half height().
-#Return true if not empty, rect or oval; and axes radii are equal ##
+#Return true if not empty, Rect or Oval; and axes radii are equal ##
#Bug 8107
#Example
@@ -423,12 +427,12 @@ width(), or y-axis radius is less than half height().
#Method inline bool isNinePatch() const
#In Property
-#Line # returns true if not empty, rect, oval or simple; and radii are axis-aligned ##
+#Line # returns true if not empty, Rect, Oval or simple; and radii are axis-aligned ##
Returns true if isEmpty, isRect, isOval, and isSimple return false; and if
left x-axis radii are equal, right x-axis radii are equal, top y-axis radii are
equal, and bottom y-axis radii are equal.
-#Return true if not empty, rect, oval or simple; and radii are axis-aligned ##
+#Return true if not empty, Rect, Oval or simple; and radii are axis-aligned ##
#Bug 8107
#Example
@@ -457,7 +461,7 @@ equal, and bottom y-axis radii are equal.
#Method inline bool isComplex() const
#In Property
-#Line # returns true if not empty, rect, oval, simple, or nine-patch ##
+#Line # returns true if not empty, Rect, Oval, simple, or nine-patch ##
Returns true if isEmpty, isRect, isOval, isSimple, and isNinePatch return false.
If true: width and height are greater than zero, at least one corner radii are
@@ -465,9 +469,10 @@ both greater than zero; left x-axis radii are not equal, or right x-axis radii
are not equal, or top y-axis radii are not equal, or bottom y-axis radii are not
equal.
-#Return true if not empty, rect, oval, simple, or nine-patch ##
+#Return true if not empty, Rect, Oval, simple, or nine-patch ##
#Example
+#Height 100
SkPaint paint;
paint.setAntiAlias(true);
paint.setTextAlign(SkPaint::kCenter_Align);
@@ -492,7 +497,7 @@ equal.
#Method SkScalar width() const
#In Property
-#Line # returns span in x ##
+#Line # returns span in x-axis ##
Returns span on the x-axis. This does not check if result fits in 32-bit float;
result may be infinity.
@@ -520,7 +525,7 @@ large width: inf
#Method SkScalar height() const
#In Property
-#Line # returns span in y ##
+#Line # returns span in y-axis ##
Returns span on the y-axis. This does not check if result fits in 32-bit float;
result may be infinity.
@@ -558,6 +563,7 @@ remaining three corners has a different value.
#Return corner radii for simple types ##
#Example
+#Height 100
auto drawDetails = [=](const SkRRect& rrect) {
SkPaint paint;
paint.setAntiAlias(true);
@@ -590,8 +596,9 @@ Sets bounds to zero width and height at (0, 0), the origin. Sets
corner radii to zero and sets type to kEmpty_Type.
#Example
+#Height 80
#Description
-Nothing blue is drawn because rrect is set to empty.
+Nothing blue is drawn because Round_Rect is set to empty.
##
SkPaint paint;
SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
@@ -609,7 +616,7 @@ Nothing blue is drawn because rrect is set to empty.
#Method void setRect(const SkRect& rect)
#In Set
-#Line # sets rect bounds with zeroed corners ##
+#Line # sets Round_Rect bounds with zeroed corners ##
Sets bounds to sorted rect, and sets corner radii to zero.
If set bounds has width and height, and sets type to kRect_Type;
@@ -694,7 +701,7 @@ Initializes to copy of r bounds and zeroes corner radii.
#Line # creates Oval to fit bounds ##
Sets bounds to oval, x-axis radii to half oval.width(), and all y-axis radii
-to half oval.height(). If rect is empty, sets to kEmpty_Type.
+to half oval.height(). If oval bounds is empty, sets to kEmpty_Type.
Otherwise, sets to kOval_Type.
#Param oval bounds of Oval ##
@@ -757,7 +764,7 @@ Otherwise, sets to kSimple_Type.
#Line # replaces with Oval to fit bounds ##
Sets bounds to oval, x-axis radii to half oval.width(), and all y-axis radii
-to half oval.height(). If rect is empty, sets to kEmpty_Type.
+to half oval.height(). If oval bounds is empty, sets to kEmpty_Type.
Otherwise, sets to kOval_Type.
#Param oval bounds of Oval ##
@@ -878,6 +885,7 @@ sets to kSimple_Type. Otherwise, sets to kNinePatch_Type.
#Param radii corner x-axis and y-axis radii ##
#Example
+#Height 128
SkPaint paint;
paint.setStrokeWidth(15);
paint.setStrokeCap(SkPaint::kSquare_Cap);
@@ -1001,7 +1009,7 @@ Both radii may be zero. If not zero, both are positive and finite.
#Example
#Description
Finite values are scaled proportionately to fit; other values are set to zero.
-Scaled values cannot be larger than 25, half the bounding rect width.
+Scaled values cannot be larger than 25, half the bounding Round_Rect width.
Small scaled values are halved to scale in proportion to the y-axis corner
radius, which is twice the bounds height.
##
@@ -1121,15 +1129,17 @@ contain zeroes width different signs.
#In Inset_Outset_Offset
#Line # insets bounds and radii ##
-Calls inset on the bounds, and adjust the radii to reflect what happens.
-If the corner is sharp (no curvature), leave it alone,
-otherwise we grow/shrink the radii by the amount of the inset. If a
-given radius becomes negative, it is pinned to 0.
-If the inset amount is larger than the width/height then the rrect collapses to
-a degenerate line or point.
-If the inset is sufficiently negative to cause the bounds to become infinite then
-the result is a default initialized rrect.
-It is valid for dst == this.
+Copies Round_Rect to dst, then insets dst bounds by dx and dy, and adjusts dst
+radii by dx and dy. dx and dy may be positive, negative, or zero. dst may be
+Round_Rect.
+
+If either corner radius is zero, the corner has no curvature and is unchanged.
+Otherwise, if adjusted radius becomes negative, pins radius to zero.
+If dx exceeds half dst bounds width, dst bounds left and right are set to
+bounds x-axis center. If dy exceeds half dst bounds height, dst bounds top and
+bottom are set to bounds y-axis center.
+
+If dx or dy cause the bounds to become infinite, dst bounds is zeroed.
#Param dx added to rect().fLeft, and subtracted from rect().fRight ##
#Param dy added to rect().fTop, and subtracted from rect().fBottom ##
@@ -1155,6 +1165,16 @@ It is valid for dst == this.
#Method void inset(SkScalar dx, SkScalar dy)
#In Inset_Outset_Offset
#Line # insets bounds and radii ##
+Insets bounds by dx and dy, and adjusts radii by dx and dy. dx and dy may be
+positive, negative, or zero.
+
+If either corner radius is zero, the corner has no curvature and is unchanged.
+Otherwise, if adjusted radius becomes negative, pins radius to zero.
+If dx exceeds half bounds width, bounds left and right are set to
+bounds x-axis center. If dy exceeds half bounds height, bounds top and
+bottom are set to bounds y-axis center.
+
+If dx or dy cause the bounds to become infinite, bounds is zeroed.
#Param dx added to rect().fLeft, and subtracted from rect().fRight ##
#Param dy added to rect().fTop, and subtracted from rect().fBottom ##
@@ -1181,11 +1201,16 @@ It is valid for dst == this.
#In Inset_Outset_Offset
#Line # outsets bounds and radii ##
-Call outset on the bounds, and adjust the radii to reflect what happens
-in stroking. If the corner is sharp (no curvature), leave it alone,
-otherwise we grow/shrink the radii by the amount of the inset. If a
-given radius becomes negative, it is pinned to 0.
-It is valid for dst == this.
+Outsets dst bounds by dx and dy, and adjusts radii by dx and dy. dx and dy may be
+positive, negative, or zero.
+
+If either corner radius is zero, the corner has no curvature and is unchanged.
+Otherwise, if adjusted radius becomes negative, pins radius to zero.
+If dx exceeds half dst bounds width, dst bounds left and right are set to
+bounds x-axis center. If dy exceeds half dst bounds height, dst bounds top and
+bottom are set to bounds y-axis center.
+
+If dx or dy cause the bounds to become infinite, dst bounds is zeroed.
#Param dx subtracted from rect().fLeft, and added to rect().fRight ##
#Param dy subtracted from rect().fTop, and added to rect().fBottom ##
@@ -1213,6 +1238,17 @@ It is valid for dst == this.
#In Inset_Outset_Offset
#Line # outsets bounds and radii ##
+Outsets bounds by dx and dy, and adjusts radii by dx and dy. dx and dy may be
+positive, negative, or zero.
+
+If either corner radius is zero, the corner has no curvature and is unchanged.
+Otherwise, if adjusted radius becomes negative, pins radius to zero.
+If dx exceeds half bounds width, bounds left and right are set to
+bounds x-axis center. If dy exceeds half bounds height, bounds top and
+bottom are set to bounds y-axis center.
+
+If dx or dy cause the bounds to become infinite, bounds is zeroed.
+
#Param dx subtracted from rect().fLeft, and added to rect().fRight ##
#Param dy subtracted from rect().fTop, and added to rect().fBottom ##
@@ -1237,7 +1273,7 @@ It is valid for dst == this.
#In Inset_Outset_Offset
#Line # offsets bounds and radii ##
-Translates the rrect by (dx, dy).
+Translates Round_Rect by (dx, dy).
#Param dx offset added to rect().fLeft and rect().fRight ##
#Param dy offset added to rect().fTop and rect().fBottom ##
@@ -1263,6 +1299,8 @@ Translates the rrect by (dx, dy).
#In Inset_Outset_Offset
#Line # offsets bounds and radii ##
+Returns Round_Rect translated by (dx, dy).
+
#Param dx offset added to rect().fLeft and rect().fRight ##
#Param dy offset added to rect().fTop and rect().fBottom ##
@@ -1297,7 +1335,22 @@ Round_Rect and rect are not empty.
#Return true if Round_Rect contains rect ##
#Example
-// incomplete
+#Height 110
+ SkRect test = {10, 10, 110, 80};
+ SkRRect rrect = SkRRect::MakeRect(test);
+ SkRRect oval = SkRRect::MakeOval(test);
+ test.inset(10, 10);
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setTextAlign(SkPaint::kCenter_Align);
+ canvas->drawString(rrect.contains(test) ? "contains" : "does not contain", 55, 100, paint);
+ canvas->drawString(oval.contains(test) ? "contains" : "does not contain", 185, 100, paint);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRRect(rrect, paint);
+ canvas->drawRect(test, paint);
+ canvas->translate(120, 0);
+ canvas->drawRRect(oval, paint);
+ canvas->drawRect(test, paint);
##
#SeeAlso SkRect::contains
@@ -1308,26 +1361,40 @@ Round_Rect and rect are not empty.
#Method bool isValid() const
#In Utility
-#Line # incomplete ##
+#Line # returns if type() matches bounds and radii ##
+Returns true if bounds and radii values are finite and describe a Round_Rect
+Type that matches getType. All Round_Rect methods construct valid types,
+even if the input values are not valid. Invalid Round_Rect data can only
+be generated by corrupting memory.
-#Return incomplete ##
+#Return true if bounds and radii match type() ##
#Example
-// incomplete
+#Height 110
+ SkRRect rrect = SkRRect::MakeRect({10, 10, 110, 80});
+ SkRRect corrupt = rrect;
+ *((float*) &corrupt) = 120;
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setTextAlign(SkPaint::kCenter_Align);
+ canvas->drawString(rrect.isValid() ? "is valid" : "is corrupted", 55, 100, paint);
+ canvas->drawString(corrupt.isValid() ? "is valid" : "is corrupted", 185, 100, paint);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRRect(rrect, paint);
+ canvas->translate(120, 0);
+ canvas->drawRRect(corrupt, paint);
##
-#SeeAlso incomplete
+#SeeAlso Type getType
#Method ##
# ------------------------------------------------------------------------------
#Const kSizeInMemory 48
-#Line # incomplete ##
+#Line # storage space for Round_Rect ##
-#Example
-// incomplete
-##
+Space required to serialize SkRRect into a buffer. Always a multiple of four.
#Const ##
@@ -1335,21 +1402,34 @@ Round_Rect and rect are not empty.
#Method size_t writeToMemory(void* buffer) const
#In Utility
-#Line # incomplete ##
+#Line # writes Round_Rect to buffer ##
-Write the rrect into the specified buffer. This is guaranteed to always
-write kSizeInMemory bytes, and that value is guaranteed to always be
-a multiple of 4. Return kSizeInMemory.
+Writes Round_Rect to buffer. Writes kSizeInMemory bytes, and returns
+kSizeInMemory, the number of bytes written.
-#Param buffer incomplete ##
+#Param buffer storage for Round_Rect ##
-#Return incomplete ##
+#Return bytes written, kSizeInMemory ##
#Example
-// incomplete
+#Height 110
+ SkRRect rrect = SkRRect::MakeRect({10, 10, 110, 80});
+ char storage[SkRRect::kSizeInMemory];
+ rrect.writeToMemory(storage);
+ SkRRect copy;
+ copy.readFromMemory(storage, sizeof(storage));
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setTextAlign(SkPaint::kCenter_Align);
+ canvas->drawString("rrect", 55, 100, paint);
+ canvas->drawString("copy", 185, 100, paint);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRRect(rrect, paint);
+ canvas->translate(120, 0);
+ canvas->drawRRect(copy, paint);
##
-#SeeAlso incomplete
+#SeeAlso readFromMemory
#Method ##
@@ -1357,26 +1437,39 @@ a multiple of 4. Return kSizeInMemory.
#Method size_t readFromMemory(const void* buffer, size_t length)
#In Utility
-#Line # incomplete ##
+#Line # reads Round_Rect from buffer ##
-Reads the rrect from the specified buffer.
-If the specified buffer is large enough, this will read kSizeInMemory bytes,
-and that value is guaranteed to always be a multiple of 4.
+Reads Round_Rect from buffer, reading kSizeInMemory bytes.
+Returns kSizeInMemory, bytes read if length is at least kSizeInMemory.
+Otherwise, returns zero.
-#Param buffer memory to read from
-##
-#Param length amount of memory available in the buffer
-##
+#Param buffer memory to read from ##
+#Param length size of buffer ##
-#Return number of bytes read (must be a multiple of 4) or
- 0 if there was not enough memory available
+#Return bytes read, or 0 if length is less than kSizeInMemory
##
#Example
-// incomplete
+#Height 110
+ SkVector radii[] = {{5, 5}, {10, 10}, {15, 15}, {5, 5}};
+ SkRRect rrect;
+ rrect.setRectRadii({10, 10, 110, 80}, radii);
+ char storage[SkRRect::kSizeInMemory];
+ rrect.writeToMemory(storage);
+ SkRRect copy;
+ copy.readFromMemory(storage, sizeof(storage));
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setTextAlign(SkPaint::kCenter_Align);
+ canvas->drawString("rrect", 55, 100, paint);
+ canvas->drawString("copy", 185, 100, paint);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRRect(rrect, paint);
+ canvas->translate(120, 0);
+ canvas->drawRRect(copy, paint);
##
-#SeeAlso incomplete
+#SeeAlso writeToMemory
#Method ##
@@ -1399,10 +1492,25 @@ Asserts in debug builds if Round_Rect equals dst.
##
#Example
-// incomplete
+#Height 110
+ SkVector radii[] = {{5, 5}, {10, 10}, {15, 15}, {5, 5}};
+ SkRRect rrect;
+ rrect.setRectRadii({10, 10, 110, 80}, radii);
+ SkRRect transformed;
+ SkMatrix matrix = SkMatrix::MakeRectToRect(rrect.rect(), {140, 30, 220, 80},
+ SkMatrix::kCenter_ScaleToFit);
+ bool success = rrect.transform(matrix, &transformed);
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setTextAlign(SkPaint::kCenter_Align);
+ canvas->drawString("rrect", 55, 100, paint);
+ canvas->drawString(success ? "transformed" : "transform failed", 185, 100, paint);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRRect(rrect, paint);
+ canvas->drawRRect(transformed, paint);
##
-#SeeAlso incomplete
+#SeeAlso SkPath::transform
#Method ##
diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh
index cf42ef7aa5..a84a6dd1c2 100644
--- a/docs/SkSurface_Reference.bmh
+++ b/docs/SkSurface_Reference.bmh
@@ -1250,6 +1250,7 @@ Does not copy, and returns false if:
# Pixmap pixels could not be allocated. ##
# dst.rowBytes() is too small to contain one row of pixels. ##
##
+.
#Param dst storage for pixels copied from Surface ##
#Param srcX offset into readable pixels on x-axis; may be negative ##
@@ -1309,6 +1310,7 @@ Does not copy, and returns false if:
# Surface pixels could not be converted to dstInfo.colorType() or dstInfo.alphaType(). ##
# dstRowBytes is too small to contain one row of pixels. ##
##
+.
#Param dstInfo width, height, Color_Type, and Alpha_Type of dstPixels ##
#Param dstPixels storage for pixels; dstInfo.height() times dstRowBytes, or larger ##
@@ -1375,6 +1377,7 @@ Does not copy, and returns false if:
# dst pixels could not be allocated. ##
# dst.rowBytes() is too small to contain one row of pixels. ##
##
+.
#Param dst storage for pixels copied from Surface ##
#Param srcX offset into readable pixels on x-axis; may be negative ##
@@ -1417,6 +1420,7 @@ Destination Rect corners are (dstX, dstY) and
(dstX + Surface width(), dstY + Surface height())
##
.
+
Copies each readable pixel intersecting both rectangles, without scaling,
converting to Surface colorType() and Surface alphaType() if required.
@@ -1457,6 +1461,7 @@ Destination Rect corners are (dstX, dstY) and
(dstX + Surface width(), dstY + Surface height())
##
.
+
Copies each readable pixel intersecting both rectangles, without scaling,
converting to Surface colorType() and Surface alphaType() if required.
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index 91e3a4030e..c4a65a18a6 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -137,14 +137,6 @@ FT_Load_Glyph
#Substitute HTML gray
##
-#Topic HTML_DarkGray
-#Substitute HTML dark gray
-##
-
-#Topic HTML_LightGray
-#Substitute HTML light gray
-##
-
#Topic HTML_Silver
#Substitute HTML silver
##
@@ -614,6 +606,7 @@ FT_Load_Glyph
#Topic Premultiply
#Alias Premultiplied ##
+#Alias Premultiplies ##
##
#Topic Raster_Engine
diff --git a/docs/usingBookmaker.bmh b/docs/usingBookmaker.bmh
index 236c16d7c5..f74db8f77f 100644
--- a/docs/usingBookmaker.bmh
+++ b/docs/usingBookmaker.bmh
@@ -118,6 +118,12 @@ which will be ignored.
Install
#A Go # https://golang.org/doc/install ##
if needed.
+Check the version. The resuls should be 1.10 or greater.
+
+#Code
+$ go version
+##
+
Get the fiddle command line interface tool.
By default this will appear in your home directory.