From 80247e594d1fb168e11a19ce6a73a7e7169ec1f5 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 11 Jul 2018 16:18:41 -0400 Subject: 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 Reviewed-by: Cary Clark Auto-Submit: Cary Clark --- site/user/api/METADATA | 5 + site/user/api/SkBitmap_Reference.md | 22 +++- site/user/api/SkBlendMode_Reference.md | 60 +++++----- site/user/api/SkCanvas_Reference.md | 199 ++++++++++++++++---------------- site/user/api/SkColor_Reference.md | 8 +- site/user/api/SkImageInfo_Reference.md | 28 ++--- site/user/api/SkImage_Reference.md | 2 +- site/user/api/SkMatrix_Reference.md | 96 +++++++++++++++- site/user/api/SkPaint_Reference.md | 65 +++++------ site/user/api/SkPath_Reference.md | 86 +++++++------- site/user/api/SkPicture_Reference.md | 196 ++++++++++++++++++-------------- site/user/api/SkPoint_Reference.md | 1 + site/user/api/SkRRect_Reference.md | 201 +++++++++++++++++++-------------- site/user/api/SkSurface_Reference.md | 6 + site/user/api/catalog.htm | 160 +++++++++++--------------- site/user/api/index.md | 5 + site/user/api/undocumented.md | 4 - site/user/api/usingBookmaker.md | 6 + 18 files changed, 661 insertions(+), 489 deletions(-) (limited to 'site/user') diff --git a/site/user/api/METADATA b/site/user/api/METADATA index f0db250f41..590bcdc72a 100644 --- a/site/user/api/METADATA +++ b/site/user/api/METADATA @@ -2,7 +2,10 @@ "fileOrder": [ "SkAutoCanvasRestore_Reference", "SkBitmap_Reference", + "SkBlendMode_Reference", "SkCanvas_Reference", + "SkColor_Reference", + "SkColor4f_Reference", "SkImage_Reference", "SkImageInfo_Reference", "SkIPoint_Reference", @@ -11,8 +14,10 @@ "SkMatrix_Reference", "SkPaint_Reference", "SkPath_Reference", + "SkPicture_Reference", "SkPixmap_Reference", "SkPoint_Reference", + "SkRRect_Reference", "SkRect_Reference", "SkSurface_Reference", "usingBookmaker", diff --git a/site/user/api/SkBitmap_Reference.md b/site/user/api/SkBitmap_Reference.md index 61550cbed9..625fdfbadf 100644 --- a/site/user/api/SkBitmap_Reference.md +++ b/site/user/api/SkBitmap_Reference.md @@ -1043,7 +1043,7 @@ Returns pixel count in each row. Should be equal or less than: 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 Value @@ -1408,7 +1408,7 @@ width: 2 height: 2 empty: false bool isNull() const -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. @@ -1444,7 +1444,7 @@ allocated bitmap does have pixels bool drawsNothing() const -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 Value @@ -1744,8 +1744,8 @@ isOpaque: true bool isVolatile() const -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. @@ -2058,6 +2058,8 @@ Calls reset and returns false if: +. + ### Parameters @@ -3398,6 +3400,8 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
imageInfo
+. + ### Parameters @@ -3452,6 +3456,8 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
x
+. + ### Parameters @@ -3506,6 +3512,8 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
x
+. + ### Parameters @@ -3565,6 +3573,8 @@ Return false if:
x
+. + ### Parameters @@ -3633,6 +3643,8 @@ row to the next. Returns true if pixels are copied. Returns false if:
dst
+. + Pixels are copied only if pixel conversion is possible. If Bitmap colorType is kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match. If Bitmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match. diff --git a/site/user/api/SkBlendMode_Reference.md b/site/user/api/SkBlendMode_Reference.md index 80e98b474f..b00e325725 100644 --- a/site/user/api/SkBlendMode_Reference.md +++ b/site/user/api/SkBlendMode_Reference.md @@ -292,7 +292,7 @@ components color information, using SkBlendMode::kClear 0 - Blend Mode Clear  + Clear  Replaces destination with Alpha and Color components set to zero; a fully transparent pixel. @@ -301,7 +301,7 @@ a fully transparent pixel. SkBlendMode::kSrc 1 - Blend Mode Src  + Src  Replaces destination with source. Destination alpha and color component values are ignored. @@ -310,7 +310,7 @@ are ignored. SkBlendMode::kDst 2 - Blend Mode Dst  + Dst  Preserves destination, ignoring source. Drawing with Paint set to kDst has no effect. @@ -319,7 +319,7 @@ no effect. SkBlendMode::kSrcOver 3 - Blend Mode Src Over  + Src Over  Replaces destination with source blended with destination. If source is opaque, replaces destination with source. Used as the default Blend Mode for SkPaint. @@ -328,7 +328,7 @@ replaces destination with source. Used as the default Blen SkBlendMode::kDstOver 4 - Blend Mode Dst Over  + Dst Over  Replaces destination with destination blended with source. If destination is opaque, has no effect. @@ -337,7 +337,7 @@ has no effect. SkBlendMode::kSrcIn 5 - Blend Mode Src In  + Src In  Replaces destination with source using destination opacity. @@ -345,7 +345,7 @@ Replaces destination with source using destination opacity. SkBlendMode::kDstIn 6 - Blend Mode Dst In  + Dst In  Scales destination opacity by source opacity. @@ -353,7 +353,7 @@ Scales destination opacity by source opacity. SkBlendMode::kSrcOut 7 - Blend Mode Src Out  + Src Out  Replaces destination with source using the inverse of destination opacity, drawing source fully where destination opacity is zero. @@ -362,7 +362,7 @@ drawing source fully where destination opacity is zero. SkBlendMode::kDstOut 8 - Blend Mode Dst Out  + Dst Out  Replaces destination opacity with inverse of source opacity. If source is transparent, has no effect. @@ -371,7 +371,7 @@ transparent, has no effect. SkBlendMode::kSrcATop 9 - Blend Mode Src Atop  + Src Atop  Blends destination with source using read destination opacity. @@ -379,7 +379,7 @@ Blends destination with source using read destination opacity. SkBlendMode::kDstATop 10 - Blend Mode Dst Atop  + Dst Atop  Blends destination with source using source opacity. @@ -387,7 +387,7 @@ Blends destination with source using source opacity. SkBlendMode::kXor 11 - Blend Mode Xor  + Xor  Blends destination by exchanging transparency of the source and destination. @@ -395,7 +395,7 @@ Blends destination by exchanging transparency of the source and destination. SkBlendMode::kPlus 12 - Blend Mode Plus  + Plus  Replaces destination with source and destination added together. @@ -403,7 +403,7 @@ Replaces destination with source and destination added together. SkBlendMode::kModulate 13 - Blend Mode Modulate  + Modulate  Replaces destination with source and destination multiplied together. @@ -411,7 +411,7 @@ Replaces destination with source and destination multiplied together. SkBlendMode::kScreen 14 - Blend Mode Screen  + Screen  Replaces destination with inverted source and destination multiplied together. @@ -426,7 +426,7 @@ last Porter_Duff blend mode SkBlendMode::kOverlay 15 - Blend Mode Overlay  + Overlay  Replaces destination with multiply or screen, depending on destination. @@ -434,7 +434,7 @@ Replaces destination with multiply or screen, depending on destination. SkBlendMode::kDarken 16 - Blend Mode Darken  + Darken  Replaces destination with darker of source and destination. @@ -442,7 +442,7 @@ Replaces destination with darker of source and destination. SkBlendMode::kLighten 17 - Blend Mode Lighten  + Lighten  Replaces destination with lighter of source and destination. @@ -450,7 +450,7 @@ Replaces destination with lighter of source and destination. SkBlendMode::kColorDodge 18 - Blend Mode Color Dodge  + Color Dodge  Makes destination brighter to reflect source. @@ -458,7 +458,7 @@ Makes destination brighter to reflect source. SkBlendMode::kColorBurn 19 - Blend Mode Color Burn  + Color Burn  Makes destination darker to reflect source. @@ -466,7 +466,7 @@ Makes destination darker to reflect source. SkBlendMode::kHardLight 20 - Blend Mode Hard Light  + Hard Light  Makes destination lighter or darker, depending on source. @@ -474,7 +474,7 @@ Makes destination lighter or darker, depending on source. SkBlendMode::kSoftLight 21 - Blend Mode Soft Light  + Soft Light  Makes destination lighter or darker, depending on source. @@ -482,7 +482,7 @@ Makes destination lighter or darker, depending on source. SkBlendMode::kDifference 22 - Blend Mode Difference  + Difference  Subtracts darker from lighter with higher contrast. @@ -490,7 +490,7 @@ Subtracts darker from lighter with higher contrast. SkBlendMode::kExclusion 23 - Blend Mode Exclusion  + Exclusion  Subtracts darker from lighter with lower contrast. @@ -498,7 +498,7 @@ Subtracts darker from lighter with lower contrast. SkBlendMode::kMultiply 24 - Blend Mode Multiply  + Multiply  Multiplies source with destination, darkening image. @@ -514,7 +514,7 @@ Last blend mode operating separately on components. SkBlendMode::kHue 25 - Blend Mode Hue  + Hue  Replaces hue of destination with hue of source, leaving saturation and luminosity unchanged. @@ -523,7 +523,7 @@ unchanged. SkBlendMode::kSaturation 26 - Blend Mode Saturation  + Saturation  Replaces saturation of destination saturation hue of source, leaving hue and luminosity unchanged. @@ -532,7 +532,7 @@ luminosity unchanged. SkBlendMode::kColor 27 - Blend Mode Color  + Color  Replaces hue and saturation of destination with hue and saturation of source, leaving luminosity unchanged. @@ -541,7 +541,7 @@ leaving luminosity unchanged. SkBlendMode::kLuminosity 28 - Blend Mode Luminosity  + Luminosity  Replaces luminosity of destination with luminosity of source, leaving hue and saturation unchanged. @@ -770,7 +770,7 @@ Da as destination Alpha, Dc as destination 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/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index ca2cc86795..4e24c9161b 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -816,7 +816,7 @@ soon explicit SkCanvas(const SkBitmap& 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 @@ -895,7 +895,7 @@ Is a placeholder to allow specialized constructor; has no meaning. SkCanvas(const SkBitmap& bitmap, ColorBehavior behavior) -Android framework only. +For use by Android framework only. ### Parameters @@ -920,7 +920,7 @@ Android framework only. SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props) -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 @@ -1104,9 +1104,8 @@ emptyInfo == canvasInfo bool getProps(SkSurfaceProps* props) const -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. ### Parameters @@ -1498,6 +1497,8 @@ Does not copy, and returns false if: +. + ### Parameters @@ -1594,6 +1595,8 @@ Does not copy, and returns false if:
dstInfo
+. + ### Parameters @@ -1674,6 +1677,8 @@ Does not copy, and returns false if:
pixmap
+. + ### Parameters @@ -1753,6 +1758,8 @@ Does not copy, and returns false if:
bitmap
+. + ### Parameters @@ -1829,6 +1836,8 @@ Does not copy, and returns false if:
info
+. + ### Parameters @@ -2664,9 +2673,9 @@ Outside of the circle the mandrill is brightened. void translate(SkScalar dx, SkScalar dy) -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 @@ -2706,9 +2715,9 @@ follows translate of (50, 50). void scale(SkScalar sx, SkScalar sy) -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 @@ -2741,9 +2750,9 @@ the result with Matrix. void rotate(SkScalar degrees) -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 @@ -2774,11 +2783,11 @@ are rotated clockwise. void rotate(SkScalar degrees, SkScalar px, SkScalar py) -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 @@ -2814,11 +2823,11 @@ transforming the result with Matrix. void skew(SkScalar sx, SkScalar sy) -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. @@ -2855,7 +2864,7 @@ Blue text combines sx and concat(const SkMatrix& matrix) -Replace Matrix with matrixPremultiplied with existing Matrix. +Replaces Matrix with matrixPremultiplied with existing Matrix. This has the effect of transforming the drawn geometry by matrix, before transforming the result with existing Matrix. @@ -2884,7 +2893,7 @@ transforming the result with existing Matrix. void setMatrix(const SkMatrix& matrix) -Replace Matrix with matrix. +Replaces Matrix with matrix. Unlike concat, any prior matrix state is overwritten. ### Parameters @@ -3000,7 +3009,7 @@ The edge of the Anti Aliased clip par void clipRect(const SkRect& rect, SkClipOp op, bool doAntiAlias) -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. @@ -3033,7 +3042,7 @@ before it is combined with Clip. void clipRect(const SkRect& rect, SkClipOp op) -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. @@ -3063,7 +3072,7 @@ Resulting Clip is Aliased; void clipRect(const SkRect& rect, bool doAntiAlias = false) -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. @@ -3121,7 +3130,7 @@ Pass an empty clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias) -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. @@ -3155,7 +3164,7 @@ before it is combined with Clip. void clipRRect(const SkRRect& rrect, SkClipOp op) -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. @@ -3185,7 +3194,7 @@ Resulting Clip is Aliased; void clipRRect(const SkRRect& rrect, bool doAntiAlias = false) -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. @@ -3216,7 +3225,7 @@ with an Aliased or clipPath(const SkPath& path, SkClipOp op, bool doAntiAlias) -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. @@ -3256,7 +3265,7 @@ area inside clip is intersected with circle. void clipPath(const SkPath& path, SkClipOp op) -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 @@ -3293,7 +3302,7 @@ before it is combined with Clip. void clipPath(const SkPath& path, bool doAntiAlias = false) -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 @@ -3343,7 +3352,7 @@ testingSet to simplify clip stack using PathOpsclipRegion(const SkRegion& deviceRgn, SkClipOp op = SkClipOp::kIntersect) -Replace Clip with the intersection or difference of Clip and RegiondeviceRgn. +Replaces Clip with the intersection or difference of Clip and RegiondeviceRgn. Resulting Clip is Aliased; pixels are fully contained by the clip. deviceRgn is unaffected by Matrix. @@ -3377,7 +3386,7 @@ aligns to pixel boundaries. bool quickReject(const SkRect& rect) const -Return true if Rectrect, transformed by Matrix, can be quickly determined to be +Returns true if Rectrect, 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. @@ -3418,7 +3427,7 @@ quickReject false bool quickReject(const SkPath& path) const -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. @@ -3460,7 +3469,7 @@ quickReject false SkRectgetLocalClipBounds() const -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 @@ -3500,7 +3509,7 @@ left:14.5 top:64.5 right:60.5 bottom:115.5 bool getLocalClipBounds(SkRect* bounds) const -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 @@ -3543,7 +3552,7 @@ local bounds empty = true SkIRectgetDeviceClipBounds() const -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. @@ -3582,7 +3591,7 @@ left:15 top:65 right:60 bottom:115 bool getDeviceClipBounds(SkIRect* bounds) const -Return IRectbounds of Clip, unaffected by Matrix. If Clip is empty, +Returns IRectbounds 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. @@ -3816,7 +3825,7 @@ device bounds empty = true void drawColor(SkColor color, SkBlendMode mode = SkBlendMode::kSrcOver) -Fill Clip with Colorcolor. +Fills Clip with Colorcolor. mode determines how ARGB is combined with destination. ### Parameters @@ -3846,7 +3855,7 @@ Fill Clip with Color < void clear(SkColor color) -Fill Clip with Colorcolor using SkBlendMode::kSrc. +Fills Clip with Colorcolor using SkBlendMode::kSrc. This has the effect of replacing all pixels contained by Clip with color. ### Parameters @@ -3873,7 +3882,7 @@ This has the effect of replacing all pixels contained by Clipdiscard() -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. @@ -3898,7 +3907,7 @@ any cached data is deleted when owning Sur void drawPaint(const SkPaint& paint) -Fill Clip with Paintpaint. Paint components Mask Filter, Shader, +Fills Clip with Paintpaint. Paint components Mask Filter, Shader, Color Filter, Image Filter, and Blend Mode affect drawing; Path Effect in paint is ignored. @@ -3977,7 +3986,7 @@ The lower left corner shows two lines with a miter when path contains polygon. void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint) -Drawpts using Clip, Matrix and Paintpaint. +Draws pts using Clip, Matrix and Paintpaint. 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. @@ -4055,7 +4064,7 @@ the path is drawn all at once. void drawPoint(SkScalar x, SkScalar y, const SkPaint& paint) -Draw point at (x, y) using Clip, Matrix and Paintpaint. +Draws point at (x, y) using Clip, Matrix and Paintpaint. The shape of point drawn depends on paintPaint Stroke Cap. If paint is set to SkPaint::kRound Cap, draw a circle of diameter @@ -4092,7 +4101,7 @@ draw a square of width and height Paint void drawPoint(SkPoint p, const SkPaint& paint) -Draw point p using Clip, Matrix and Paintpaint. +Draws point p using Clip, Matrix and Paintpaint. The shape of point drawn depends on paintPaint Stroke Cap. If paint is set to SkPaint::kRound Cap, draw a circle of diameter @@ -4202,7 +4211,7 @@ In paint: drawRect(const SkRect& rect, const SkPaint& paint) -DrawRectrect using Clip, Matrix, and Paintpaint. +Draws Rectrect using Clip, Matrix, and Paintpaint. 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. @@ -4234,7 +4243,7 @@ if stroked, Paint Stroke Width desc void drawIRect(const SkIRect& rect, const SkPaint& paint) -DrawIRectrect using Clip, Matrix, and Paintpaint. +Draws IRectrect using Clip, Matrix, and Paintpaint. 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. @@ -4266,7 +4275,7 @@ if stroked, Paint Stroke Width desc void drawRegion(const SkRegion& region, const SkPaint& paint) -DrawRegionregion using Clip, Matrix, and Paintpaint. +Draws Regionregion using Clip, Matrix, and Paintpaint. 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. @@ -4298,7 +4307,7 @@ if stroked, Paint Stroke Width desc void drawOval(const SkRect& oval, const SkPaint& paint) -DrawOvaloval using Clip, Matrix, and Paint. +Draws Ovaloval 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. @@ -4329,7 +4338,7 @@ if stroked, Paint Stroke Width desc void drawRRect(const SkRRect& rrect, const SkPaint& paint) -DrawRound Rectrrect using Clip, Matrix, and Paintpaint. +Draws Round Rectrrect using Clip, Matrix, and Paintpaint. In paint: Paint Style determines if rrect is stroked or filled; if stroked, Paint Stroke Width describes the line thickness. @@ -4363,7 +4372,7 @@ may have any combination of positive non-square radii for the four corners. void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) -DrawRound Rectouter and inner +Draws Round Rectouter and inner using Clip, Matrix, and Paintpaint. outer must contain inner or the drawing is undefined. In paint: Paint Style determines if Round Rect is stroked or filled; @@ -4412,7 +4421,7 @@ Stroke join does not affect innerdrawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint& paint) -DrawCircle at (cx, cy) with radius using Clip, Matrix, and Paintpaint. +Draws Circle at (cx, cy) with radius using Clip, Matrix, and Paintpaint. 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. @@ -4449,7 +4458,7 @@ if stroked, Paint Stroke Width desc void drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint) -DrawCircle at center with radius using Clip, Matrix, and Paintpaint. +Draws Circle at center with radius using Clip, Matrix, and Paintpaint. 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. @@ -4485,7 +4494,7 @@ void drawArc(const SkPaint& paint) -DrawArc using Clip, Matrix, and Paintpaint. +Draws Arc using Clip, Matrix, and Paintpaint. Arc is part of Oval bounded by oval, sweeping from startAngle to startAngle plus sweepAngle. startAngle and sweepAngle are in degrees. @@ -4539,7 +4548,7 @@ If Rectova void drawRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, const SkPaint& paint) -DrawRound Rect bounded by Rectrect, with corner radii (rx, ry) using Clip, +Draws Round Rect bounded by Rectrect, with corner radii (rx, ry) using Clip, Matrix, and Paintpaint. In paint: Paint Style determines if Round Rect is stroked or filled; @@ -4586,7 +4595,7 @@ DrawRRect drawRectdrawPath(const SkPath& path, const SkPaint& paint) -DrawPathpath using Clip, Matrix, and Paintpaint. +Draws Pathpath using Clip, Matrix, and Paintpaint. 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: @@ -4633,7 +4642,7 @@ a smart pointer as a convenience. The pairs of calls are otherwise identical. void drawImage(const SkImage* image, SkScalar left, SkScalar top, const SkPaint* paint = nullptr) -DrawImageimage, with its top-left corner at (left, top), +Draws Imageimage, with its top-left corner at (left, top), using Clip, Matrix, and optional Paintpaint. If paint is supplied, apply Color Filter, Color Alpha, Image Filter, Blend Mode, @@ -4677,7 +4686,7 @@ void drawImage(const SkPaint* paint = nullptr) -DrawImageimage, with its top-left corner at (left, top), +Draws Imageimage, with its top-left corner at (left, top), using Clip, Matrix, and optional Paintpaint. If Paintpaint is supplied, apply Color Filter, Color Alpha, Image Filter, @@ -4778,7 +4787,7 @@ void drawImageRect(const SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawRectsrc of Imageimage, scaled and translated to fill Rectdst. +Draws Rectsrc of Imageimage, scaled and translated to fill Rectdst. Additionally transform draw using Clip, Matrix, and optional Paintpaint. If Paintpaint is supplied, apply Color Filter, Color Alpha, Image Filter, @@ -4835,7 +4844,7 @@ void drawImageRect(const SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawIRectisrc of Imageimage, scaled and translated to fill Rectdst. +Draws IRectisrc of Imageimage, scaled and translated to fill Rectdst. Note that isrc is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paintpaint. @@ -4889,7 +4898,7 @@ void drawImageRect(const SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawImageimage, scaled and translated to fill Rectdst, using Clip, Matrix, +Draws Imageimage, scaled and translated to fill Rectdst, using Clip, Matrix, and optional Paintpaint. If Paintpaint is supplied, apply Color Filter, Color Alpha, Image Filter, @@ -4938,7 +4947,7 @@ void drawImageRect(const SkPaint* paint, SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawRectsrc of Imageimage, scaled and translated to fill Rectdst. +Draws Rectsrc of Imageimage, scaled and translated to fill Rectdst. Additionally transform draw using Clip, Matrix, and optional Paintpaint. If Paintpaint is supplied, apply Color Filter, Color Alpha, Image Filter, @@ -4992,7 +5001,7 @@ void drawImageRect(const SkPaint* paint, SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawIRectisrc of Imageimage, scaled and translated to fill Rectdst. +Draws IRectisrc of Imageimage, scaled and translated to fill Rectdst. isrc is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paintpaint. @@ -5045,7 +5054,7 @@ void drawImageRect(const SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawImageimage, scaled and translated to fill Rectdst, +Draws Imageimage, scaled and translated to fill Rectdst, using Clip, Matrix, and optional Paintpaint. If Paintpaint is supplied, apply Color Filter, Color Alpha, Image Filter, @@ -5095,7 +5104,7 @@ void drawImageNine(const SkPaint* paint = nullptr) -DrawImageimage stretched proportionally to fit into Rectdst. +Draws Imageimage stretched proportionally to fit into Rectdst. IRectcenter 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. @@ -5149,7 +5158,7 @@ void drawImageNine(const SkPaint* paint = nullptr) -DrawImageimage stretched proportionally to fit into Rectdst. +Draws Imageimage stretched proportionally to fit into Rectdst. IRectcenter 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. @@ -5205,7 +5214,7 @@ and below center to fill the rema void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint = nullptr) -DrawBitmapbitmap, with its top-left corner at (left, top), +Draws Bitmapbitmap, with its top-left corner at (left, top), using Clip, Matrix, and optional Paintpaint. If Paintpaint is not nullptr, apply Color Filter, Color Alpha, Image Filter, @@ -5252,7 +5261,7 @@ void drawBitmapRect(const SkPaint* paint, SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawRectsrc of Bitmapbitmap, scaled and translated to fill Rectdst. +Draws Rectsrc of Bitmapbitmap, scaled and translated to fill Rectdst. Additionally transform draw using Clip, Matrix, and optional Paintpaint. If Paintpaint is supplied, apply Color Filter, Color Alpha, Image Filter, @@ -5305,7 +5314,7 @@ void drawBitmapRect(const SkPaint* paint, SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawIRectisrc of Bitmapbitmap, scaled and translated to fill Rectdst. +Draws IRectisrc of Bitmapbitmap, scaled and translated to fill Rectdst. isrc is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paintpaint. @@ -5359,7 +5368,7 @@ void drawBitmapRect(const SrcRectConstraint constraint = kStrict SrcRectConstraint) -DrawBitmapbitmap, scaled and translated to fill Rectdst. +Draws Bitmapbitmap, scaled and translated to fill Rectdst. bitmap bounds is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paintpaint. @@ -5411,7 +5420,7 @@ void drawBitmapNine(const SkPaint* paint = nullptr) -DrawBitmapbitmap stretched proportionally to fit into Rectdst. +Draws Bitmapbitmap stretched proportionally to fit into Rectdst. IRectcenter 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 @@ -5647,7 +5656,7 @@ void drawBitmapLattice(const SkPaint* paint = nullptr) -DrawBitmapbitmap stretched proportionally to fit into Rectdst. +Draws Bitmapbitmap stretched proportionally to fit into Rectdst. Latticelattice divides bitmap into a rectangular grid. Each intersection of an even-numbered row and column is fixed; like the corners @@ -5708,7 +5717,7 @@ void drawImageLattice(const SkPaint* paint = nullptr) -DrawImageimage stretched proportionally to fit into Rectdst. +Draws Imageimage stretched proportionally to fit into Rectdst. Latticelattice divides image into a rectangular grid. Each intersection of an even-numbered row and column is fixed; like the corners @@ -5822,7 +5831,7 @@ are scaled if needed to take up the remaining space; the center is transparent. void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, const SkPaint& paint) -Drawtext, with origin at (x, y), using Clip, Matrix, and Paintpaint. +Draws text, with origin at (x, y), using Clip, Matrix, and Paintpaint. text meaning depends on Paint Text Encoding; by default, text is encoded as UTF-8. @@ -5921,7 +5930,7 @@ ending with a char value of zero 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 Paintpaint. string meaning depends on Paint Text Encoding; by default, strings are encoded @@ -5970,7 +5979,7 @@ ending with a char value of zero void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkPaint& paint) -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 Paintpaint. The number of entries in pos array must match the number of Glyphs described by byteLength of text. @@ -6020,7 +6029,7 @@ void drawPosTextH(const void* text, size_t const SkPaint& paint) -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 Paintpaint. The number of entries in xpos array must match the number of Glyphs described by byteLength of text. @@ -6075,7 +6084,7 @@ void drawTextOnPathHV(const void* text, SkScalar vOffset, const SkPaint& paint) -Drawtext on Pathpath, using Clip, Matrix, and Paintpaint. +Draws text on Pathpath, using Clip, Matrix, and Paintpaint. 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 @@ -6132,7 +6141,7 @@ void drawTextOnPath(const void* text, siz const SkPaint& paint) -Drawtext on Pathpath, using Clip, Matrix, and Paintpaint. +Draws text on Pathpath, using Clip, Matrix, and Paintpaint. 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 @@ -6190,7 +6199,7 @@ void drawTextRSXform(const void* text, s const SkRect* cullRect, const SkPaint& paint) -Drawtext, transforming each glyph by the corresponding SkRSXform, +Draws text, transforming each glyph by the corresponding SkRSXform, using Clip, Matrix, and Paintpaint. RSXformxform array specifies a separate square scale, rotation, and translation @@ -6239,7 +6248,7 @@ filled 12 point black Glyphs. void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, const SkPaint& paint) -DrawText Blobblob at (x, y), using Clip, Matrix, and Paintpaint. +Draws Text Blobblob at (x, y), using Clip, Matrix, and Paintpaint. blob contains Glyphs, their positions, and paint attributes specific to text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, @@ -6284,7 +6293,7 @@ Elements of paint: drawTextBlob(const sk sp<SkTextBlob>& blob, SkScalar x, SkScalar y, const SkPaint& paint) -DrawText Blobblob at (x, y), using Clip, Matrix, and Paintpaint. +Draws Text Blobblob at (x, y), using Clip, Matrix, and Paintpaint. blob contains Glyphs, their positions, and paint attributes specific to text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, @@ -6332,7 +6341,7 @@ Elements of paint: drawPicture(const SkPicture* picture) -DrawPicturepicture, using Clip and Matrix. +Draws Picturepicture, using Clip and Matrix. Clip and Matrix are unchanged by picture contents, as if save was called before and restore was called after drawPicture. @@ -6361,7 +6370,7 @@ void drawPicture(const drawPicture(const sk sp<SkPicture>& picture) -DrawPicturepicture, using Clip and Matrix. +Draws Picturepicture, using Clip and Matrix. Clip and Matrix are unchanged by picture contents, as if save was called before and restore was called after drawPicture. @@ -6390,7 +6399,7 @@ void drawPicture(const drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) -DrawPicturepicture, using Clip and Matrix; transforming picture with +Draws Picturepicture, using Clip and Matrix; transforming picture with Matrixmatrix, if provided; and use PaintpaintColor Alpha, Color Filter, Image Filter, and Blend Mode, if provided. @@ -6426,7 +6435,7 @@ void drawPicture(const drawPicture(const sk sp<SkPicture>& picture, const SkMatrix* matrix, const SkPaint* paint) -DrawPicturepicture, using Clip and Matrix; transforming picture with +Draws Picturepicture, using Clip and Matrix; transforming picture with Matrixmatrix, if provided; and use PaintpaintColor Alpha, Color Filter, Image Filter, and Blend Mode, if provided. @@ -6463,7 +6472,7 @@ void drawPicture(const drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) -DrawVerticesvertices, a triangle mesh, using Clip and Matrix. +Draws Verticesvertices, a triangle mesh, using Clip and Matrix. If Vertices Texs and Vertices Colors are defined in vertices, and Paintpaint contains Shader, Blend Modemode combines Vertices Colors with Shader. @@ -6496,7 +6505,7 @@ contains Shader, drawVertices(const sk sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint) -DrawVerticesvertices, a triangle mesh, using Clip and Matrix. +Draws Verticesvertices, a triangle mesh, using Clip and Matrix. If Vertices Texs and Vertices Colors are defined in vertices, and Paintpaint contains Shader, Blend Modemode combines Vertices Colors with Shader. @@ -6530,7 +6539,7 @@ void drawVertices(const SkPaint& paint) -DrawVerticesvertices, a triangle mesh, using Clip and Matrix. Bone data is used to +Draws Verticesvertices, 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 Paintpaint contains Shader, Blend Modemode combines Vertices Colors with Shader. @@ -6575,7 +6584,7 @@ void drawVertices(const SkBlendMode mode, const SkPaint& paint) -DrawVerticesvertices, a triangle mesh, using Clip and Matrix. Bone data is used to +Draws Verticesvertices, 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 Paintpaint contains Shader, Blend Modemode combines Vertices Colors with Shader. @@ -6734,7 +6743,7 @@ void drawAtlas(const SkPaint* paint) -Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. +Draws a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. @@ -6791,7 +6800,7 @@ void drawAtlas(const SkPaint* paint) -Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. +Draws a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. @@ -6846,7 +6855,7 @@ void drawAtlas(const SkRect* cullRect, const SkPaint* paint) -Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. +Draws a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. @@ -6894,7 +6903,7 @@ void drawAtlas(const SkRect* cullRect, const SkPaint* paint) -Draw a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. +Draws a set of sprites from atlas, using Clip, Matrix, and optional Paintpaint. paint uses Anti Alias, Color Alpha, Color Filter, Image Filter, and Blend Mode to draw, if present. For each entry in the array, Recttex locates sprite in atlas, and RSXformxform transforms it into destination space. @@ -6942,7 +6951,7 @@ If cullRect is outside of drawDrawable(SkDrawable* drawable, const SkMatrix* matrix = nullptr) -DrawDrawabledrawable using Clip and Matrix, concatenated with +Draws Drawabledrawable using Clip and Matrix, concatenated with optional matrix. If Canvas has an asynchronous implementation, as is the case @@ -6976,7 +6985,7 @@ immediate drawing, call SkDrawable::draw( void drawDrawable(SkDrawable* drawable, SkScalar x, SkScalar y) -DrawDrawabledrawable using Clip and Matrix, offset by (x, y). +Draws Drawabledrawable 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, @@ -7013,7 +7022,7 @@ immediate drawing, call SkDrawable::draw( void drawAnnotation(const SkRect& rect, const char key[], SkData* value) -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 @@ -7048,7 +7057,7 @@ Only some canvas implementations, such as recording to 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/site/user/api/SkColor_Reference.md b/site/user/api/SkColor_Reference.md index 11920e670c..cb497f6537 100644 --- a/site/user/api/SkColor_Reference.md +++ b/site/user/api/SkColor_Reference.md @@ -477,7 +477,7 @@ opaque colors and masks. Their use is not required. - + - + - + - + diff --git a/site/user/api/SkImageInfo_Reference.md b/site/user/api/SkImageInfo_Reference.md index 0edfe5baf5..e1642271be 100644 --- a/site/user/api/SkImageInfo_Reference.md +++ b/site/user/api/SkImageInfo_Reference.md @@ -197,7 +197,7 @@ components improve performance. - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
bitmap
SK_AlphaTRANSPARENT 0x00Alpha Constants Transparent Transparent  Represents fully transparent SkAlpha value. SkAlpha ranges from zero, fully transparent; to 255, fully opaque. @@ -486,7 +486,7 @@ fully transparent; to 255, fully opaque.
SK_AlphaOPAQUE 0xFFAlpha Constants Opaque Opaque  Represents fully opaque SkAlpha value. SkAlpha ranges from zero, fully transparent; to 255, fully opaque. @@ -621,7 +621,7 @@ The values chosen for names may not be the same as values used by
SK_ColorTRANSPARENT 0x00000000Color Constants Transparent Transparent  Represents fully transparent SkColor. May be used to initialize a destination containing a mask or a non-rectangular image. @@ -630,7 +630,7 @@ containing a mask or a non-rectangular image.
SK_ColorBLACK 0xFF000000Color Constants Black Black  Represents fully opaque black.
kOpaque_SkAlphaType 1Alpha Type Opaque Opaque  Pixels are opaque. The Color Type must have no explicit alpha component, or all alpha components must be set to their maximum value. @@ -206,7 +206,7 @@ component, or all alpha components must be set to their maximum value.
kPremul_SkAlphaType 2Alpha Type Premul Premul  Pixels have Alpha Premultiplied into color components. Surface pixels must be Premultiplied. @@ -215,7 +215,7 @@ Pixels have Alpha kUnpremul_SkAlphaType 3Alpha Type Unpremul Unpremul  Pixel color component values are independent of alpha value. Images generated from encoded data like PNG do not Premultiply pixel color @@ -375,7 +375,7 @@ encoding format and size is unknown.
kAlpha_8_SkColorType 1Color Type Alpha 8 Alpha 8  Stores 8-bit byte pixel encoding that represents transparency. Value of zero is completely transparent; a value of 255 is completely opaque. @@ -384,7 +384,7 @@ is completely transparent; a value of 255 is completely opaque.
kRGB_565_SkColorType 2Color Type RGB 565 RGB 565  Stores 16-bit word pixel encoding that contains five bits of blue, six bits of green, and five bits of red. @@ -393,7 +393,7 @@ six bits of green, and five bits of red.
kARGB_4444_SkColorType 3Color Type ARGB 4444 ARGB 4444  Stores 16-bit word pixel encoding that contains four bits of alpha, four bits of blue, four bits of green, and four bits of red. @@ -402,7 +402,7 @@ four bits of blue, four bits of green, and four bits of red.
kRGBA_8888_SkColorType 4Color Type RGBA 8888 RGBA 8888  Stores 32-bit word pixel encoding that contains eight bits of red, eight bits of green, eight bits of blue, and eight bits of alpha. @@ -411,7 +411,7 @@ eight bits of green, eight bits of blue, and eight bits of alpha.
kRGB_888x_SkColorType 5Color Type RGB 888 RGB 888  Stores 32-bit word pixel encoding that contains eight bits of red, eight bits of green, eight bits of blue, and eight unused bits. @@ -420,7 +420,7 @@ eight bits of green, eight bits of blue, and eight unused bits.
kBGRA_8888_SkColorType 6Color Type BGRA 8888 BGRA 8888  Stores 32-bit word pixel encoding that contains eight bits of blue, eight bits of green, eight bits of red, and eight bits of alpha. @@ -429,7 +429,7 @@ eight bits of green, eight bits of red, and eight bits of alpha.
kRGBA_1010102_SkColorType 7Color Type RGBA 1010102 RGBA 1010102  Stores 32-bit word pixel encoding that contains ten bits of red, ten bits of green, ten bits of blue, and two bits of alpha. @@ -438,7 +438,7 @@ ten bits of green, ten bits of blue, and two bits of alpha.
kRGB_101010x_SkColorType 8Color Type RGB 101010 RGB 101010  Stores 32-bit word pixel encoding that contains ten bits of red, ten bits of green, ten bits of blue, and two unused bits. @@ -447,7 +447,7 @@ ten bits of green, ten bits of blue, and two unused bits.
kGray_8_SkColorType 9Color Type Gray 8 Gray 8  Stores 8-bit byte pixel encoding that equivalent to equal values for red, blue, and green, representing colors from black to white. @@ -456,7 +456,7 @@ blue, and green, representing colors from black to white.
kRGBA_F16_SkColorType 10Color Type RGBA F16 RGBA F16  Stores 64-bit word pixel encoding that contains 16 bits of blue, 16 bits of green, 16 bits of red, and 16 bits of alpha. Each component @@ -466,7 +466,7 @@ is encoded as a half float.
kRGBA_F32_SkColorType 11Color Type RGBA F32 RGBA F32  Stores 128-bit word pixel encoding that contains 32 bits of blue, 32 bits of green, 32 bits of red, and 32 bits of alpha. Each component diff --git a/site/user/api/SkImage_Reference.md b/site/user/api/SkImage_Reference.md index fc6a7e9d00..eec6966d98 100644 --- a/site/user/api/SkImage_Reference.md +++ b/site/user/api/SkImage_Reference.md @@ -2300,7 +2300,7 @@ partial or full Image, or nullptr ### Example -
+
### See Also diff --git a/site/user/api/SkMatrix_Reference.md b/site/user/api/SkMatrix_Reference.md index 4c891add50..617ccc8915 100644 --- a/site/user/api/SkMatrix_Reference.md +++ b/site/user/api/SkMatrix_Reference.md @@ -680,6 +680,8 @@ Sets Matrix to scale by ( | 0 0 1 | +. + ### Parameters @@ -718,6 +720,8 @@ Sets Matrix to scale | 0 0 1 | +. + ### Parameters
sx
@@ -754,6 +758,8 @@ Sets Matrix to translate by (dx @@ -795,6 +801,8 @@ Sets Matrix to: | pers0 pers1 pers2 | +. + ### Parameters
scale
@@ -1076,6 +1084,8 @@ Returns true if Matrix is identity. Identity matrix is: | 0 0 1 | +. + ### Return Value true if Matrix has no effect @@ -1115,6 +1125,8 @@ contain only scale elements, only translate elements, or both. +. + ### Return Value true if Matrix is identity; or scales, translates, or both @@ -1155,6 +1167,8 @@ Returns true if Matrix is identity, or translates. +. + ### Return Value true if Matrix is identity, or translates @@ -2472,6 +2486,8 @@ Sets all values from parameters. Sets matrix to: | persp0 persp1 persp2 | +. + ### Parameters
scaleX
@@ -2570,6 +2586,8 @@ Sets matrix to: | 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 transformation, possibly improving precision. @@ -2606,6 +2624,8 @@ Sets Matrix to identity; which has no effect on mapped +. + Also called setIdentity; use the one that provides better inline documentation. @@ -2642,6 +2662,8 @@ Sets Matrix to identity; which has no effect on mapped +. + Also called reset; use the one that provides better inline documentation. @@ -3037,6 +3059,8 @@ 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 | +. + ### Parameters
scaleX
@@ -3085,6 +3109,8 @@ 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 | +. + ### Parameters
a
@@ -3139,6 +3165,8 @@ 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 | +. + ### Parameters
dx
@@ -3191,6 +3219,8 @@ 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 | +. + ### Parameters
sx
@@ -3249,6 +3279,8 @@ 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 | +. + ### Parameters
sx
@@ -3307,6 +3339,8 @@ 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 | +. + ### Parameters
degrees
@@ -3358,6 +3392,8 @@ Matrix * K(kx, ky, px, py) = | D E F | | ky 1 dy | = | D+E*ky D*kx+E D*dx+E*dy+ | G H I | | 0 0 1 | | G+H*ky G*kx+H G*dx+H*dy+I | +. + ### Parameters
degrees
@@ -3410,6 +3446,8 @@ 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 | +. + ### Parameters
kx
@@ -3456,6 +3494,8 @@ 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 | +. + ### Parameters
kx
@@ -3501,6 +3541,8 @@ 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 | +. + ### Parameters
other
@@ -3556,6 +3598,8 @@ S(sx, sy, px, py) * Matrix = | 0 sy dy | | M N O | = | sy*M+dy*P sy*N+dy*Q sy*O | 0 0 1 | | P Q R | | P Q R | +. + ### Parameters
dx
@@ -3608,6 +3652,8 @@ 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 | +. + ### Parameters
sx
@@ -3663,6 +3709,8 @@ 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 | +. + ### Parameters
sx
@@ -3725,6 +3773,8 @@ R(degrees, px, py) * Matrix = |s c dy| |M N O| = |sJ+cM+dy*P sK+cN+dy*Q sL+cO+d |0 0 1| |P Q R| | P Q R| +. + ### Parameters
divx
@@ -3783,6 +3833,8 @@ 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 | +. + ### Parameters
degrees
@@ -3834,6 +3886,8 @@ K(kx, ky, px, py) * Matrix = |ky 1 dy| |M N O| = |ky*J+M+dy*P ky*K+N+dy*Q ky*L+ | 0 0 1| |P Q R| | P Q R| +. + ### Parameters
degrees
@@ -3886,6 +3940,8 @@ 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 | +. + ### Parameters
kx
@@ -3932,6 +3988,8 @@ 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 | +. + ### Parameters
kx
@@ -4035,6 +4093,8 @@ Returns true if dst is empty, and sets | 0 0 1 | +. + ### Parameters
other
@@ -4096,6 +4156,8 @@ empty, returns Matrix set to: | 0 0 1 | +. + ### Parameters
src
@@ -4229,6 +4291,8 @@ Sets affine to: | 0 1 0 | +. + Affine 3x2 matrices in column major order are used by OpenGL and XPS. ### Parameters @@ -4270,6 +4334,8 @@ Fills affine in column major order. Sets | skew-y scale-y translate-y | +. + If Matrix contains perspective, returns false and leaves affine unchanged. ### Parameters @@ -4324,6 +4390,8 @@ column, then row, as: | 0 0 1 | +. + ### Parameters
src
@@ -4471,6 +4539,8 @@ 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. ### Parameters @@ -4528,6 +4598,8 @@ 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 +. + ### Parameters
affine
@@ -4572,6 +4644,8 @@ Matrix * src = |D E F| |y| = |Ax+By+Cz Dx+Ey+Fz Gx+Hy+Iz| |G H I| |z| +. + ### Parameters
pts
@@ -4618,6 +4692,8 @@ 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 +. + ### Parameters
dst
@@ -4663,6 +4739,8 @@ 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 +. + ### Parameters
x
@@ -4778,6 +4856,8 @@ Matrix * vec = |D E 0| |y| = |Ax+By Dx+Ey Gx+Hy+I| = ------- , ------- |G H I| |1| Gx+Hy+I Gx+Hy+I +. + ### Parameters
x
@@ -4822,6 +4902,8 @@ 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 +. + ### Parameters
vecs
@@ -4868,6 +4950,8 @@ 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 +. + ### Parameters
dx
@@ -5022,6 +5106,8 @@ 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 +. + ### Parameters
dx
@@ -5491,7 +5577,7 @@ Returns true if scale components ar unchanged if Matrix contains perspective; scale factors are not finite, or are nearly zero. -On successMatrix = scale * Remaining +On successMatrix = scale * Remaining. ### Parameters @@ -5543,6 +5629,8 @@ Returns reference to const identity Matrix. Returned +. + ### Return Value const identity Matrix @@ -5582,6 +5670,8 @@ to: | SK_ScalarMax SK_ScalarMax SK_ScalarMax | +. + ### Return Value const invalid Matrix @@ -5629,6 +5719,8 @@ 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 | +. + ### Parameters
dst
@@ -5701,6 +5793,8 @@ Initializes Matrix with scale and translate elements. | 0 0 1 | +. + ### Parameters
a
diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index c63d3cad40..342579d231 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -1661,7 +1661,7 @@ The lines are drawn into Bitmap, then dr bool isAntiAlias() const -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. @@ -1757,7 +1757,7 @@ dither, making it easier to see. bool isDither() const -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. @@ -1860,7 +1860,7 @@ If kLinearText Flag is clear, it is the bool isLinearText() const -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. @@ -1885,7 +1885,7 @@ Equivalent to getFlags masked with setLinearText(bool linearText) -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. @@ -1921,7 +1921,7 @@ of the color increases, the edge of the glyph appears to move towards the outsid bool isSubpixelText() const -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. @@ -1992,7 +1992,7 @@ the color components as RGB or BGR. bool isLCDRenderText() const -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 FlagskLCDRenderText Flag is set. @@ -2095,7 +2095,7 @@ Windows may select the bitmap glyph but is not required to do so. bool isEmbeddedBitmapText() const -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. @@ -2167,9 +2167,9 @@ instructs the Font Manager to always hin bool isAutohinted() const -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. @@ -2203,8 +2203,9 @@ paint.isAutohinted() == !!(paint.getFlags() & SkPaint::kAutoHinting_Flag) void setAutohinted(bool useAutohinter) +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. @@ -2263,7 +2264,7 @@ into glyph series. bool isVerticalText() const -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. @@ -2293,7 +2294,7 @@ paint.isVerticalText() == !!(paint.getFlags() & SkPaint::kVerticalText_Flag) void setVerticalText(bool verticalText) -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. @@ -2346,7 +2347,7 @@ by increasing the stroke width and setting the StyleisFakeBoldText() const -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. @@ -2377,7 +2378,7 @@ paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag) void setFakeBoldText(bool fakeBoldText) -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. @@ -2844,7 +2845,7 @@ May be used to verify that Style is a legal value. StylegetStyle() const -Whether the geometry is filled, stroked, or filled and stroked. +Returns whether the geometry is filled, stroked, or filled and stroked. ### Return Value @@ -3027,7 +3028,7 @@ by a bevel join. SkScalargetStrokeMiter() const -The limit at which a sharp corner is drawn beveled. +Returns the limit at which a sharp corner is drawn beveled. ### Return Value @@ -3058,7 +3059,7 @@ default miter limit == 4 void setStrokeMiter(SkScalar miter) -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. @@ -3186,7 +3187,7 @@ at the contour point. CapgetStrokeCap() const -The geometry drawn at the beginning and end of strokes. +Returns the geometry drawn at the beginning and end of strokes. ### Return Value @@ -3217,7 +3218,7 @@ kButt_Cap == default stroke cap void setStrokeCap(Cap cap) -The geometry drawn at the beginning and end of strokes. +Sets the geometry drawn at the beginning and end of strokes. ### Parameters @@ -3352,7 +3353,7 @@ May be used to verify that Stroke Join is a legal val JoingetStrokeJoin() const -The geometry drawn at the corners of strokes. +Returns the geometry drawn at the corners of strokes. ### Return Value @@ -3383,7 +3384,7 @@ kMiter_Join == default stroke join void setStrokeJoin(Join join) -The geometry drawn at the corners of strokes. +Sets the geometry drawn at the corners of strokes. ### Parameters @@ -3442,7 +3443,7 @@ returns false since Hairline has no filled equival bool getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect, SkScalar resScale = 1) const -The filled equivalent of the stroked path. +Returns the filled equivalent of the stroked path. ### Parameters @@ -3480,7 +3481,7 @@ At the highest precision, the filled path has high fidelity compared to the orig bool getFillPath(const SkPath& src, SkPath* dst) const -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. @@ -3538,7 +3539,7 @@ If Shader generates only SkShader* getShader() const -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 ShaderReference Count. @@ -3568,7 +3569,7 @@ nullptr != shader sk sp<SkShader> refShader() const -Optional colors used when filling a path, such as a gradient. +Returns optional colors used when filling a path, such as a gradient. Increases ShaderReference Count by one. @@ -3598,7 +3599,7 @@ shader unique: false void setShader(sk sp<SkShader> shader) -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 shaderReference Count by one. @@ -5131,7 +5132,7 @@ If kStrikeoutPosit bool hasUnderlineThickness(SkScalar* thickness) const -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. @@ -5155,7 +5156,7 @@ true if font specifies underline width bool hasUnderlinePosition(SkScalar* position) const -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. @@ -5179,7 +5180,7 @@ true if font specifies underline hasStrikeoutThickness(SkScalar* thickness) const -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. @@ -5203,7 +5204,7 @@ true if font specifies strikeout width bool hasStrikeoutPosition(SkScalar* position) const -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. @@ -5925,7 +5926,7 @@ number of intersections; may be zero ### Example -
Text intercepts do not take stroke thickness into consideration. +
Text intercepts do not take stroke thickness into consideration.
--- diff --git a/site/user/api/SkPath_Reference.md b/site/user/api/SkPath_Reference.md index 612f5c44dc..9442e4d14a 100644 --- a/site/user/api/SkPath_Reference.md +++ b/site/user/api/SkPath_Reference.md @@ -906,7 +906,7 @@ contour travels counterclockwise SkPath() -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 Value @@ -938,6 +938,7 @@ path is empty SkPath(const SkPath& path) +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. @@ -1008,6 +1009,7 @@ Releases ownership of any shared data and deletes data if PathSkPath& operator=(const SkPath& path) +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. @@ -1226,7 +1228,7 @@ convexity != bool isInterpolatable(const SkPath& compare) const -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 @@ -1281,7 +1283,7 @@ paths are interpolatable bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const -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: (Path Point * weight) + ending Point * (1 - weight) @@ -1506,7 +1508,7 @@ default path fill type is inverse: false void toggleInverseFillType() -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. | FillType | toggled FillType | @@ -1820,6 +1822,7 @@ a newly initialized path. bool isEmpty() const +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. @@ -1856,6 +1859,7 @@ after reset path is empty bool isLastContourClosed() const +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. @@ -1974,7 +1978,7 @@ volatile by default is false void setIsVolatile(bool isVolatile) -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. @@ -2011,7 +2015,7 @@ Mark unchanging Path non-volatile to improve repeated render static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact) -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. @@ -2066,7 +2070,7 @@ line from (100,100) to (100.0001,100.0001) is not degenerate, exactly static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3, bool exact) -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. @@ -2123,7 +2127,7 @@ static bool IsCubicDegenerate(const SkPoint& p4, bool exact) -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. @@ -2580,7 +2584,7 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553 void updateBoundsCache() const -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. @@ -2696,7 +2700,7 @@ true if rect is contained void incReserve(unsigned extraPtCount) -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. @@ -3637,7 +3641,7 @@ Direction sweep, SkScalar x, SkScalar y) void arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo) -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. @@ -3680,7 +3684,7 @@ is not empty. void arcTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar radius) -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. @@ -3748,7 +3752,7 @@ conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683 void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius) -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. @@ -3846,7 +3850,7 @@ void arcTo(SkScalar< SkScalar x, SkScalar y) -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. @@ -3902,7 +3906,7 @@ while kCW Direction cast to int is zero. void arcTo(const SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, const SkPoint xy) -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. @@ -3953,7 +3957,7 @@ void rArcTo(SkScala SkScalar dx, SkScalar dy) -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: @@ -4015,7 +4019,7 @@ opposite the integer value of sweep; close() -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 @@ -4185,7 +4189,7 @@ number of Quad curves written to Quad curves are drawn in red on top of the elliptical Conic curve in black. +
A pair of Quad curves are drawn in red on top of the elliptical Conic curve in black. The middle curve is nearly circular. The top-right curve is parabolic, which can be drawn exactly with a single Quad.
@@ -4306,7 +4310,7 @@ inner (12.5, 22.5, 27.5, 37.5); direction CCW void addRect(const SkRect& rect, Direction dir = kCW Direction) -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. @@ -4339,7 +4343,7 @@ The right Rect dashes starting at the top-le 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. @@ -4383,7 +4387,7 @@ void addRect(SkSca 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, @@ -4427,7 +4431,7 @@ The right void addOval(const SkRect& oval, Direction dir = kCW Direction) -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. @@ -4458,7 +4462,7 @@ clockwise if dir is 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. @@ -4500,7 +4504,7 @@ clockwise if dir is addCircle(SkScalar x, SkScalar y, SkScalar radius, Direction dir = kCW Direction) -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: (x + radius, y) , @@ -4542,7 +4546,7 @@ Has no effect if radius is zero or negati void addArc(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle) -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. @@ -4584,7 +4588,7 @@ and startAngle modulo 90 is not zero. void addRoundRect(const SkRect& rect, SkScalar rx, SkScalar ry, 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 (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 @@ -4633,7 +4637,7 @@ drawn in green. 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. @@ -4688,7 +4692,7 @@ After appending, Path may be empty, or may contain: addRRect(const SkRRect& rrect, Direction dir = kCW Direction) -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. @@ -4721,7 +4725,7 @@ After appending, Path may be empty, or may contain: 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. @@ -4768,7 +4772,7 @@ After appending, Path may be empty, or may contain: addPoly(const SkPoint pts[], int count, bool close) -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]. @@ -4855,7 +4859,7 @@ The top right composition is made up of one contour; the other three have two. void addPath(const SkPath& src, SkScalar dx, SkScalar dy, AddPathMode mode = kAppend AddPathMode) -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 @@ -4893,7 +4897,7 @@ added unaltered. If mode is 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 @@ -4925,7 +4929,7 @@ added unaltered. If mode is 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 @@ -4962,7 +4966,7 @@ added unaltered. If mode is reverseAddPath(const SkPath& src) -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. ### Parameters @@ -4989,7 +4993,7 @@ Reversed src always appends a new offset(SkScalar dx, SkScalar dy, SkPath* dst) const -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. ### Parameters @@ -5053,7 +5057,7 @@ If dst is nullptr, Path is void offset(SkScalar dx, SkScalar dy) -Offset Point Array by (dx, dy). Path is replaced by offset data. +Offsets Point Array by (dx, dy). Path is replaced by offset data. ### Parameters @@ -5082,7 +5086,7 @@ Offset Point Array by ( void transform(const SkMatrix& matrix, SkPath* dst) const -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. @@ -5113,7 +5117,7 @@ is replaced. 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. @@ -5186,7 +5190,7 @@ last point: 35.2786, 52.9772 void setLastPt(SkScalar x, SkScalar y) -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. ### Parameters @@ -5215,7 +5219,7 @@ Set Last Point to (x 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. ### Parameters @@ -5556,7 +5560,7 @@ path is equal to copy sk sp<SkData> serialize() const -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/site/user/api/SkPicture_Reference.md b/site/user/api/SkPicture_Reference.md index c904aedb18..0992737b04 100644 --- a/site/user/api/SkPicture_Reference.md +++ b/site/user/api/SkPicture_Reference.md @@ -14,15 +14,15 @@ SkPicture can be constructed or initialized by these functions, including C++ cl
- + - + - +
sx Description
MakeFromDataincompleteconstructs Picture from data
MakeFromStreamincompleteconstructs Picture from stream
MakePlaceholderincompleteconstructs placeholder with unique identifier
@@ -58,7 +58,7 @@ SkPicture uses C++ classes to declare the public data structures and interfaces.
Description
AbortCallbackincompleteutility to stop picture playback
@@ -71,39 +71,39 @@ SkPicture member functions read and modify the structure properties. Description MakeFromData - incomplete + constructs Picture from data MakeFromStream - incomplete + constructs Picture from stream MakePlaceholder - incomplete + constructs placeholder with unique identifier approximateBytesUsed - incomplete + returns approximate size approximateOpCount - incomplete + returns approximate operation count cullRect - incomplete + returns bounds used to record Picture playback - incomplete + replays drawing commands on canvas serialize - incomplete + writes Picture to data uniqueID - incomplete + returns identifier for Picture @@ -128,6 +128,10 @@ SkPicture member functions read and modify the structure properties.
+    class AbortCallback {
+    public:
+        AbortCallback() {}
+        virtual
 
Subclasses of this can be passed to playback. During the playback @@ -145,17 +149,15 @@ to the same level it was before the playback call was made. AbortCallback() -### Return Value - -incomplete +Has no effect. -### Example +### Return Value -
+abstract class cannot be instantiated ### See Also -incomplete +playback --- @@ -166,13 +168,11 @@ incomplete virtual -### Example - -
+Has no effect. ### See Also -incomplete +playback --- @@ -183,20 +183,26 @@ incomplete virtual bool abort() = 0 -### Return Value +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. -incomplete - -### Example +### Return Value -
+true to stop playback ### See Also -incomplete +playback --- +### Example + +
JustOneDraw allows the black rectangle to draw but stops playback before the +white rectangle appears. +
+ ## MakeFromStream @@ -204,29 +210,29 @@ incomplete static sk sp<SkPicture> MakeFromStream(SkStream* stream, const SkDeserialProcs* procs = nullptr) -Recreate a picture that was serialized into a stream or data. +Recreates a picture that was serialized into a stream. ### Parameters - + - +
streamincompletecontainer for serial data
procsincompletecustom serial data decoders; may be nullptr
### Return Value -incomplete +Picture constructed from stream data ### Example -
+
### See Also -incomplete +MakeFromData[2] SkPictureRecorder --- @@ -237,27 +243,29 @@ incomplete static sk sp<SkPicture> MakeFromData(const SkData* data, const SkDeserialProcs* procs = nullptr) +Recreates a picture that was serialized into data. + ### Parameters - + - +
dataincompletecontainer for serial data
procsincompletecustom serial data decoders; may be nullptr
### Return Value -incomplete +Picture constructed from data ### Example -
+
### See Also -incomplete +MakeFromStream SkPictureRecorder --- @@ -271,27 +279,29 @@ static sk sp<SkPicture< ### Parameters - + - + - + +Recreates a picture that was serialized into data. +
dataincompletepointer to serial data
sizeincompletesize of data
procsincompletecustom serial data decoders; may be nullptr
### Return Value -incomplete +Picture constructed from data ### Example -
+
### See Also -incomplete +MakeFromStream SkPictureRecorder --- @@ -310,25 +320,20 @@ this has the effect of unfurling this picture into the destination ### Parameters - + - +
canvasthe canvas receiving the drawing commands. -receiver of drawing commands
callbacka callback that allows interruption of playbackallows interruption of playback
-### Return Value - -incomplete - ### Example -
+
### See Also -incomplete +SkCanvas::drawPicture[2][3][4] --- @@ -339,20 +344,22 @@ incomplete virtual SkRect cullRect() const = 0 -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 Value -incomplete +bounds passed when Picture was created ### Example -
+
Picture recorded bounds are smaller than contents; contents outside recorded +bounds may be drawn, and are drawn in this example. +
### See Also -incomplete +SkCanvas::clipRect[2][3] --- @@ -367,15 +374,24 @@ Returns a non-zero value unique among all pictures. ### Return Value -incomplete +identifier for Picture ### Example -
+
+ +#### Example Output + +~~~~ +empty picture id = 1 +placeholder id = 2 +~~~~ + +
### See Also -incomplete +SkRefCnt --- @@ -386,24 +402,26 @@ incomplete sk sp<SkData> serialize(const SkSerialProcs* procs = nullptr) const +Returns storage containing data describing Picture, using optional custom encoders. + ### Parameters - +
procsincompletecustom serial data encoders; may be nullptr
### Return Value -incomplete +storage containing serialized Picture ### Example -
+
### See Also -incomplete +MakeFromData[2] SkData SkSerialProcs --- @@ -413,23 +431,25 @@ incomplete void serialize(SkWStream* stream, const SkSerialProcs* procs = nullptr) const +Writes picture to stream, using optional custom encoders. + ### Parameters - + - +
streamincompletewritable serial data stream
procsincompletecustom serial data encoders; may be nullptr
### Example -
+
### See Also -incomplete +MakeFromStream SkWStream SkSerialProcs --- @@ -440,28 +460,37 @@ incomplete static sk sp<SkPicture> MakePlaceholder(SkRect cull) -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. ### Parameters - +
cullthe placeholder's dimensionsplaceholder dimensions
### Return Value -incomplete +placeholder with unique identifier ### Example -
+
+ +#### Example Output + +~~~~ +id:1 bounds:{10, 40, 80, 110} +id:2 bounds:{10, 40, 80, 110} +~~~~ + +
### See Also -incomplete +MakeFromStream MakeFromData[2] --- @@ -472,22 +501,22 @@ incomplete virtual int approximateOpCount() const = 0 -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 Value -incomplete +approximate operation count ### Example -
+
### See Also -incomplete +approximateBytesUsed --- @@ -498,19 +527,20 @@ incomplete virtual size_t approximateBytesUsed() const = 0 -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 Value -incomplete +approximate size ### Example -
+
### See Also -incomplete +approximateOpCount --- diff --git a/site/user/api/SkPoint_Reference.md b/site/user/api/SkPoint_Reference.md index e35801822d..85e49c1455 100644 --- a/site/user/api/SkPoint_Reference.md +++ b/site/user/api/SkPoint_Reference.md @@ -1224,6 +1224,7 @@ Returns Point multiplied by scale. Multiplies Point by scale. Sets Point to: (fX * scale, fY * scale) +. ### Parameters diff --git a/site/user/api/SkRRect_Reference.md b/site/user/api/SkRRect_Reference.md index c2f16d38ab..e83c3cfe6b 100644 --- a/site/user/api/SkRRect_Reference.md +++ b/site/user/api/SkRRect_Reference.md @@ -58,7 +58,7 @@ SkRRect related constants are defined by enum, enum class kSizeInMemory - incomplete + storage space for Round Rect kUpperLeft Corner @@ -83,18 +83,17 @@ SkRRect global, struct, and class related member funct -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. ## Overview @@ -231,7 +230,7 @@ SkRRect member functions read and modify the structure properties. height - returns span in y + returns span in y-axis inset @@ -239,7 +238,7 @@ SkRRect member functions read and modify the structure properties. isComplex - returns true if not empty, rect, oval, simple, or nine-patch + returns true if not empty, Rect, Oval, simple, or nine-patch isEmpty @@ -247,7 +246,7 @@ SkRRect member functions read and modify the structure properties. isNinePatch - returns true if not empty, rect, oval or simple; and radii are axis-aligned + returns true if not empty, Rect, Oval or simple; and radii are axis-aligned isOval @@ -259,11 +258,11 @@ SkRRect member functions read and modify the structure properties. isSimple - returns true if not empty, rect or oval; and axes radii are equal + returns true if not empty, Rect or Oval; and axes radii are equal isValid - incomplete + returns if type matches bounds and radii makeOffset @@ -283,7 +282,7 @@ SkRRect member functions read and modify the structure properties. readFromMemory - incomplete + reads Round Rect from buffer rect @@ -303,7 +302,7 @@ SkRRect member functions read and modify the structure properties. setRect - sets rect bounds with zeroed corners + sets Round Rect bounds with zeroed corners setRectRadii @@ -323,11 +322,11 @@ SkRRect member functions read and modify the structure properties. width - returns span in x + returns span in x-axis writeToMemory - incomplete + writes Round Rect to buffer @@ -377,7 +376,7 @@ copy of rrect ### Example -
+
### See Also @@ -407,7 +406,7 @@ copy of rrect ### Example -
+
### See Also @@ -434,7 +433,7 @@ copy of rrect 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. ### Constants @@ -445,21 +444,21 @@ The enum members become progressively less restrictive; larger values of Description SkRRect::kEmpty_Type - #Line # zero width or height ## + 0 Round Rect has zero width or height. All radii are zero. SkRRect::kRect_Type - #Line # non-zero width and height, and zeroed radii ## + 1 Round Rect has width and height. All radii are zero. SkRRect::kOval_Type - #Line # non-zero width and height filled with radii ## + 2 Round Rect has width and height. All four x-radii are equal, and at least half the width. All four y-radii are equal, @@ -468,7 +467,7 @@ and at least half the height. SkRRect::kSimple_Type - #Line # non-zero width and height with equal radii ## + 3 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 @@ -478,7 +477,7 @@ less than half the height, or both. SkRRect::kNinePatch_Type - #Line # non-zero width and height with axis-aligned radii ## + 4 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 @@ -491,14 +490,14 @@ interior rectangle, four edges, and four corners. SkRRect::kComplex_Type - #Line # non-zero width and height with arbitrary radii ## + 5 both radii are non-zero. SkRRect::kLastType - = kComplex_Type + 5 largest Type value @@ -528,7 +527,7 @@ Returns Type, one of:
rrect2 is not a Rect; inset has made it empty. +
rrect2 is not a Rect; inset has made it empty.
### See Also @@ -553,7 +552,7 @@ Returns Type, one of:
inset has made rrect2 empty. +
inset has made rrect2 empty.
### See Also @@ -593,7 +592,8 @@ true if width or heightisRect() const -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 Value @@ -628,8 +628,8 @@ true if has identical geometry to Oval
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.
### See Also @@ -651,7 +651,7 @@ if all y-axis radii are equal but not zero; and x-axis radius is less than half ### Return Value -true if not empty, rect or oval; and axes radii are equal +true if not empty, Rect or Oval; and axes radii are equal ### Example @@ -676,7 +676,7 @@ equal, and bottom y-axis radii are equal. ### Return Value -true if not empty, rect, oval or simple; and radii are axis-aligned +true if not empty, Rect, Oval or simple; and radii are axis-aligned ### Example @@ -703,11 +703,11 @@ equal. ### Return Value -true if not empty, rect, oval, simple, or nine-patch +true if not empty, Rect, Oval, simple, or nine-patch ### Example -
+
### See Also @@ -801,7 +801,7 @@ corner radii for simple types ### Example -
+
### See Also @@ -821,7 +821,7 @@ corner radii to zero and sets type to kEmpty Type ### Example -
Nothing blue is drawn because rrect is set to empty. + ### See Also @@ -920,7 +920,7 @@ static SkRRect MakeOval(c 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. ### Parameters @@ -993,7 +993,7 @@ void setOval(const 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. ### Parameters @@ -1129,7 +1129,7 @@ sets to kSimple Type. Otherwise, sets to
+
### See Also @@ -1252,7 +1252,7 @@ x-axis and y-axis radii for one
corner ### Example
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.
@@ -1379,15 +1379,17 @@ true if members are not equal void inset(SkScalar dx, SkScalar dy, SkRRect* dst) const -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. ### Parameters @@ -1418,6 +1420,17 @@ It is valid for dst == this. void inset(SkScalar dx, SkScalar dy) +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. + ### Parameters @@ -1445,11 +1458,16 @@ void inset(SkScalar void outset(SkScalar dx, SkScalar dy, SkRRect* dst) const -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. ### Parameters @@ -1480,6 +1498,17 @@ It is valid for dst == this. void outset(SkScalar dx, SkScalar dy) +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. + ### Parameters
dx
@@ -1507,7 +1536,7 @@ void outset(SkScal void offset(SkScalar dx, SkScalar dy) -Translates the rrect by (dx, dy). +Translates Round Rect by (dx, dy). ### Parameters @@ -1536,6 +1565,8 @@ Translates the rrect by (dx, SkRRect SK_WARN_UNUSED_RESULT makeOffset(SkScalar dx, SkScalar dy) const +Returns Round Rect translated by (dx, dy). + ### Parameters
dx
@@ -1583,7 +1614,7 @@ true if Round Rect contains rect ### Example -
+
### See Also @@ -1598,17 +1629,22 @@ true if Round Rect contains rect bool isValid() const +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 Value -incomplete +true if bounds and radii match type ### Example -
+
### See Also -incomplete +TypegetType --- @@ -1622,12 +1658,7 @@ incomplete
dx SkRRect::kSizeInMemory 48 - - -### Example - -
incomplete - +Space required to serialize SkRRect into a buffer. Always a multiple of four.
@@ -1639,28 +1670,27 @@ incomplete size_t writeToMemory(void* buffer) const -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. ### Parameters - +
bufferincompletestorage for Round Rect
### Return Value -incomplete +bytes written, kSizeInMemory ### Example -
+
### See Also -incomplete +readFromMemory --- @@ -1671,9 +1701,9 @@ incomplete size_t readFromMemory(const void* buffer, size_t length) -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. ### Parameters @@ -1681,22 +1711,21 @@ and that value is guaranteed to always be a multiple of 4. memory to read from length - amount of memory available in the buffer + size of buffer ### Return Value -number of bytes read (must be a multiple of 4) or -0 if there was not enough memory available +bytes read, or 0 if length is less than kSizeInMemory ### Example -
+
### See Also -incomplete +writeToMemory --- @@ -1729,11 +1758,11 @@ true if transformation succeeded. ### Example -
+
### See Also -incomplete +SkPath::transform[2] --- diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md index 387c6cbae6..c1fbe929dc 100644 --- a/site/user/api/SkSurface_Reference.md +++ b/site/user/api/SkSurface_Reference.md @@ -1627,6 +1627,8 @@ Does not copy, and returns false if: +. + ### Parameters @@ -1688,6 +1690,8 @@ Does not copy, and returns false if:
dst
+. + ### Parameters @@ -1760,6 +1764,8 @@ Does not copy, and returns false if:
dstInfo
+. + ### Parameters diff --git a/site/user/api/catalog.htm b/site/user/api/catalog.htm index e1fe83ea30..7ad0dc349d 100644 --- a/site/user/api/catalog.htm +++ b/site/user/api/catalog.htm @@ -2372,6 +2372,20 @@ "file": "SkPath_Reference", "name": "SkPath::writeToMemory", "stdout": "path is equal to copy\\n" + }, + "SkPicture_MakePlaceholder": { + "code": "void draw(SkCanvas* canvas) {\n sk_sp pict1 = SkPicture::MakePlaceholder({10, 40, 80, 110});\n sk_sp pict2 = SkPicture::MakePlaceholder({10, 40, 80, 110});\n for (auto pict : { pict1, pict2 } ) {\n SkRect bounds = pict->cullRect();\n SkDebugf(\"id:%d bounds:{%g, %g, %g, %g}\\n\", pict->uniqueID(), \n bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);\n }\n}", + "hash": "32f84819483a906ede9c5525801845ef", + "file": "SkPicture_Reference", + "name": "SkPicture::MakePlaceholder", + "stdout": "id:1 bounds:{10, 40, 80, 110}\\nid:2 bounds:{10, 40, 80, 110}\\n" + }, + "SkPicture_uniqueID": { + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n recorder.beginRecording({0, 0, 0, 0});\n sk_sp picture = recorder.finishRecordingAsPicture();\n SkDebugf(\"empty picture id = %d\\n\", picture->uniqueID());\n sk_sp placeholder = SkPicture::MakePlaceholder({0, 0, 0, 0});\n SkDebugf(\"placeholder id = %d\\n\", placeholder->uniqueID());\n}", + "hash": "8e4257245c988c600410fe4fd7293f07", + "file": "SkPicture_Reference", + "name": "SkPicture::uniqueID", + "stdout": "empty picture id = 1\\nplaceholder id = 2\\n" }, "SkPixmap_addr": { "code": "void draw(SkCanvas* canvas) {\n std::vector pixels;\n pixels.resize(image->height() * image->width() * 4);\n SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,\n image->alphaType()), (const void*) &pixels.front(), image->width() * 4);\n image->readPixels(pixmap, 0, 0);\n SkDebugf(\"pixels address: 0x%llx\\n\", pixmap.addr());\n SkPixmap inset;\n if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) {\n SkDebugf(\"inset address: 0x%llx\\n\", inset.addr());\n }\n}", @@ -7153,117 +7167,85 @@ "file": "SkPath_Reference", "name": "SkPath::transform_2" }, - "SkPicture_AbortCallback_abort": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "SkPicture_AbortCallback": { + "code": "class JustOneDraw : public SkPicture::AbortCallback {\npublic:\n bool abort() override { return fCalls++ > 0; }\nprivate:\n int fCalls = 0;\n};\n\nvoid draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n JustOneDraw callback;\n picture->playback(canvas, &callback);\n}\n", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "56ed920dadbf2b2967ac45fb5a9bded6", "file": "SkPicture_Reference", - "name": "SkPicture::AbortCallback::abort()" -}, - "SkPicture_AbortCallback_empty_constructor": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkPicture_Reference", - "name": "SkPicture::AbortCallback::AbortCallback()" + "name": "SkPicture::AbortCallback" }, "SkPicture_MakeFromData": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n SkDynamicMemoryWStream writableStream;\n picture->serialize(&writableStream);\n sk_sp readableData = writableStream.detachAsData();\n sk_sp copy = SkPicture::MakeFromData(readableData.get());\n copy->playback(canvas);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "58b44bf47d8816782066618700afdecb", "file": "SkPicture_Reference", "name": "SkPicture::MakeFromData" }, "SkPicture_MakeFromData_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n SkDynamicMemoryWStream writableStream;\n picture->serialize(&writableStream);\n sk_sp readableData = writableStream.detachAsData();\n sk_sp copy = SkPicture::MakeFromData(readableData->data(), readableData->size());\n copy->playback(canvas);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "30b9f1b310187db6aff720a5d67591e2", "file": "SkPicture_Reference", "name": "SkPicture::MakeFromData_2" }, "SkPicture_MakeFromStream": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n SkDynamicMemoryWStream writableStream;\n picture->serialize(&writableStream);\n std::unique_ptr readableStream = writableStream.detachAsStream();\n sk_sp copy = SkPicture::MakeFromStream(readableStream.get());\n copy->playback(canvas);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "404fb42560a289c2004cad1caf3b96de", "file": "SkPicture_Reference", "name": "SkPicture::MakeFromStream" -}, - "SkPicture_MakePlaceholder": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkPicture_Reference", - "name": "SkPicture::MakePlaceholder" }, "SkPicture_approximateBytesUsed": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n picture->playback(canvas);\n std::string opCount = \"approximate bytes used: \" + std::to_string(picture->approximateBytesUsed());\n canvas->drawString(opCount.c_str(), 20, 220, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "ececbda21218bd732394a305dba393a2", "file": "SkPicture_Reference", "name": "SkPicture::approximateBytesUsed" }, "SkPicture_approximateOpCount": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n picture->playback(canvas);\n std::string opCount = \"approximate op count: \" + std::to_string(picture->approximateOpCount());\n canvas->drawString(opCount.c_str(), 50, 220, SkPaint());\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "4b3d879118ef770d1f11a23c6493b2c4", "file": "SkPicture_Reference", "name": "SkPicture::approximateOpCount" }, "SkPicture_cullRect": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({64, 64, 192, 192});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n picture->playback(canvas);\n paint.setBlendMode(SkBlendMode::kModulate);\n paint.setColor(0x40404040);\n canvas->drawRect(picture->cullRect(), paint);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "15bb9a9596b40c5e2045f76e8c1dcf8e", "file": "SkPicture_Reference", "name": "SkPicture::cullRect" -}, - "SkPicture_destructor": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkPicture_Reference", - "name": "SkPicture::AbortCallback::~AbortCallback()" }, "SkPicture_playback": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n picture->playback(canvas);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "6b0ffb03ba05f526b345dc65a1c73fe4", "file": "SkPicture_Reference", "name": "SkPicture::playback()" }, "SkPicture_serialize": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n sk_sp readableData = picture->serialize();\n sk_sp copy = SkPicture::MakeFromData(readableData->data(), readableData->size());\n copy->playback(canvas);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "dacdebe1355c884ebd3c2ea038cc7a20", "file": "SkPicture_Reference", "name": "SkPicture::serialize()" }, "SkPicture_serialize_2": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkPictureRecorder recorder;\n SkCanvas* pictureCanvas = recorder.beginRecording({0, 0, 256, 256});\n SkPaint paint;\n pictureCanvas->drawRect(SkRect::MakeWH(200, 200), paint);\n paint.setColor(SK_ColorWHITE);\n pictureCanvas->drawRect(SkRect::MakeLTRB(20, 20, 180, 180), paint);\n sk_sp picture = recorder.finishRecordingAsPicture();\n SkDynamicMemoryWStream writableStream;\n picture->serialize(&writableStream);\n sk_sp readableData = writableStream.detachAsData();\n sk_sp copy = SkPicture::MakeFromData(readableData->data(), readableData->size());\n copy->playback(canvas);\n}", "width": 256, "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "hash": "30b9f1b310187db6aff720a5d67591e2", "file": "SkPicture_Reference", "name": "SkPicture::serialize_2" -}, - "SkPicture_uniqueID": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkPicture_Reference", - "name": "SkPicture::uniqueID" }, "SkPixmap_erase": { "code": "void draw(SkCanvas* canvas) {\n uint32_t storage[2];\n SkImageInfo info = SkImageInfo::MakeN32Premul(1, 2);\n SkPixmap pixmap(info, storage, info.minRowBytes());\n pixmap.erase(SK_ColorBLUE, {0, 0, 1, 1});\n pixmap.erase(SK_ColorRED, {0, 1, 1, 2});\n SkBitmap bitmap;\n canvas->scale(20, 20);\n bitmap.installPixels(pixmap);\n canvas->drawBitmap(bitmap, 0, 0);\n}", @@ -7658,26 +7640,26 @@ "name": "SkRRect::Type" }, "SkRRect_contains": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkRect test = {10, 10, 110, 80};\n SkRRect rrect = SkRRect::MakeRect(test);\n SkRRect oval = SkRRect::MakeOval(test);\n test.inset(10, 10);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(rrect.contains(test) ? \"contains\" : \"does not contain\", 55, 100, paint);\n canvas->drawString(oval.contains(test) ? \"contains\" : \"does not contain\", 185, 100, paint); \n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawRRect(rrect, paint);\n canvas->drawRect(test, paint);\n canvas->translate(120, 0);\n canvas->drawRRect(oval, paint);\n canvas->drawRect(test, paint);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 110, + "hash": "884447c809921cfaebc87aeb63dedd48", "file": "SkRRect_Reference", "name": "SkRRect::contains()" }, "SkRRect_copy_const_SkRRect": { "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({10, 10, 100, 50});\n SkRRect rrect2(rrect);\n rrect2.inset(20, 20);\n SkPaint p;\n p.setStyle(SkPaint::kStroke_Style);\n p.setStrokeWidth(10);\n canvas->drawRRect(rrect, p);\n canvas->drawRRect(rrect2, p);\n}", "width": 256, - "height": 256, - "hash": "9be9adb06c26dac75a5a5a7c1ceca681", + "height": 60, + "hash": "ad8f5d49edfcee60eddfe2a955b6c5f5", "file": "SkRRect_Reference", "name": "SkRRect::SkRRect(const SkRRect& rrect)" }, "SkRRect_copy_operator": { "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({40, 40, 100, 70});\n SkRRect rrect2 = rrect;\n rrect2.inset(-20, -20);\n SkPaint p;\n p.setStyle(SkPaint::kStroke_Style);\n p.setStrokeWidth(10);\n canvas->drawRRect(rrect, p);\n canvas->drawRRect(rrect2, p);\n}", "width": 256, - "height": 256, - "hash": "94c298c404fff922ec53a3d7567852a2", + "height": 110, + "hash": "52926c98c1cca00606d3ea99f23fea3d", "file": "SkRRect_Reference", "name": "SkRRect::operator=(const SkRRect& rrect)" }, @@ -7708,16 +7690,16 @@ "SkRRect_getSimpleRadii": { "code": "void draw(SkCanvas* canvas) {\n auto drawDetails = [=](const SkRRect& rrect) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(12);\n canvas->drawRRect(rrect, paint);\n SkVector corner = rrect.getSimpleRadii();\n std::string label = \"corner: \" + std::to_string(corner.fX).substr(0, 3) + \", \" +\n std::to_string(corner.fY).substr(0, 3);\n canvas->drawString(label.c_str(), 64, 90, paint);\n canvas->translate(128, 0);\n };\n SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});\n drawDetails(rrect);\n rrect.setRectXY(rrect.getBounds(), 5, 8);\n drawDetails(rrect);\n}", "width": 256, - "height": 256, - "hash": "f0e02101ecbdb5a2963ec82e7832afb1", + "height": 100, + "hash": "ebcc50ed30240e94de8439d21dd8171c", "file": "SkRRect_Reference", "name": "SkRRect::getSimpleRadii" }, "SkRRect_getType": { "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({10, 10, 100, 50});\n SkRRect rrect2(rrect);\n rrect2.inset(20, 20);\n SkPaint p;\n p.setStyle(SkPaint::kStroke_Style);\n p.setStrokeWidth(10);\n std::string str(\"Type \");\n str += SkRRect::kRect_Type == rrect2.getType() ? \"=\" : \"!\"; \n str += \"= SkRRect::kRect_Type\";\n canvas->drawString(str.c_str(), 20, 80, SkPaint());\n canvas->drawRRect(rrect2, p);\n}", "width": 256, - "height": 256, - "hash": "53634cc0794c0fa6c0c2b3ac4cc69490", + "height": 100, + "hash": "ace8f4aebf90527d43e4b7291375c9ad", "file": "SkRRect_Reference", "name": "SkRRect::getType" }, @@ -7740,8 +7722,8 @@ "SkRRect_isComplex": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n paint.setTextSize(16);\n SkVector radii[] = {{25, 30}, {40, 30}, {40, 30}, {20, 30}};\n SkRRect rrect;\n rrect.setRectRadii({30, 10, 100, 60}, radii);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isComplex() ? \"complex\" : \"not complex\", 64, 90, paint);\n radii[0].fX = 20;\n rrect.setRectRadii(rrect.getBounds(), radii);\n canvas->translate(128, 0);\n canvas->drawRRect(rrect, paint);\n canvas->drawString(rrect.isComplex() ? \"complex\" : \"not complex\", 64, 90, paint);\n}", "width": 256, - "height": 256, - "hash": "75db3f4e4757478bca641bccf89b9398", + "height": 100, + "hash": "e4ba9346ee5c2d37d5e504f8cc678544", "file": "SkRRect_Reference", "name": "SkRRect::isComplex" }, @@ -7786,20 +7768,12 @@ "name": "SkRRect::isSimple" }, "SkRRect_isValid": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({10, 10, 110, 80});\n SkRRect corrupt = rrect;\n *((float*) &corrupt) = 120;\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(rrect.isValid() ? \"is valid\" : \"is corrupted\", 55, 100, paint);\n canvas->drawString(corrupt.isValid() ? \"is valid\" : \"is corrupted\", 185, 100, paint); \n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawRRect(rrect, paint);\n canvas->translate(120, 0);\n canvas->drawRRect(corrupt, paint);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 110, + "hash": "d28709aa457742391842a9ab1f21b5fa", "file": "SkRRect_Reference", "name": "SkRRect::isValid" -}, - "SkRRect_kSizeInMemory": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", - "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", - "file": "SkRRect_Reference", - "name": "SkRRect::kSizeInMemory" }, "SkRRect_makeOffset": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setStyle(SkPaint::kStroke_Style);\n SkRRect rrect = SkRRect::MakeRectXY({100, 20, 140, 220}, 50, 100);\n for (int index = 0; index < 25; ++index) {\n canvas->drawRRect(rrect, paint);\n rrect = rrect.makeOffset(-3, 3);\n }\n}", @@ -7842,18 +7816,18 @@ "name": "SkRRect::outset_2" }, "SkRRect_readFromMemory": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkVector radii[] = {{5, 5}, {10, 10}, {15, 15}, {5, 5}};\n SkRRect rrect;\n rrect.setRectRadii({10, 10, 110, 80}, radii);\n char storage[SkRRect::kSizeInMemory];\n rrect.writeToMemory(storage);\n SkRRect copy;\n copy.readFromMemory(storage, sizeof(storage));\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"rrect\", 55, 100, paint);\n canvas->drawString(\"copy\", 185, 100, paint); \n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawRRect(rrect, paint);\n canvas->translate(120, 0);\n canvas->drawRRect(copy, paint);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 110, + "hash": "b877c0adff35470865a57aa150bf5329", "file": "SkRRect_Reference", "name": "SkRRect::readFromMemory" }, "SkRRect_setEmpty": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});\n canvas->drawRRect(rrect, paint);\n rrect.setEmpty();\n paint.setColor(SK_ColorBLUE);\n canvas->drawRRect(rrect, paint);\n}", "width": 256, - "height": 256, - "hash": "59c1025b8116ec1d3b55f4f6306d1e37", + "height": 80, + "hash": "44e9a9c2c5ef1af2a616086ff46a9037", "file": "SkRRect_Reference", "name": "SkRRect::setEmpty" }, @@ -7884,8 +7858,8 @@ "SkRRect_setRectRadii": { "code": "void draw(SkCanvas* canvas) {\n SkPaint paint;\n paint.setStrokeWidth(15);\n paint.setStrokeCap(SkPaint::kSquare_Cap);\n paint.setAntiAlias(true);\n float intervals[] = { 5, 21.75f };\n paint.setStyle(SkPaint::kStroke_Style);\n paint.setPathEffect(SkDashPathEffect::Make(intervals, SK_ARRAY_COUNT(intervals), 0));\n SkPath path;\n SkRRect rrect;\n SkVector corners[] = {{15, 17}, {17, 19}, {19, 15}, {15, 15}};\n rrect.setRectRadii({20, 20, 100, 100}, corners);\n path.addRRect(rrect, SkPath::kCW_Direction);\n canvas->drawPath(path, paint);\n path.rewind();\n path.addRRect(rrect, SkPath::kCCW_Direction, 1);\n canvas->translate(120, 0);\n canvas->drawPath(path, paint);\n}", "width": 256, - "height": 256, - "hash": "4589dd49da291f8cd414db96c12851c7", + "height": 128, + "hash": "340d6c51efaa1f7f3d0dcaf8b0e90696", "file": "SkRRect_Reference", "name": "SkRRect::setRectRadii" }, @@ -7898,26 +7872,26 @@ "name": "SkRRect::setRectXY" }, "SkRRect_transform": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkVector radii[] = {{5, 5}, {10, 10}, {15, 15}, {5, 5}};\n SkRRect rrect;\n rrect.setRectRadii({10, 10, 110, 80}, radii);\n SkRRect transformed;\n SkMatrix matrix = SkMatrix::MakeRectToRect(rrect.rect(), {140, 30, 220, 80},\n SkMatrix::kCenter_ScaleToFit);\n bool success = rrect.transform(matrix, &transformed);\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"rrect\", 55, 100, paint);\n canvas->drawString(success ? \"transformed\" : \"transform failed\", 185, 100, paint); \n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawRRect(rrect, paint);\n canvas->drawRRect(transformed, paint);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 110, + "hash": "99ccc6862bb9fe3ca35228eee9f9725d", "file": "SkRRect_Reference", "name": "SkRRect::transform()" }, "SkRRect_type": { "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({10, 10, 100, 50});\n SkRRect rrect2(rrect);\n rrect2.inset(20, 20);\n SkPaint p;\n p.setStyle(SkPaint::kStroke_Style);\n p.setStrokeWidth(10);\n std::string str(\"Type \");\n str += SkRRect::kEmpty_Type == rrect2.type() ? \"=\" : \"!\"; \n str += \"= SkRRect::kEmpty_Type\";\n canvas->drawString(str.c_str(), 20, 80, SkPaint());\n canvas->drawRRect(rrect2, p);\n}", "width": 256, - "height": 256, - "hash": "02b03d651c4b5d18018c6f75fa88b8ce", + "height": 100, + "hash": "1080805c8449406a4e26d694bc56d2dc", "file": "SkRRect_Reference", "name": "SkRRect::type()" }, "SkRRect_writeToMemory": { - "code": "void draw(SkCanvas* canvas) {\n // incomplete\n}", + "code": "void draw(SkCanvas* canvas) {\n SkRRect rrect = SkRRect::MakeRect({10, 10, 110, 80});\n char storage[SkRRect::kSizeInMemory];\n rrect.writeToMemory(storage);\n SkRRect copy;\n copy.readFromMemory(storage, sizeof(storage));\n SkPaint paint;\n paint.setAntiAlias(true);\n paint.setTextAlign(SkPaint::kCenter_Align);\n canvas->drawString(\"rrect\", 55, 100, paint);\n canvas->drawString(\"copy\", 185, 100, paint); \n paint.setStyle(SkPaint::kStroke_Style);\n canvas->drawRRect(rrect, paint);\n canvas->translate(120, 0);\n canvas->drawRRect(copy, paint);\n}", "width": 256, - "height": 256, - "hash": "882e8e0103048009a25cfc20400492f7", + "height": 110, + "hash": "1466c844a78fd05a7362537347e360ca", "file": "SkRRect_Reference", "name": "SkRRect::writeToMemory" }, diff --git a/site/user/api/index.md b/site/user/api/index.md index 1e116e721d..bfb0493c93 100644 --- a/site/user/api/index.md +++ b/site/user/api/index.md @@ -7,7 +7,10 @@ Full references with examples are available for: * [SkAutoCanvasRestore](/user/api/SkAutoCanvasRestore_Reference) - Canvas save stack manager * [SkBitmap](/user/api/SkBitmap_Reference) - two-dimensional raster pixel array +* [SkBlendMode](/user/api/SkBlendMode_Reference) - pixel color arithmetic * [SkCanvas](/user/api/SkCanvas_Reference) - drawing context +* [SkColor](/user/api/SkColor_Reference) - color encoding using integer numbers +* [SkColor4f](/user/api/SkColor4f_Reference) - color encoding using floating point numbers * [SkImage](/user/api/SkImage_Reference) - two dimensional array of pixels to draw * [SkImageInfo](/user/api/SkImageInfo_Reference) - pixel dimensions and characteristics * [SkIPoint](/user/api/SkIPoint_Reference) - two integer coordinates @@ -16,8 +19,10 @@ Full references with examples are available for: * [SkMatrix](/user/api/SkMatrix_Reference) - 3x3 transformation matrix * [SkPaint](/user/api/SkPaint_Reference) - color, stroke, font, effects * [SkPath](/user/api/SkPath_Reference) - sequence of connected lines and curves +* [SkPicture](/user/api/SkPicture_Reference) - sequence of drawing commands * [SkPixmap](/user/api/SkPixmap_Reference) - pixel map: image info and pixel address * [SkPoint](/user/api/SkPoint_Reference) - two floating point coordinates +* [SkRRect](/user/api/SkRRect_Reference) - floating point rounded rectangle * [SkRect](/user/api/SkRect_Reference) - floating point rectangle * [SkSurface](/user/api/SkSurface_Reference) - drawing destination diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index 26e9795b37..45e5551cb2 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -284,16 +284,12 @@ void flush() ## ArcTo -# HTML DarkGray - # HTML Fuchsia # HTML Gray # HTML Green -# HTML LightGray - # HTML Lime # HTML Silver diff --git a/site/user/api/usingBookmaker.md b/site/user/api/usingBookmaker.md index 348d1c6704..684e906ed5 100644 --- a/site/user/api/usingBookmaker.md +++ b/site/user/api/usingBookmaker.md @@ -100,6 +100,12 @@ which will be ignored. ## Installing Install Go if needed. +Check the version. The resuls should be 1.10 or greater. + +
+$ go version
+
+ Get the fiddle command line interface tool. By default this will appear in your home directory. -- cgit v1.2.3
dst