diff options
author | Cary Clark <caryclark@skia.org> | 2017-09-01 13:39:19 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-01 18:19:37 +0000 |
commit | da65a0489ae429f026bad32c9a0ef2010f40e175 (patch) | |
tree | ae2b1e2b6350f120574aab8a51869de33b0a0ead /site | |
parent | dbb24efcc5f224a0d9a73ad9b200daf8013df0a1 (diff) |
wip spelling mania
Work on spell-checker
to identify errors and
isolate more concepts
requiring definitions.
Docs-Preview: https://skia.org/?cl=41180
TBR: reed@google.com
Bug: skia: 6898
Change-Id: I0759beb42eaf6095908a9bd7decfcd0026253609
Reviewed-on: https://skia-review.googlesource.com/41180
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'site')
-rw-r--r-- | site/user/api/SkCanvas_Reference.md | 677 | ||||
-rw-r--r-- | site/user/api/SkPaint_Reference.md | 282 | ||||
-rw-r--r-- | site/user/api/SkPath_Reference.md | 135 | ||||
-rw-r--r-- | site/user/api/undocumented.md | 32 | ||||
-rw-r--r-- | site/user/api/usingBookmaker.md | 4 |
5 files changed, 579 insertions, 551 deletions
diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md index a4a83ddfc3..1848816aff 100644 --- a/site/user/api/SkCanvas_Reference.md +++ b/site/user/api/SkCanvas_Reference.md @@ -17,7 +17,7 @@ Request <a href="#Canvas">Canvas</a> from <a href="undocumented#Surface">Surface <a href="#Canvas">Canvas</a> generated by <a href="undocumented#GPU_Surface">GPU Surface</a> uses <a href="undocumented#Vulkan">Vulkan</a> or <a href="undocumented#OpenGL">OpenGL</a> to draw to the <a href="undocumented#GPU">GPU</a>. To draw to a document, obtain <a href="#Canvas">Canvas</a> from <a href="#Canvas">SVG Canvas</a>, <a href="#PDF">Document PDF</a>, or <a href="#Recorder">Picture Recorder</a>. -Document-based <a href="#Canvas">Canvas</a> and other <a href="#Canvas">Canvas</a> subclasses reference <a href="undocumented#Device">Device</a> describing the +<a href="undocumented#Document">Document</a> based <a href="#Canvas">Canvas</a> and other <a href="#Canvas">Canvas</a> <a href="undocumented#Subclasses">Subclasses</a> reference <a href="undocumented#Device">Device</a> describing the destination. <a href="#Canvas">Canvas</a> can be constructed to draw to <a href="undocumented#Bitmap">Bitmap</a> without first creating <a href="undocumented#Raster_Surface">Raster Surface</a>. @@ -46,7 +46,7 @@ This approach may be deprecated in the future. | struct | description | | --- | --- | | <a href="#SkCanvas_Lattice">Lattice</a> | Divides <a href="undocumented#Bitmap">Bitmap</a>, <a href="undocumented#Image">Image</a> into a rectangular grid. | -| <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> | Contains state to create the layer offscreen. | +| <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> | Contains state to create <a href="#Layer">Layer</a>. | ## <a name="Constructors"></a> Constructors @@ -95,7 +95,7 @@ when no <a href="undocumented#Surface">Surface</a> is required, and some helpers | <a href="#SkCanvas_drawLine">drawLine</a> | Draws line segment between two points. | | <a href="#SkCanvas_drawOval">drawOval</a> | Draws <a href="undocumented#Oval">Oval</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. | | <a href="#SkCanvas_drawPaint">drawPaint</a> | Fills <a href="#Clip">Clip</a> with <a href="SkPaint_Reference#Paint">Paint</a>. | -| <a href="#SkCanvas_drawPatch">drawPatch</a> | Draws cubic <a href="undocumented#Coons">Coons</a> patch. | +| <a href="#SkCanvas_drawPatch">drawPatch</a> | Draws <a href="undocumented#Coons">Coons</a> patch. | | <a href="#SkCanvas_drawPath">drawPath</a> | Draws <a href="SkPath_Reference#Path">Path</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. | | <a href="#SkCanvas_drawPicture">drawPicture</a> | Draws <a href="undocumented#Picture">Picture</a> using <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>. | | <a href="#SkCanvas_drawPoint">drawPoint</a> | Draws point at (x, y) position. | @@ -114,7 +114,7 @@ when no <a href="undocumented#Surface">Surface</a> is required, and some helpers | <a href="#SkCanvas_drawString">drawString</a> | Draws null terminated string at (x, y) using font advance. | | <a href="#SkCanvas_drawVertices">drawVertices</a> | Draws <a href="undocumented#Vertices">Vertices</a>, a triangle mesh. | | <a href="#SkCanvas_flush">flush</a> | Triggers execution of all pending draw operations. | -| <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> | Gets size of base layer in global coordinates. | +| <a href="#SkCanvas_getBaseLayerSize">getBaseLayerSize</a> | Gets size of base <a href="#Layer">Layer</a> in global coordinates. | | <a href="#SkCanvas_getDeviceClipBounds">getDeviceClipBounds</a> | Returns <a href="undocumented#IRect">IRect</a> bounds of <a href="#Clip">Clip</a>. | | <a href="#SkCanvas_getDrawFilter">getDrawFilter</a> | Legacy; to be deprecated. | | <a href="#SkCanvas_getGrContext">getGrContext</a> | Returns <a href="undocumented#GPU_Context">GPU Context</a> of the <a href="undocumented#GPU_Surface">GPU Surface</a>. | @@ -137,15 +137,14 @@ when no <a href="undocumented#Surface">Surface</a> is required, and some helpers | <a href="#SkCanvas_restoreToCount">restoreToCount</a> | Restores changes to <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> to given depth. | | <a href="#SkCanvas_rotate">rotate</a> | Rotates <a href="#Matrix">Matrix</a>. | | <a href="#SkCanvas_save">save</a> | Saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack. | -| <a href="#SkCanvas_saveLayer">saveLayer</a> | Saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates offscreen. | -| <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> | Saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates offscreen; sets opacity. | -| <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> | Saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates offscreen for <a href="undocumented#LCD">LCD</a> text. | +| <a href="#SkCanvas_saveLayer">saveLayer</a> | Saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates <a href="#Layer">Layer</a>. | +| <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> | Saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates <a href="#Layer">Layer</a>; sets opacity. | +| <a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a> | Saves <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a> on stack; creates <a href="#Layer">Layer</a> for <a href="undocumented#LCD">LCD</a> text. | | <a href="#SkCanvas_scale">scale</a> | Scales <a href="#Matrix">Matrix</a>. | | <a href="#SkCanvas_setAllowSimplifyClip">setAllowSimplifyClip</a> | Experimental. | | <a href="#SkCanvas_setDrawFilter">setDrawFilter</a> | Legacy; to be deprecated. | | <a href="#SkCanvas_setMatrix">setMatrix</a> | Sets <a href="#Matrix">Matrix</a>. | -| <a href="#SkCanvas_skew">skew</a> | Skews <a href="#Matrix">Matrix</a>. | -| <a href="#SkCanvas_translate">translate</a> | Translates <a href="#Matrix">Matrix</a>. | +| <a href="#SkCanvas_skew">skew</a> | Skews <a href="#Matrix">Matrix</a>. | <a href="#SkCanvas_translate">translate</a> | Translates <a href="#Matrix">Matrix</a>. | | <a href="#SkCanvas_writePixels">writePixels</a> | Copies and converts rectangle of pixels to <a href="#Canvas">Canvas</a>. | <a name="SkCanvas_MakeRasterDirect"></a> @@ -190,7 +189,7 @@ interval from one <a href="undocumented#Surface">Surface</a> row to the next, or ### Example -<div><fiddle-embed name="30839f66c2d267e021d0cabb81ef1123"><div>Allocates a three by three bitmap, clears it to white, and draws a black pixel +<div><fiddle-embed name="11be884b8b4213a450b6dc43673bf807"><div>Allocates a three by three bitmap, clears it to white, and draws a black pixel in the center.</div> #### Example Output @@ -230,7 +229,7 @@ Valid parameters include: <a href="#SkCanvas_MakeRasterDirectN32_pixels">pixels</a> is not nullptr; <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> is zero or large enough to contain <a href="#SkCanvas_MakeRasterDirectN32_width">width</a> <a href="#SkCanvas_MakeRasterDirectN32_pixels">pixels</a> of <a href="undocumented#SkColorType">kN32 SkColorType</a>. -Pass zero for <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> to compute <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> from fo <a href="#SkCanvas_MakeRasterDirectN32_width">width</a> and size of pixel. +Pass zero for <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> to compute <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> from <a href="#SkCanvas_MakeRasterDirectN32_width">width</a> and size of pixel. If <a href="#SkCanvas_MakeRasterDirectN32_rowBytes">rowBytes</a> is greater than zero, it must be equal to or greater than <a href="#SkCanvas_MakeRasterDirectN32_width">width</a> times bytes required for <a href="#Color_Type">Image Color Type</a>. @@ -256,7 +255,7 @@ interval from one <a href="undocumented#Surface">Surface</a> row to the next, or ### Example -<div><fiddle-embed name="bc8d576bf09358cf0e972b72efba936c"><div>Allocates a three by three bitmap, clears it to white, and draws a black pixel +<div><fiddle-embed name="93010950fe3540f7427d8ff82dc5562a"><div>Allocates a three by three bitmap, clears it to white, and draws a black pixel in the center.</div> #### Example Output @@ -309,7 +308,7 @@ SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr) </pre> Creates <a href="#Canvas">Canvas</a> of the specified dimensions without a <a href="undocumented#Surface">Surface</a>. -Used by subclasses with custom implementations for draw methods. +Used by <a href="undocumented#Subclasses">Subclasses</a> with custom implementations for draw methods. If <a href="#SkCanvas_int_int_const_SkSurfaceProps_star_props">props</a> equals nullptr, <a href="#Properties">Surface Properties</a> are created with <a href="#Properties_Legacy_Font_Host">Surface Properties Legacy Font Host</a> settings, which choose the pixel striping direction and order. Since a platform may dynamically @@ -407,7 +406,7 @@ storage of <a href="undocumented#Raster_Surface">Raster Surface</a></td> ### Example -<div><fiddle-embed name="cc6d6fd6d9aa98b12984e11ef52172ec"><div>The actual output depends on the installed fonts.</div> +<div><fiddle-embed name="93082df2fb33ca62202dc047532b3861"><div>The actual output depends on the installed fonts.</div> #### Example Output @@ -497,7 +496,7 @@ device independent fonts</td> ### Example -<div><fiddle-embed name="5ddec03684bb09f94b016dc205cb173b"><div>The actual output depends on the installed fonts.</div> +<div><fiddle-embed name="216c9cd6ec6a8fa48135d792a7003572"><div>The actual output depends on the installed fonts.</div> #### Example Output @@ -526,14 +525,14 @@ device independent fonts</td> virtual ~SkCanvas() </pre> -Draw saved layers, if any. +Draw saved <a href="#Layer">Layers</a>, if any. Free up resources used by <a href="#Canvas">Canvas</a>. ### Example -<div><fiddle-embed name="b7bc91ff16c9b9351b2a127f35394b82"><div><a href="#Canvas">Canvas</a> offscreen draws into bitmap. <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> sets up an additional -drawing surface that blends with the bitmap. When offscreen goes out of -scope, offscreen destructor is called. The saved layer is restored, drawing +<div><fiddle-embed name="b7bc91ff16c9b9351b2a127f35394b82"><div><a href="#Canvas">Canvas</a> <a href="#Layer">Layer</a> draws into bitmap. <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> sets up an additional +drawing surface that blends with the bitmap. When <a href="#Layer">Layer</a> goes out of +scope, <a href="#Layer">Layer</a> <a href="undocumented#Destructor">Destructor</a> is called. The saved <a href="#Layer">Layer</a> is restored, drawing transparent letters.</div></fiddle-embed></div> ### See Also @@ -660,13 +659,13 @@ If <a href="#Canvas">Canvas</a> is associated with <a href="undocumented#GPU_Sur virtual SkISize getBaseLayerSize() const </pre> -Gets the size of the base or root layer in global canvas coordinates. The -origin of the base layer is always (0,0). The current drawable area may be +Gets the size of the base or root <a href="#Layer">Layer</a> in global canvas coordinates. The +origin of the base <a href="#Layer">Layer</a> is always (0,0). The area available for drawing may be smaller (due to clipping or <a href="#SkCanvas_saveLayer">saveLayer</a>). ### Return Value -integral width and height of base layer +integral width and height of base <a href="#Layer">Layer</a> ### Example @@ -766,7 +765,7 @@ storage for writable pixels' <a href="#Info">Image Info</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_accessTopLayerPixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td> storage for writable pixels' row bytes; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_accessTopLayerPixels_origin"> <code><strong>origin </strong></code> </a></td> <td> -storage for <a href="#Canvas">Canvas</a> top layer <a href="#SkCanvas_accessTopLayerPixels_origin">origin</a>, its top left corner; +storage for <a href="#Canvas">Canvas</a> top <a href="#Layer">Layer</a> <a href="#SkCanvas_accessTopLayerPixels_origin">origin</a>, its top left corner; may be nullptr</td> </tr> </table> @@ -781,11 +780,11 @@ address of pixels, or nullptr if inaccessible ### Example -<div><fiddle-embed name="a7ac9c21bbabcdeeca00f72a61cd0f3e"><div>Draws "" on the device. Then draws "" in an offscreen layer, and reads the -offscreen to add a large dotted "". Finally blends the offscreen with the +<div><fiddle-embed name="a7ac9c21bbabcdeeca00f72a61cd0f3e"><div>Draws "" on the device. Then draws "" in <a href="#Layer">Layer</a>, and reads +<a href="#Layer">Layer</a> to add a large dotted "". Finally blends <a href="#Layer">Layer</a> with the device. -The offscreen and blended result appear on the <a href="undocumented#CPU">CPU</a> and <a href="undocumented#GPU">GPU</a> but the large dotted +The <a href="#Layer">Layer</a> and blended result appear on the <a href="undocumented#CPU">CPU</a> and <a href="undocumented#GPU">GPU</a> but the large dotted "" appear only on the <a href="undocumented#CPU">CPU</a>.</div></fiddle-embed></div> --- @@ -800,13 +799,13 @@ SkRasterHandleAllocator::Handle accessTopRasterHandle() const Returns custom context that tracks the <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a>. Use <a href="undocumented#Raster_Handle_Allocator">Raster Handle Allocator</a> to blend <a href="undocumented#Skia">Skia</a> drawing with custom drawing, typically performed -by the host platform's user interface. This accessor returns the custom context generated by +by the host platform's user interface. The custom context returned is generated by <a href="#SkRasterHandleAllocator_MakeCanvas">SkRasterHandleAllocator::MakeCanvas</a>, which creates a custom canvas with raster storage for the drawing destination. ### Return Value -context of custom allocator +context of custom allocation ### Example @@ -878,9 +877,8 @@ bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, </pre> Copies rectangle of pixels from <a href="#Canvas">Canvas</a> into <a href="#SkCanvas_readPixels_dstPixels">dstPixels</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are -ignored. Source rectangle corners are (<a href="#SkCanvas_readPixels_srcX">srcX</a>, <a href="#SkCanvas_readPixels_srcY">srcY</a>) and -(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). -Destination rectangle corners are (0, 0) and (<a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.width(), <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.height()). +ignored. Source rectangle corners are (<a href="#SkCanvas_readPixels_srcX">srcX</a>, <a href="#SkCanvas_readPixels_srcY">srcY</a>) and(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). +Destination rectangle corners are (0, 0) and(<a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.width(), <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, converting to <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.colorType() and <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.alphaType() if required. @@ -929,15 +927,15 @@ true if pixels were copied <div><fiddle-embed name="2964297993747769b0760874c19e0168"><div>A black circle drawn on a blue background provides an image to copy. <a href="#SkCanvas_readPixels">readPixels</a> copies one quarter of the canvas into each of the four corners. -The offscreen draws over the image.</div></fiddle-embed></div> +The <a href="#Layer">Layer</a> draws over the image.</div></fiddle-embed></div> ### Example -<div><fiddle-embed name="481e990e923a0ed34654f4361b94f096"><div><a href="#Canvas">Canvas</a> returned by <a href="undocumented#Raster_Surface">Raster Surface</a> has premultiplied pixel values. -<a href="#SkCanvas_clear">clear</a> takes unpremultiplied input with <a href="#Alpha">Color Alpha</a> equal 0x80 -and <a href="#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="#RGB">Color RGB</a> is multipled by <a href="#Alpha">Color Alpha</a> -to generate premultipled value 0x802B5580. <a href="#SkCanvas_readPixels">readPixels</a> converts pixel back -to unpremultipled value 0x8056A9FF, introducing error.</div> +<div><fiddle-embed name="481e990e923a0ed34654f4361b94f096"><div><a href="#Canvas">Canvas</a> returned by <a href="undocumented#Raster_Surface">Raster Surface</a> has <a href="#Premultiply">Premultiplied</a> pixel values. +<a href="#SkCanvas_clear">clear</a> takes <a href="#Unpremultiply">Unpremultiplied</a> input with <a href="#Alpha">Color Alpha</a> equal 0x80 +and <a href="#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="#RGB">Color RGB</a> is multiplied by <a href="#Alpha">Color Alpha</a> +to generate <a href="#Premultiply">Premultiplied</a> value 0x802B5580. <a href="#SkCanvas_readPixels">readPixels</a> converts pixel back +to <a href="#Unpremultiply">Unpremultiplied</a> value 0x8056A9FF, introducing error.</div> #### Example Output @@ -959,9 +957,8 @@ bool readPixels(const SkPixmap& pixmap, int srcX, int srcY) </pre> Copies rectangle of pixels from <a href="#Canvas">Canvas</a> into <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are -ignored. Source rectangle corners are (<a href="#SkCanvas_readPixels_2_srcX">srcX</a>, <a href="#SkCanvas_readPixels_2_srcY">srcY</a>) and -(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). -Destination rectangle are (0, 0) and (<a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.width(), <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.height()). +ignored. Source rectangle corners are (<a href="#SkCanvas_readPixels_2_srcX">srcX</a>, <a href="#SkCanvas_readPixels_2_srcY">srcY</a>) and(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). +Destination rectangle are (0, 0) and(<a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.width(), <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, converting to <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.colorType() and <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.alphaType() if required. @@ -1005,9 +1002,9 @@ true if pixels were copied ### Example -<div><fiddle-embed name="85f199032943b6483722c34a91c4e20f"><div><a href="#SkCanvas_clear">clear</a> takes unpremultiplied input with <a href="#Alpha">Color Alpha</a> equal 0x80 -and <a href="#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="#RGB">Color RGB</a> is multipled by <a href="#Alpha">Color Alpha</a> -to generate premultipled value 0x802B5580.</div> +<div><fiddle-embed name="85f199032943b6483722c34a91c4e20f"><div><a href="#SkCanvas_clear">clear</a> takes <a href="#Unpremultiply">Unpremultiplied</a> input with <a href="#Alpha">Color Alpha</a> equal 0x80 +and <a href="#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="#RGB">Color RGB</a> is multiplied by <a href="#Alpha">Color Alpha</a> +to generate <a href="#Premultiply">Premultiplied</a> value 0x802B5580.</div> #### Example Output @@ -1028,8 +1025,7 @@ bool readPixels(const SkBitmap& bitmap, int srcX, int srcY) </pre> Copies rectangle of pixels from <a href="#Canvas">Canvas</a> into <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are -ignored. Source rectangle corners are (<a href="#SkCanvas_readPixels_3_srcX">srcX</a>, <a href="#SkCanvas_readPixels_3_srcY">srcY</a>) and -(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). +ignored. Source rectangle corners are (<a href="#SkCanvas_readPixels_3_srcX">srcX</a>, <a href="#SkCanvas_readPixels_3_srcY">srcY</a>) and(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). Destination rectangle corners are (0, 0) and (<a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.width(), <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.height()). Copies each readable pixel intersecting both rectangles, without scaling, converting to <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.colorType() and <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.alphaType() if required. @@ -1074,9 +1070,9 @@ true if pixels were copied ### Example -<div><fiddle-embed name="af6dec8ef974aa67bf102f29915bcd6a"><div><a href="#SkCanvas_clear">clear</a> takes unpremultiplied input with <a href="#Alpha">Color Alpha</a> equal 0x80 -and <a href="#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="#RGB">Color RGB</a> is multipled by <a href="#Alpha">Color Alpha</a> -to generate premultipled value 0x802B5580.</div> +<div><fiddle-embed name="af6dec8ef974aa67bf102f29915bcd6a"><div><a href="#SkCanvas_clear">clear</a> takes <a href="#Unpremultiply">Unpremultiplied</a> input with <a href="#Alpha">Color Alpha</a> equal 0x80 +and <a href="#RGB">Color RGB</a> equal 0x55, 0xAA, 0xFF. <a href="#RGB">Color RGB</a> is multiplied by <a href="#Alpha">Color Alpha</a> +to generate <a href="#Premultiply">Premultiplied</a> value 0x802B5580.</div> #### Example Output @@ -1102,10 +1098,9 @@ bool writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes, Copies rectangle from <a href="#SkCanvas_writePixels_pixels">pixels</a> to <a href="#Canvas">Canvas</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are ignored. Source rectangle corners are (0, 0) and (<a href="#SkCanvas_writePixels_info">info</a>.width(), <a href="#SkCanvas_writePixels_info">info</a>.height()). -Destination rectangle corners are (<a href="#SkCanvas_writePixels_x">x</a>, <a href="#SkCanvas_writePixels_y">y</a>) and -(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). Copies each readable pixel -intersecting both rectangles, without scaling, converting to -this-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() and this-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType() if required. +Destination rectangle corners are (<a href="#SkCanvas_writePixels_x">x</a>, <a href="#SkCanvas_writePixels_y">y</a>) and(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). +Copies each readable pixel +intersecting both rectangles, without scaling, converting tothis-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType()andthis-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType()if required. Pixels are writable when <a href="undocumented#Device">Device</a> is raster, or backed by a <a href="undocumented#GPU">GPU</a>. Pixels are not writable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="#SkDocument_beginPage">SkDocument::beginPage</a>, @@ -1123,7 +1118,7 @@ Does not copy, and returns false if: <table> <tr> <td>Source and destination rectangles do not intersect.</td> </tr> <tr> - <td><a href="#SkCanvas_writePixels_pixels">pixels</a> could not be converted to this-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() or this-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType().</td> </tr> <tr> + <td><a href="#SkCanvas_writePixels_pixels">pixels</a> could not be converted tothis-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType()orthis-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType().</td> </tr> <tr> <td><a href="#Canvas">Canvas</a> <a href="#SkCanvas_writePixels_pixels">pixels</a> are not writable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr> <td><a href="#SkCanvas_writePixels_rowBytes">rowBytes</a> is too small to contain one row of <a href="#SkCanvas_writePixels_pixels">pixels</a>.</td> </tr> </table> @@ -1162,11 +1157,11 @@ bool writePixels(const SkBitmap& bitmap, int x, int y) </pre> Copies rectangle from pixels to <a href="#Canvas">Canvas</a>. <a href="#Matrix">Matrix</a> and <a href="#Clip">Clip</a> are ignored. -Source rectangle corners are (0, 0) and (<a href="#SkCanvas_writePixels_2_bitmap">bitmap</a>.width(), <a href="#SkCanvas_writePixels_2_bitmap">bitmap</a>.height()). -Destination rectangle corners are (<a href="#SkCanvas_writePixels_2_x">x</a>, <a href="#SkCanvas_writePixels_2_y">y</a>) and -(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). Copies each readable pixel -intersecting both rectangles, without scaling, converting to -this-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() and this-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType() if required. +Source rectangle corners are (0, 0) and(<a href="#SkCanvas_writePixels_2_bitmap">bitmap</a>.width(), <a href="#SkCanvas_writePixels_2_bitmap">bitmap</a>.height()). + +Destination rectangle corners are (<a href="#SkCanvas_writePixels_2_x">x</a>, <a href="#SkCanvas_writePixels_2_y">y</a>) and(this-><a href="#SkCanvas_imageInfo">imageInfo</a>.width(), this-><a href="#SkCanvas_imageInfo">imageInfo</a>.height()). +Copies each readable pixel +intersecting both rectangles, without scaling, converting tothis-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType()andthis-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType()if required. Pixels are writable when <a href="undocumented#Device">Device</a> is raster, or backed by a <a href="undocumented#GPU">GPU</a>. Pixels are not writable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="#SkDocument_beginPage">SkDocument::beginPage</a>, @@ -1185,8 +1180,8 @@ Does not copy, and returns false if: <table> <tr> <td>Source and destination rectangles do not intersect.</td> </tr> <tr> <td><a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> does not have allocated pixels.</td> </tr> <tr> - <td><a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> pixels could not be converted to this-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() or this-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType().</td> </tr> <tr> - <td><a href="#Canvas">Canvas</a> pixels are not writable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr> + <td><a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> pixels could not be converted tothis-><a href="#SkCanvas_imageInfo">imageInfo</a>.colorType()orthis-><a href="#SkCanvas_imageInfo">imageInfo</a>.alphaType().</td> </tr> <tr> + <td><a href="#Canvas">Canvas</a> pixels are not writable; for instance, <a href="#Canvas">Canvas</a> is document based.</td> </tr> <tr> <td><a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> pixels are inaccessible; for instance, <a href="#SkCanvas_writePixels_2_bitmap">bitmap</a> wraps a texture.</td> </tr> </table> @@ -1278,16 +1273,100 @@ the red square is not translated, and is drawn at the origin.</div></fiddle-embe --- -## <a name="Layer"></a> Layer +<a name="SkCanvas_restore"></a> +## restore + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void restore() +</pre> + +Removes changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> since <a href="#Canvas">Canvas</a> state was +last saved. The state is removed from the stack. + +Does nothing if the stack is empty. + +### Example + +<div><fiddle-embed name="e78471212a67f2f4fd39496e17a30d17"></fiddle-embed></div> + +--- + +<a name="SkCanvas_getSaveCount"></a> +## getSaveCount + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +int getSaveCount() const +</pre> + +Returns the number of saved states, each containing: <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>. +Equals the number of <a href="#SkCanvas_save">save</a> calls less the number of <a href="#SkCanvas_restore">restore</a> calls plus one. +The <a href="#SkCanvas_save">save</a> count of a new canvas is one. + +### Return Value + +depth of <a href="#SkCanvas_save">save</a> state stack + +### Example + +<div><fiddle-embed name="005f2b207e078baac596681924fe591e"> + +#### Example Output + +~~~~ +depth = 1 +depth = 2 +depth = 1 +~~~~ + +</fiddle-embed></div> + +--- + +<a name="SkCanvas_restoreToCount"></a> +## restoreToCount + +<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> +void restoreToCount(int saveCount) +</pre> + +Restores state to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> values when <a href="#SkCanvas_save">save</a>, <a href="#SkCanvas_saveLayer">saveLayer</a>, +<a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a>, or <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> returned <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a>. -<a href="#State_Stack_Layer">Layer</a> allocates a temporary offscreen <a href="undocumented#Bitmap">Bitmap</a> to draw into. When the drawing is +Does nothing if <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a> is greater than state stack count. +Restores state to initial values if <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a> is less than or equal to one. + +### Parameters + +<table> <tr> <td><a name="SkCanvas_restoreToCount_saveCount"> <code><strong>saveCount </strong></code> </a></td> <td> +depth of state stack to <a href="#SkCanvas_restore">restore</a></td> + </tr> +</table> + +### Example + +<div><fiddle-embed name="9ed0d56436e114c7097fd49eed1aea47"> + +#### Example Output + +~~~~ +depth = 1 +depth = 3 +depth = 1 +~~~~ + +</fiddle-embed></div> + +--- + +# <a name="Layer"></a> Layer +<a href="#Layer">Layer</a> allocates a temporary <a href="undocumented#Bitmap">Bitmap</a> to draw into. When the drawing is complete, the <a href="undocumented#Bitmap">Bitmap</a> is drawn into the <a href="#Canvas">Canvas</a>. -<a href="#State_Stack_Layer">Layer</a> is saved in a stack along with other saved state. When state with a <a href="#State_Stack_Layer">Layer</a> -is restored, the offscreen <a href="undocumented#Bitmap">Bitmap</a> is drawn into the previous layer. +<a href="#Layer">Layer</a> is saved in a stack along with other saved state. When state with a <a href="#Layer">Layer</a> +is restored, the <a href="undocumented#Bitmap">Bitmap</a> is drawn into the previous <a href="#Layer">Layer</a>. -<a href="#State_Stack_Layer">Layer</a> may be initialized with the contents of the previous layer. When <a href="#State_Stack_Layer">Layer</a> is -restored, its <a href="undocumented#Bitmap">Bitmap</a> can be modified by <a href="SkPaint_Reference#Paint">Paint</a> passed to <a href="#State_Stack_Layer">Layer</a> to apply +<a href="#Layer">Layer</a> may be initialized with the contents of the previous <a href="#Layer">Layer</a>. When <a href="#Layer">Layer</a> is +restored, its <a href="undocumented#Bitmap">Bitmap</a> can be modified by <a href="SkPaint_Reference#Paint">Paint</a> passed to <a href="#Layer">Layer</a> to apply <a href="#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Blend_Mode">Blend Mode</a>. <a name="SkCanvas_saveLayer"></a> @@ -1298,15 +1377,15 @@ int saveLayer(const SkRect* bounds, const SkPaint* paint) </pre> Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates an offscreen <a href="undocumented#Bitmap">Bitmap</a> for subsequent drawing. +and allocates a <a href="undocumented#Bitmap">Bitmap</a> for subsequent drawing. Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and draws the offscreen bitmap. +and draws the <a href="undocumented#Bitmap">Bitmap</a>. <a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, <a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. -<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayer_bounds">bounds</a> suggests but does not define the offscreen size. To clip drawing to +<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayer_bounds">bounds</a> suggests but does not define the <a href="undocumented#Bitmap">Bitmap</a> size. To clip drawing to a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. Optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_saveLayer_paint">paint</a> applies <a href="#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and @@ -1317,9 +1396,9 @@ Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value t ### Parameters <table> <tr> <td><a name="SkCanvas_saveLayer_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of the offscreen; may be nullptr</td> +hint to limit the size of the <a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_saveLayer_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state for offscreen; may be nullptr</td> +graphics state for <a href="#Layer">Layer</a>; may be nullptr</td> </tr> </table> @@ -1329,7 +1408,7 @@ depth of saved stack ### Example -<div><fiddle-embed name="05f9b6fa6b5007aea89dfe66c306855d"><div>Rectangles are blurred by <a href="undocumented#Image_Filter">Image Filter</a> when <a href="#SkCanvas_restore">restore</a> draws offscreen to main +<div><fiddle-embed name="05f9b6fa6b5007aea89dfe66c306855d"><div>Rectangles are blurred by <a href="undocumented#Image_Filter">Image Filter</a> when <a href="#SkCanvas_restore">restore</a> draws <a href="#Layer">Layer</a> to main <a href="#Canvas">Canvas</a>.</div></fiddle-embed></div> --- @@ -1339,15 +1418,15 @@ int saveLayer(const SkRect& bounds, const SkPaint* paint) </pre> Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates an offscreen <a href="undocumented#Bitmap">Bitmap</a> for subsequent drawing. +and allocates a <a href="undocumented#Bitmap">Bitmap</a> for subsequent drawing. Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and draws the offscreen <a href="undocumented#Bitmap">Bitmap</a>. +and draws the <a href="undocumented#Bitmap">Bitmap</a>. <a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, <a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. -<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayer_2_bounds">bounds</a> suggests but does not define the offscreen size. To clip drawing to +<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayer_2_bounds">bounds</a> suggests but does not define the <a href="#Layer">Layer</a> size. To clip drawing to a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. Optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_saveLayer_2_paint">paint</a> applies <a href="#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and @@ -1358,9 +1437,9 @@ Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value t ### Parameters <table> <tr> <td><a name="SkCanvas_saveLayer_2_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of the offscreen; may be nullptr</td> +hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_saveLayer_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state for offscreen; may be nullptr</td> +graphics state for <a href="#Layer">Layer</a>; may be nullptr</td> </tr> </table> @@ -1370,9 +1449,9 @@ depth of saved stack ### Example -<div><fiddle-embed name="812f3c8f8b93e8c7e55528c7a22887bf"><div>Rectangles are blurred by <a href="undocumented#Image_Filter">Image Filter</a> when <a href="#SkCanvas_restore">restore</a> draws offscreen to main <a href="#Canvas">Canvas</a>. -The red rectangle is clipped; it does not fully fit on the offscreen <a href="#Canvas">Canvas</a>. -<a href="undocumented#Image_Filter">Image Filter</a> blurs past edge of offscreen so red rectangle is blurred on all sides.</div></fiddle-embed></div> +<div><fiddle-embed name="812f3c8f8b93e8c7e55528c7a22887bf"><div>Rectangles are blurred by <a href="undocumented#Image_Filter">Image Filter</a> when <a href="#SkCanvas_restore">restore</a> draws <a href="#Layer">Layer</a> to main <a href="#Canvas">Canvas</a>. +The red rectangle is clipped; it does not fully fit on <a href="#Layer">Layer</a>. +<a href="undocumented#Image_Filter">Image Filter</a> blurs past edge of <a href="#Layer">Layer</a> so red rectangle is blurred on all sides.</div></fiddle-embed></div> --- @@ -1384,16 +1463,16 @@ int saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint) </pre> Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates an offscreen bitmap for subsequent drawing. -<a href="SkPaint_Reference#LCD_Text">LCD Text</a> is preserved when the offscreen is drawn to the prior layer. +and allocates a <a href="undocumented#Bitmap">Bitmap</a> for subsequent drawing. +<a href="SkPaint_Reference#LCD_Text">LCD Text</a> is preserved when the <a href="#Layer">Layer</a> is drawn to the prior <a href="#Layer">Layer</a>. Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and draws the offscreen bitmap. +and draws <a href="#Layer">Layer</a>. <a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, <a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. -<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests_bounds">bounds</a> suggests but does not define the offscreen size. To clip drawing to +<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests_bounds">bounds</a> suggests but does not define the <a href="#Layer">Layer</a> size. To clip drawing to a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. Optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_saveLayerPreserveLCDTextRequests_paint">paint</a> applies <a href="#Alpha">Color Alpha</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and @@ -1402,15 +1481,15 @@ Optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_saveLaye Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value to <a href="#SkCanvas_restore">restore</a> this and subsequent saves. Draw text on an opaque background so that <a href="SkPaint_Reference#LCD_Text">LCD Text</a> blends correctly with the -prior layer. <a href="SkPaint_Reference#LCD_Text">LCD Text</a> drawn on a background with transparency may result in +prior <a href="#Layer">Layer</a>. <a href="SkPaint_Reference#LCD_Text">LCD Text</a> drawn on a background with transparency may result in incorrect banding. ### Parameters <table> <tr> <td><a name="SkCanvas_saveLayerPreserveLCDTextRequests_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of the offscreen; may be nullptr</td> +hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_saveLayerPreserveLCDTextRequests_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state for offscreen; may be nullptr</td> +graphics state for <a href="#Layer">Layer</a>; may be nullptr</td> </tr> </table> @@ -1432,16 +1511,16 @@ int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) </pre> Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates an offscreen bitmap for subsequent drawing. +and allocates <a href="undocumented#Bitmap">Bitmap</a> for subsequent drawing. Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and blends the offscreen bitmap with <a href="#SkCanvas_saveLayerAlpha_alpha">alpha</a> opacity onto the prior layer. +and blends <a href="#Layer">Layer</a> with <a href="#SkCanvas_saveLayerAlpha_alpha">alpha</a> opacity onto prior <a href="#Layer">Layer</a>. <a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, <a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. -<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayerAlpha_bounds">bounds</a> suggests but does not define the offscreen size. To clip drawing to +<a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_saveLayerAlpha_bounds">bounds</a> suggests but does not define <a href="#Layer">Layer</a> size. To clip drawing to a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. <a href="#SkCanvas_saveLayerAlpha_alpha">alpha</a> of zero is fully transparent, 255 is fully opaque. @@ -1451,9 +1530,9 @@ Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value t ### Parameters <table> <tr> <td><a name="SkCanvas_saveLayerAlpha_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -hint to limit the size of the offscreen; may be nullptr</td> +hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_saveLayerAlpha_alpha"> <code><strong>alpha </strong></code> </a></td> <td> -opacity of the offscreen</td> +opacity of <a href="#Layer">Layer</a></td> </tr> </table> @@ -1480,32 +1559,32 @@ enum { typedef uint32_t <a href="undocumented#SaveLayerFlags">SaveLayerFlags</a>;</pre> <a href="undocumented#SaveLayerFlags">SaveLayerFlags</a> provides options that may be used in any combination in <a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a>, -defining how the offscreen allocated by <a href="#SkCanvas_saveLayer">saveLayer</a> operates. +defining how <a href="#Layer">Layer</a> allocated by <a href="#SkCanvas_saveLayer">saveLayer</a> operates. ### Constants <table> <tr> - <td><a name="SkCanvas_kIsOpaque_SaveLayerFlag"> <code><strong>SkCanvas::kIsOpaque_SaveLayerFlag </strong></code> </a></td><td>1</td><td>Creates offscreen without transparency. Flag is ignored if layer <a href="SkPaint_Reference#Paint">Paint</a> contains + <td><a name="SkCanvas_kIsOpaque_SaveLayerFlag"> <code><strong>SkCanvas::kIsOpaque_SaveLayerFlag </strong></code> </a></td><td>1</td><td>Creates <a href="#Layer">Layer</a> without transparency. Flag is ignored if <a href="#Layer">Layer</a> <a href="SkPaint_Reference#Paint">Paint</a> contains <a href="undocumented#Image_Filter">Image Filter</a> or <a href="undocumented#Color_Filter">Color Filter</a>.</td> </tr> <tr> - <td><a name="SkCanvas_kPreserveLCDText_SaveLayerFlag"> <code><strong>SkCanvas::kPreserveLCDText_SaveLayerFlag </strong></code> </a></td><td>2</td><td>Creates offscreen for <a href="undocumented#LCD">LCD</a> text. Flag is ignored if layer <a href="SkPaint_Reference#Paint">Paint</a> contains + <td><a name="SkCanvas_kPreserveLCDText_SaveLayerFlag"> <code><strong>SkCanvas::kPreserveLCDText_SaveLayerFlag </strong></code> </a></td><td>2</td><td>Creates <a href="#Layer">Layer</a> for <a href="undocumented#LCD">LCD</a> text. Flag is ignored if <a href="#Layer">Layer</a> <a href="SkPaint_Reference#Paint">Paint</a> contains <a href="undocumented#Image_Filter">Image Filter</a> or <a href="undocumented#Color_Filter">Color Filter</a>.</td> </tr> <tr> - <td><a name="SkCanvas_kInitWithPrevious_SaveLayerFlag"> <code><strong>SkCanvas::kInitWithPrevious_SaveLayerFlag </strong></code> </a></td><td>4</td><td>Initializes offscreen with the contents of the previous layer.</td> + <td><a name="SkCanvas_kInitWithPrevious_SaveLayerFlag"> <code><strong>SkCanvas::kInitWithPrevious_SaveLayerFlag </strong></code> </a></td><td>4</td><td>Initializes <a href="#Layer">Layer</a> with the contents of the previous <a href="#Layer">Layer</a>.</td> </tr> <tr> <td><a name="SkCanvas_kDontClipToLayer_Legacy_SaveLayerFlag"> <code><strong>SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag </strong></code> </a></td><td>0x80000000</td><td>Only present on <a href="undocumented#Android">Android</a>. -Skips setting a clip to the layer bounds.</td> +Skips setting a clip to the <a href="#Layer">Layer</a> bounds.</td> </tr> </table> ### Example -<div><fiddle-embed name="d314c688925d2c549d4762f5cc6e6a1a"><div><a href="#Canvas">Canvas</a> layer captures red and blue circles scaled up by four. -scalePaint blends offscreen back with transparency.</div></fiddle-embed></div> +<div><fiddle-embed name="d314c688925d2c549d4762f5cc6e6a1a"><div><a href="#Canvas">Canvas</a> <a href="#Layer">Layer</a> captures red and blue circles scaled up by four. +scalePaint blends <a href="#Layer">Layer</a> back with transparency.</div></fiddle-embed></div> @@ -1521,47 +1600,47 @@ const <a href="undocumented#SkImageFilter">SkImageFilter</a>* <a href="#SkCan <a href="undocumented#SaveLayerFlags">SaveLayerFlags</a> <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>; };</pre> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> contains the state used to create the layer offscreen. +<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> contains the state used to create the <a href="#Layer">Layer</a>. <a name="SkCanvas_SaveLayerRec_fBounds"> <code><strong>const SkRect* fBounds</strong></code> </a> -<a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a> is used as a hint to limit the size of the offscreen; may be nullptr. -<a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a> suggests but does not define the offscreen size. To clip drawing to +<a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a> is used as a hint to limit the size of <a href="#Layer">Layer</a>; may be nullptr. +<a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a> suggests but does not define <a href="#Layer">Layer</a> size. To clip drawing to a specific rectangle, use <a href="#SkCanvas_clipRect">clipRect</a>. <a name="SkCanvas_SaveLayerRec_fPaint"> <code><strong>const SkPaint* fPaint</strong></code> </a> -<a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a> modifies how the offscreen overlays the prior layer; may be nullptr. +<a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a> modifies how <a href="#Layer">Layer</a> overlays the prior <a href="#Layer">Layer</a>; may be nullptr. <a href="#Alpha">Color Alpha</a>, <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Draw_Looper">Draw Looper</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and -<a href="undocumented#Mask_Filter">Mask Filter</a> affect the offscreen draw. +<a href="undocumented#Mask_Filter">Mask Filter</a> affect <a href="#Layer">Layer</a> draw. <a name="SkCanvas_SaveLayerRec_fBackdrop"> <code><strong>const SkImageFilter* fBackdrop</strong></code> </a> -<a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a> applies <a href="undocumented#Image_Filter">Image Filter</a> to the prior layer when copying to the layer -offscreen; may be nullptr. Use <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a> to copy the -prior layer without an <a href="undocumented#Image_Filter">Image Filter</a>. +<a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a> applies <a href="undocumented#Image_Filter">Image Filter</a> to the prior <a href="#Layer">Layer</a> when copying to the <a href="#Layer">Layer</a>; +may be nullptr. Use <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a> to copy the +prior <a href="#Layer">Layer</a> without an <a href="undocumented#Image_Filter">Image Filter</a>. <a name="SkCanvas_SaveLayerRec_fClipMask"> <code><strong>const SkImage* fClipMask</strong></code> </a> -<a href="#SkCanvas_restore">restore</a> clips the layer offscreen by the alpha channel of <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> when -the offscreen is copied to <a href="undocumented#Device">Device</a>. <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> may be nullptr. . +<a href="#SkCanvas_restore">restore</a> clips <a href="#Layer">Layer</a> by the <a href="#Alpha">Color Alpha</a> channel of <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> when +<a href="#Layer">Layer</a> is copied to <a href="undocumented#Device">Device</a>. <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> may be nullptr. . <a name="SkCanvas_SaveLayerRec_fClipMatrix"> <code><strong>const SkMatrix* fClipMatrix</strong></code> </a> -<a href="#SkCanvas_SaveLayerRec_fClipMatrix">fClipMatrix</a> transforms <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> before it clips the layer offscreen. If +<a href="#SkCanvas_SaveLayerRec_fClipMatrix">fClipMatrix</a> transforms <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> before it clips <a href="#Layer">Layer</a>. If <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a> describes a translucent gradient, it may be scaled and rotated without introducing artifacts. <a href="#SkCanvas_SaveLayerRec_fClipMatrix">fClipMatrix</a> may be nullptr. <a name="SkCanvas_SaveLayerRec_fSaveLayerFlags"> <code><strong>SaveLayerFlags fSaveLayerFlags</strong></code> </a> -<a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a> are used to create layer offscreen without transparency, -create layer offscreen for <a href="undocumented#LCD">LCD</a> text, and to create layer offscreen with the -contents of the previous layer. +<a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a> are used to create <a href="#Layer">Layer</a> without transparency, +create <a href="#Layer">Layer</a> for <a href="undocumented#LCD">LCD</a> text, and to create <a href="#Layer">Layer</a> with the +contents of the previous <a href="#Layer">Layer</a>. ### Example -<div><fiddle-embed name="7b18146582fc2440656b839a173ed500"><div><a href="#Canvas">Canvas</a> layer captures a red anti-aliased circle and a blue aliased circle scaled -up by four. After drawing another unscaled red circle on top, the offscreen is +<div><fiddle-embed name="7b18146582fc2440656b839a173ed500"><div><a href="#Canvas">Canvas</a> <a href="#Layer">Layer</a> captures a red <a href="undocumented#Anti_alias">Anti-aliased</a> circle and a blue <a href="#Alias">Aliased</a> circle scaled +up by four. After drawing another red circle without scaling on top, the <a href="#Layer">Layer</a> is transferred to the main canvas.</div></fiddle-embed></div> <a name="SkCanvas_SaveLayerRec_SaveLayerRec"></a> @@ -1601,11 +1680,11 @@ Sets <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>, <a href="#SkCanvas_Sa ### Parameters <table> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_2_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -offscreen dimensions; may be nullptr</td> +<a href="#Layer">Layer</a> dimensions; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_2_paint"> <code><strong>paint </strong></code> </a></td> <td> -applied to offscreen when overlaying prior layer; may be nullptr</td> +applied to <a href="#Layer">Layer</a> when overlaying prior <a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_2_saveLayerFlags"> <code><strong>saveLayerFlags </strong></code> </a></td> <td> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify offscreen</td> +<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify <a href="#Layer">Layer</a></td> </tr> </table> @@ -1637,15 +1716,14 @@ Sets <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>, <a href="#SkCanvas_Sa ### Parameters <table> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -offscreen dimensions; may be nullptr</td> +<a href="#Layer">Layer</a> dimensions; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_paint"> <code><strong>paint </strong></code> </a></td> <td> -applied to offscreen when overlaying prior layer; +applied to <a href="#Layer">Layer</a> when overlaying prior <a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_backdrop"> <code><strong>backdrop </strong></code> </a></td> <td> -prior layer copied to offscreen with <a href="undocumented#Image_Filter">Image Filter</a>; -may be nullptr</td> +prior <a href="#Layer">Layer</a> copied with <a href="undocumented#Image_Filter">Image Filter</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_3_saveLayerFlags"> <code><strong>saveLayerFlags </strong></code> </a></td> <td> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify offscreen</td> +<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify <a href="#Layer">Layer</a></td> </tr> </table> @@ -1674,28 +1752,28 @@ SaveLayerRec(const SkRect* bounds, const SkPaint* paint, </pre> Not ready for general use.Sets <a href="#SkCanvas_SaveLayerRec_fBounds">fBounds</a>, <a href="#SkCanvas_SaveLayerRec_fPaint">fPaint</a>, <a href="#SkCanvas_SaveLayerRec_fBackdrop">fBackdrop</a>, <a href="#SkCanvas_SaveLayerRec_fClipMask">fClipMask</a>, <a href="#SkCanvas_SaveLayerRec_fClipMatrix">fClipMatrix</a>, and <a href="#SkCanvas_SaveLayerRec_fSaveLayerFlags">fSaveLayerFlags</a>. -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix">clipMatrix</a> uses alpha channel of image, transformed by <a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix">clipMatrix</a>, to clip layer -when drawn to <a href="#Canvas">Canvas</a>. +<a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix">clipMatrix</a> uses <a href="#Alpha">Color Alpha</a> channel of image, transformed by <a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix">clipMatrix</a>, to clip +<a href="#Layer">Layer</a> when drawn to <a href="#Canvas">Canvas</a>. Implementation is incomplete; has no effect if <a href="undocumented#Device">Device</a> is <a href="undocumented#GPU_backed">GPU-backed</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_bounds"> <code><strong>bounds </strong></code> </a></td> <td> -offscreen dimensions; may be nullptr</td> +<a href="#Layer">Layer</a> dimensions; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_paint"> <code><strong>paint </strong></code> </a></td> <td> -graphics state applied to offscreen when overlaying prior -layer; may be nullptr</td> +graphics state applied to <a href="#Layer">Layer</a> when overlaying prior +<a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_backdrop"> <code><strong>backdrop </strong></code> </a></td> <td> -prior layer copied to offscreen with <a href="undocumented#Image_Filter">Image Filter</a>; +prior <a href="#Layer">Layer</a> copied with <a href="undocumented#Image_Filter">Image Filter</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMask"> <code><strong>clipMask </strong></code> </a></td> <td> -clip applied to layer; may be nullptr</td> +clip applied to <a href="#Layer">Layer</a>; may be nullptr</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMatrix"> <code><strong>clipMatrix </strong></code> </a></td> <td> matrix applied to <a href="#SkCanvas_SaveLayerRec_SaveLayerRec_4_clipMask">clipMask</a>; may be nullptr to use identity matrix</td> </tr> <tr> <td><a name="SkCanvas_SaveLayerRec_SaveLayerRec_4_saveLayerFlags"> <code><strong>saveLayerFlags </strong></code> </a></td> <td> -<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify offscreen</td> +<a href="#SkCanvas_SaveLayerRec_SaveLayerRec">SaveLayerRec</a> options to modify <a href="#Layer">Layer</a></td> </tr> </table> @@ -1710,23 +1788,23 @@ int saveLayer(const SaveLayerRec& layerRec) </pre> Saves <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> (<a href="undocumented#Draw_Filter">Draw Filter</a> deprecated on most platforms), -and allocates an offscreen bitmap for subsequent drawing. +and allocates <a href="undocumented#Bitmap">Bitmap</a> for subsequent drawing. Calling <a href="#SkCanvas_restore">restore</a> discards changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>, -and blends the offscreen bitmap with alpha opacity onto the prior layer. +and blends <a href="undocumented#Bitmap">Bitmap</a> with <a href="#Alpha">Color Alpha</a> opacity onto the prior <a href="#Layer">Layer</a>. <a href="#Matrix">Matrix</a> may be changed by <a href="#SkCanvas_translate">translate</a>, <a href="#SkCanvas_scale">scale</a>, <a href="#SkCanvas_rotate">rotate</a>, <a href="#SkCanvas_skew">skew</a>, <a href="#SkCanvas_concat">concat</a>, <a href="#SkCanvas_setMatrix">setMatrix</a>, and <a href="#SkCanvas_resetMatrix">resetMatrix</a>. <a href="#Clip">Clip</a> may be changed by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a>, <a href="#SkCanvas_clipPath">clipPath</a>, <a href="#SkCanvas_clipRegion">clipRegion</a>. -<a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> contains the state used to create the layer offscreen. +<a href="#SkCanvas_SaveLayerRec">SaveLayerRec</a> contains the state used to create the <a href="#Layer">Layer</a>. Call <a href="#SkCanvas_restoreToCount">restoreToCount</a> with returned value to <a href="#SkCanvas_restore">restore</a> this and subsequent saves. ### Parameters <table> <tr> <td><a name="SkCanvas_saveLayer_3_layerRec"> <code><strong>layerRec </strong></code> </a></td> <td> -offscreen state</td> +<a href="#Layer">Layer</a> state</td> </tr> </table> @@ -1736,98 +1814,13 @@ depth of <a href="#SkCanvas_save">save</a> state stack ### Example -<div><fiddle-embed name="0da8c199f1d9ec4d1b9c5d1114d6cbd6"><div>The example draws an image, and saves it into a layer with <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a>. -Next it punches a hole in the layer and <a href="#SkCanvas_restore">restore</a> with <a href="#SkBlendMode_kPlus">SkBlendMode::kPlus</a>. -Where the layer was cleared, the original image will draw unchanged. +<div><fiddle-embed name="0da8c199f1d9ec4d1b9c5d1114d6cbd6"><div>The example draws an image, and saves it into a <a href="#Layer">Layer</a> with <a href="#SkCanvas_kInitWithPrevious_SaveLayerFlag">kInitWithPrevious SaveLayerFlag</a>. +Next it punches a hole in <a href="#Layer">Layer</a> and <a href="#SkCanvas_restore">restore</a> with <a href="#SkBlendMode_kPlus">SkBlendMode::kPlus</a>. +Where <a href="#Layer">Layer</a> was cleared, the original image will draw unchanged. Outside of the circle the mandrill is brightened.</div></fiddle-embed></div> --- -<a name="SkCanvas_restore"></a> -## restore - -<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> -void restore() -</pre> - -Removes changes to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> since <a href="#Canvas">Canvas</a> state was -last saved. The state is removed from the stack. - -Does nothing if the stack is empty. - -### Example - -<div><fiddle-embed name="e78471212a67f2f4fd39496e17a30d17"></fiddle-embed></div> - ---- - -<a name="SkCanvas_getSaveCount"></a> -## getSaveCount - -<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> -int getSaveCount() const -</pre> - -Returns the number of saved states, each containing: <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a>. -Equals the number of <a href="#SkCanvas_save">save</a> calls less the number of <a href="#SkCanvas_restore">restore</a> calls plus one. -The <a href="#SkCanvas_save">save</a> count of a new canvas is one. - -### Return Value - -depth of <a href="#SkCanvas_save">save</a> state stack - -### Example - -<div><fiddle-embed name="005f2b207e078baac596681924fe591e"> - -#### Example Output - -~~~~ -depth = 1 -depth = 2 -depth = 1 -~~~~ - -</fiddle-embed></div> - ---- - -<a name="SkCanvas_restoreToCount"></a> -## restoreToCount - -<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0"> -void restoreToCount(int saveCount) -</pre> - -Restores state to <a href="#Matrix">Matrix</a>, <a href="#Clip">Clip</a>, and <a href="undocumented#Draw_Filter">Draw Filter</a> values when <a href="#SkCanvas_save">save</a>, <a href="#SkCanvas_saveLayer">saveLayer</a>, -<a href="#SkCanvas_saveLayerPreserveLCDTextRequests">saveLayerPreserveLCDTextRequests</a>, or <a href="#SkCanvas_saveLayerAlpha">saveLayerAlpha</a> returned <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a>. - -Does nothing if <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a> is greater than state stack count. -Restores state to initial values if <a href="#SkCanvas_restoreToCount_saveCount">saveCount</a> is less than or equal to one. - -### Parameters - -<table> <tr> <td><a name="SkCanvas_restoreToCount_saveCount"> <code><strong>saveCount </strong></code> </a></td> <td> -depth of state stack to <a href="#SkCanvas_restore">restore</a></td> - </tr> -</table> - -### Example - -<div><fiddle-embed name="9ed0d56436e114c7097fd49eed1aea47"> - -#### Example Output - -~~~~ -depth = 1 -depth = 3 -depth = 1 -~~~~ - -</fiddle-embed></div> - ---- - # <a name="Matrix"></a> Matrix <a name="SkCanvas_translate"></a> @@ -1840,7 +1833,7 @@ void translate(SkScalar dx, SkScalar dy) Translate <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_translate_dx">dx</a> along the x-axis and <a href="#SkCanvas_translate_dy">dy</a> along the y-axis. Mathematically, replace <a href="#Matrix">Matrix</a> with a translation matrix -pre-multiplied with <a href="#Matrix">Matrix</a>. +<a href="#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. This has the effect of moving the drawing by (<a href="#SkCanvas_translate_dx">dx</a>, <a href="#SkCanvas_translate_dy">dy</a>) before transforming the result with <a href="#Matrix">Matrix</a>. @@ -1876,7 +1869,7 @@ void scale(SkScalar sx, SkScalar sy) Scale <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_scale_sx">sx</a> on the x-axis and <a href="#SkCanvas_scale_sy">sy</a> on the y-axis. Mathematically, replace <a href="#Matrix">Matrix</a> with a <a href="#SkCanvas_scale">scale</a> matrix -pre-multiplied with <a href="#Matrix">Matrix</a>. +<a href="#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. This has the effect of scaling the drawing by (<a href="#SkCanvas_scale_sx">sx</a>, <a href="#SkCanvas_scale_sy">sy</a>) before transforming the result with <a href="#Matrix">Matrix</a>. @@ -1906,7 +1899,7 @@ void rotate(SkScalar degrees) Rotate <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_rotate_degrees">degrees</a>. Positive <a href="#SkCanvas_rotate_degrees">degrees</a> rotates clockwise. Mathematically, replace <a href="#Matrix">Matrix</a> with a rotation matrix -pre-multiplied with <a href="#Matrix">Matrix</a>. +<a href="#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. This has the effect of rotating the drawing by <a href="#SkCanvas_rotate_degrees">degrees</a> before transforming the result with <a href="#Matrix">Matrix</a>. @@ -1932,9 +1925,9 @@ void rotate(SkScalar degrees, SkScalar px, SkScalar py) Rotate <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_rotate_2_degrees">degrees</a> about a point at (<a href="#SkCanvas_rotate_2_px">px</a>, <a href="#SkCanvas_rotate_2_py">py</a>). Positive <a href="#SkCanvas_rotate_2_degrees">degrees</a> rotates clockwise. -Mathematically, construct a rotation matrix. Pre-multiply the rotation matrix by +Mathematically, construct a rotation matrix. <a href="undocumented#Premultiply">Premultiply</a> the rotation matrix by a translation matrix, then replace <a href="#Matrix">Matrix</a> with the resulting matrix -pre-multiplied with <a href="#Matrix">Matrix</a>. +<a href="#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. This has the effect of rotating the drawing about a given point before transforming the result with <a href="#Matrix">Matrix</a>. @@ -1967,7 +1960,7 @@ Skew <a href="#Matrix">Matrix</a> by <a href="#SkCanvas_skew_sx">sx</a> on the x skews the drawing right as y increases; a positive value of <a href="#SkCanvas_skew_sy">sy</a> skews the drawing down as x increases. -Mathematically, replace <a href="#Matrix">Matrix</a> with a <a href="#SkCanvas_skew">skew</a> matrix pre-multiplied with <a href="#Matrix">Matrix</a>. +Mathematically, replace <a href="#Matrix">Matrix</a> with a <a href="#SkCanvas_skew">skew</a> matrix <a href="#Premultiply">Premultiplied</a> with <a href="#Matrix">Matrix</a>. This has the effect of skewing the drawing by (<a href="#SkCanvas_skew_sx">sx</a>, <a href="#SkCanvas_skew_sy">sy</a>) before transforming the result with <a href="#Matrix">Matrix</a>. @@ -1985,9 +1978,9 @@ amount to <a href="#SkCanvas_skew">skew</a> in y</td> <div><fiddle-embed name="2e2acc21d7774df7e0940a30ad2ca99e"><div>Black text mimics an oblique text style by using a negative <a href="#SkCanvas_skew">skew</a> in x that shifts the geometry to the right as the y values decrease. -Red text uses a positive <a href="#SkCanvas_skew">skew</a> in y to shift the geometry down as the x values +<a href="#Red">Red</a> text uses a positive <a href="#SkCanvas_skew">skew</a> in y to shift the geometry down as the x values increase. -Blue text combines x and y <a href="#SkCanvas_skew">skew</a> to <a href="#SkCanvas_rotate">rotate</a> and <a href="#SkCanvas_scale">scale</a>.</div></fiddle-embed></div> +<a href="#Blue">Blue</a> text combines x and y <a href="#SkCanvas_skew">skew</a> to <a href="#SkCanvas_rotate">rotate</a> and <a href="#SkCanvas_scale">scale</a>.</div></fiddle-embed></div> --- @@ -1998,7 +1991,7 @@ Blue text combines x and y <a href="#SkCanvas_skew">skew</a> to <a href="#SkCanv void concat(const SkMatrix& matrix) </pre> -Replace <a href="#Matrix">Matrix</a> with <a href="#SkCanvas_concat_matrix">matrix</a> pre-multiplied with existing <a href="#Matrix">Matrix</a>. +Replace <a href="#Matrix">Matrix</a> with <a href="#SkCanvas_concat_matrix">matrix</a> <a href="#Premultiply">Premultiplied</a> with existing <a href="#Matrix">Matrix</a>. This has the effect of transforming the drawn geometry by <a href="#SkCanvas_concat_matrix">matrix</a>, before transforming the result with existing <a href="#Matrix">Matrix</a>. @@ -2006,7 +1999,7 @@ transforming the result with existing <a href="#Matrix">Matrix</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_concat_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -<a href="#SkCanvas_concat_matrix">matrix</a> to pre-multiply with existing <a href="#Matrix">Matrix</a></td> +<a href="#SkCanvas_concat_matrix">matrix</a> to <a href="undocumented#Premultiply">Premultiply</a> with existing <a href="#Matrix">Matrix</a></td> </tr> </table> @@ -2096,14 +2089,14 @@ prior <a href="#Clip">Clip</a> to form the replacement <a href="#Clip">Clip</a>. to subtract <a href="SkPath_Reference#Path">Path</a> from <a href="#Clip">Clip</a>; use <a href="#SkClipOp_kIntersect">SkClipOp::kIntersect</a> to intersect <a href="SkPath_Reference#Path">Path</a> with <a href="#Clip">Clip</a>. -A clipping <a href="SkPath_Reference#Path">Path</a> may be anti-aliased; if <a href="SkPath_Reference#Path">Path</a>, after transformation, is +A clipping <a href="SkPath_Reference#Path">Path</a> may be <a href="undocumented#Anti_alias">Anti-aliased</a>; if <a href="SkPath_Reference#Path">Path</a>, after transformation, is composed of horizontal and vertical lines, clearing <a href="SkPaint_Reference#Anti_alias">Anti-alias</a> allows whole pixels -to either be inside or outside the clip. The fastest drawing has a aliased, -rectanglar clip. +to either be inside or outside the clip. The fastest drawing has a <a href="#Alias">Aliased</a>, +rectangular clip. If clipping <a href="SkPath_Reference#Path">Path</a> has <a href="SkPaint_Reference#Anti_alias">Anti-alias</a> set, clip may partially clip a pixel, requiring that drawing blend partially with the destination along the edge. A rotated -rectangular anti-aliased clip looks smoother but draws slower. +rectangular <a href="undocumented#Anti_alias">Anti-aliased</a> clip looks smoother but draws slower. <a href="#Clip">Clip</a> can combine with <a href="undocumented#Rect">Rect</a> and <a href="undocumented#Round_Rect">Round Rect</a> primitives; like <a href="SkPath_Reference#Path">Path</a>, these are transformed by <a href="#Matrix">Matrix</a> before they are combined with <a href="#Clip">Clip</a>. @@ -2113,10 +2106,10 @@ and is unaffected by <a href="#Matrix">Matrix</a>. ### Example -<div><fiddle-embed name="d2e60e5171f26ff9ddefae48387f889b"><div>Draw a red circle with an aliased clip and an anti-aliased clip. +<div><fiddle-embed name="d2e60e5171f26ff9ddefae48387f889b"><div>Draw a red circle with an <a href="#Alias">Aliased</a> clip and an <a href="undocumented#Anti_alias">Anti-aliased</a> clip. Use an image filter to zoom into the pixels drawn. -The edge of the aliased clip fully draws pixels in the red circle. -The edge of the anti-aliased clip partially draws pixels in the red circle.</div></fiddle-embed></div> +The edge of the <a href="#Alias">Aliased</a> clip fully draws pixels in the red circle. +The edge of the <a href="undocumented#Anti_alias">Anti-aliased</a> clip partially draws pixels in the red circle.</div></fiddle-embed></div> <a name="SkCanvas_clipRect"></a> ## clipRect @@ -2126,7 +2119,7 @@ void clipRect(const SkRect& rect, SkClipOp op, bool doAntiAlias) </pre> Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRect_rect">rect</a>, -with an aliased or anti-aliased clip edge. <a href="#SkCanvas_clipRect_rect">rect</a> is transformed by <a href="#Matrix">Matrix</a> +with an <a href="#Alias">Aliased</a> or <a href="undocumented#Anti_alias">Anti-aliased</a> clip edge. <a href="#SkCanvas_clipRect_rect">rect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. ### Parameters @@ -2136,7 +2129,7 @@ before it is combined with <a href="#Clip">Clip</a>. </tr> <tr> <td><a name="SkCanvas_clipRect_op"> <code><strong>op </strong></code> </a></td> <td> <a href="#Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> </tr> <tr> <td><a name="SkCanvas_clipRect_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be anti-aliased</td> +true if <a href="#Clip">Clip</a> is to be <a href="undocumented#Anti_alias">Anti-aliased</a></td> </tr> </table> @@ -2151,7 +2144,7 @@ void clipRect(const SkRect& rect, SkClipOp op) </pre> Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRect_2_rect">rect</a>. -Resulting <a href="#Clip">Clip</a> is aliased; pixels are fully contained by the clip. +Resulting <a href="#Clip">Clip</a> is <a href="#Alias">Aliased</a>; pixels are fully contained by the clip. <a href="#SkCanvas_clipRect_2_rect">rect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. ### Parameters @@ -2174,7 +2167,7 @@ void clipRect(const SkRect& rect, bool doAntiAlias = false) </pre> Replace <a href="#Clip">Clip</a> with the intersection of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRect_3_rect">rect</a>. -Resulting <a href="#Clip">Clip</a> is aliased; pixels are fully contained by the clip. +Resulting <a href="#Clip">Clip</a> is <a href="#Alias">Aliased</a>; pixels are fully contained by the clip. <a href="#SkCanvas_clipRect_3_rect">rect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. @@ -2183,14 +2176,14 @@ before it is combined with <a href="#Clip">Clip</a>. <table> <tr> <td><a name="SkCanvas_clipRect_3_rect"> <code><strong>rect </strong></code> </a></td> <td> <a href="undocumented#Rect">Rect</a> to combine with <a href="#Clip">Clip</a></td> </tr> <tr> <td><a name="SkCanvas_clipRect_3_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be anti-aliased</td> +true if <a href="#Clip">Clip</a> is to be <a href="undocumented#Anti_alias">Anti-aliased</a></td> </tr> </table> ### Example -<div><fiddle-embed name="1d4e0632c97e42692775d834fe10aa99"><div>A circle drawn in pieces looks uniform when drawn aliased. -The same circle pieces blend with pixels more than once when anti-aliased, +<div><fiddle-embed name="1d4e0632c97e42692775d834fe10aa99"><div>A circle drawn in pieces looks uniform when drawn <a href="#Alias">Aliased</a>. +The same circle pieces blend with pixels more than once when <a href="undocumented#Anti_alias">Anti-aliased</a>, visible as a thin pair of lines through the right circle.</div></fiddle-embed></div> --- @@ -2202,12 +2195,12 @@ visible as a thin pair of lines through the right circle.</div></fiddle-embed></ void androidFramework_setDeviceClipRestriction(const SkIRect& rect) </pre> -Sets the max clip rectangle, which can be set by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a> and +Sets the maximum clip rectangle, which can be set by <a href="#SkCanvas_clipRect">clipRect</a>, <a href="#SkCanvas_clipRRect">clipRRect</a> and <a href="#SkCanvas_clipPath">clipPath</a> and intersect the current clip with the specified <a href="#SkCanvas_androidFramework_setDeviceClipRestriction_rect">rect</a>. -The max clip affects only future ops (it is not retroactive). +The maximum clip affects only future clipping operations; it is not retroactive. The clip restriction is not recorded in pictures. -Pass an empty <a href="#SkCanvas_androidFramework_setDeviceClipRestriction_rect">rect</a> to disable max clip. +Pass an empty <a href="#SkCanvas_androidFramework_setDeviceClipRestriction_rect">rect</a> to disable maximum clip. ### Parameters @@ -2228,7 +2221,7 @@ void clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias) </pre> Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRRect_rrect">rrect</a>, -with an aliased or anti-aliased clip edge. +with an <a href="#Alias">Aliased</a> or <a href="undocumented#Anti_alias">Anti-aliased</a> clip edge. <a href="#SkCanvas_clipRRect_rrect">rrect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. @@ -2239,7 +2232,7 @@ before it is combined with <a href="#Clip">Clip</a>. </tr> <tr> <td><a name="SkCanvas_clipRRect_op"> <code><strong>op </strong></code> </a></td> <td> <a href="#Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> </tr> <tr> <td><a name="SkCanvas_clipRRect_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be antialiased</td> +true if <a href="#Clip">Clip</a> is to be <a href="undocumented#Anti_alias">Anti-aliased</a></td> </tr> </table> @@ -2254,7 +2247,7 @@ void clipRRect(const SkRRect& rrect, SkClipOp op) </pre> Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRRect_2_rrect">rrect</a>. -Resulting <a href="#Clip">Clip</a> is aliased; pixels are fully contained by the clip. +Resulting <a href="#Clip">Clip</a> is <a href="#Alias">Aliased</a>; pixels are fully contained by the clip. <a href="#SkCanvas_clipRRect_2_rrect">rrect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. ### Parameters @@ -2277,7 +2270,7 @@ void clipRRect(const SkRRect& rrect, bool doAntiAlias = false) </pre> Replace <a href="#Clip">Clip</a> with the intersection of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipRRect_3_rrect">rrect</a>, -with an aliased or anti-aliased clip edge. +with an <a href="#Alias">Aliased</a> or <a href="undocumented#Anti_alias">Anti-aliased</a> clip edge. <a href="#SkCanvas_clipRRect_3_rrect">rrect</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. ### Parameters @@ -2285,7 +2278,7 @@ with an aliased or anti-aliased clip edge. <table> <tr> <td><a name="SkCanvas_clipRRect_3_rrect"> <code><strong>rrect </strong></code> </a></td> <td> <a href="undocumented#Round_Rect">Round Rect</a> to combine with <a href="#Clip">Clip</a></td> </tr> <tr> <td><a name="SkCanvas_clipRRect_3_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be antialiased</td> +true if <a href="#Clip">Clip</a> is to be <a href="undocumented#Anti_alias">Anti-aliased</a></td> </tr> </table> @@ -2303,7 +2296,7 @@ void clipPath(const SkPath& path, SkClipOp op, bool doAntiAlias) </pre> Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipPath_path">path</a>, -with an aliased or anti-aliased clip edge. <a href="#Fill_Type">Path Fill Type</a> determines if <a href="#SkCanvas_clipPath_path">path</a> +with an <a href="#Alias">Aliased</a> or <a href="undocumented#Anti_alias">Anti-aliased</a> clip edge. <a href="#Fill_Type">Path Fill Type</a> determines if <a href="#SkCanvas_clipPath_path">path</a> describes the area inside or outside its contours; and if <a href="#Contour">Path Contour</a> overlaps itself or another <a href="#Contour">Path Contour</a>, whether the overlaps form part of the area. <a href="#SkCanvas_clipPath_path">path</a> is transformed by <a href="#Matrix">Matrix</a> before it is combined with <a href="#Clip">Clip</a>. @@ -2315,7 +2308,7 @@ itself or another <a href="#Contour">Path Contour</a>, whether the overlaps form </tr> <tr> <td><a name="SkCanvas_clipPath_op"> <code><strong>op </strong></code> </a></td> <td> <a href="#Op">Clip Op</a> to apply to <a href="#Clip">Clip</a></td> </tr> <tr> <td><a name="SkCanvas_clipPath_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be antialiased</td> +true if <a href="#Clip">Clip</a> is to be <a href="undocumented#Anti_alias">Anti-aliased</a></td> </tr> </table> @@ -2334,7 +2327,7 @@ void clipPath(const SkPath& path, SkClipOp op) </pre> Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipPath_2_path">path</a>. -Resulting <a href="#Clip">Clip</a> is aliased; pixels are fully contained by the clip. +Resulting <a href="#Clip">Clip</a> is <a href="#Alias">Aliased</a>; pixels are fully contained by the clip. <a href="#Fill_Type">Path Fill Type</a> determines if <a href="#SkCanvas_clipPath_2_path">path</a> describes the area inside or outside its contours; and if <a href="#Contour">Path Contour</a> overlaps itself or another <a href="#Contour">Path Contour</a>, whether the overlaps form part of the area. @@ -2363,7 +2356,7 @@ void clipPath(const SkPath& path, bool doAntiAlias = false) </pre> Replace <a href="#Clip">Clip</a> with the intersection of <a href="#Clip">Clip</a> and <a href="#SkCanvas_clipPath_3_path">path</a>. -Resulting <a href="#Clip">Clip</a> is aliased; pixels are fully contained by the clip. +Resulting <a href="#Clip">Clip</a> is <a href="#Alias">Aliased</a>; pixels are fully contained by the clip. <a href="#Fill_Type">Path Fill Type</a> determines if <a href="#SkCanvas_clipPath_3_path">path</a> describes the area inside or outside its contours; and if <a href="#Contour">Path Contour</a> overlaps itself or another <a href="#Contour">Path Contour</a>, whether the overlaps form part of the area. @@ -2374,7 +2367,7 @@ itself or another <a href="#Contour">Path Contour</a>, whether the overlaps form <table> <tr> <td><a name="SkCanvas_clipPath_3_path"> <code><strong>path </strong></code> </a></td> <td> <a href="SkPath_Reference#Path">Path</a> to combine with <a href="#Clip">Clip</a></td> </tr> <tr> <td><a name="SkCanvas_clipPath_3_doAntiAlias"> <code><strong>doAntiAlias </strong></code> </a></td> <td> -true if <a href="#Clip">Clip</a> is to be antialiased</td> +true if <a href="#Clip">Clip</a> is to be <a href="undocumented#Anti_alias">Anti-aliased</a></td> </tr> </table> @@ -2393,7 +2386,7 @@ is set to <a href="#SkPath_kWinding_FillType">SkPath::kWinding FillType</a>, the void setAllowSimplifyClip(bool allow) </pre> -Only used for testing.Set to simplify clip stack using path ops. +Only used for testing.Set to simplify clip stack using <a href="undocumented#PathOps">PathOps</a>. --- @@ -2405,7 +2398,7 @@ void clipRegion(const SkRegion& deviceRgn, SkClipOp op = SkClipOp::kIntersect) </pre> Replace <a href="#Clip">Clip</a> with the intersection or difference of <a href="#Clip">Clip</a> and <a href="undocumented#Region">Region</a> <a href="#SkCanvas_clipRegion_deviceRgn">deviceRgn</a>. -Resulting <a href="#Clip">Clip</a> is aliased; pixels are fully contained by the clip. +Resulting <a href="#Clip">Clip</a> is <a href="#Alias">Aliased</a>; pixels are fully contained by the clip. <a href="#SkCanvas_clipRegion_deviceRgn">deviceRgn</a> is unaffected by <a href="#Matrix">Matrix</a>. ### Parameters @@ -2419,8 +2412,8 @@ Resulting <a href="#Clip">Clip</a> is aliased; pixels are fully contained by the ### Example -<div><fiddle-embed name="7bb57c0e456c5fda2c2cca4abb68b19e"><div>region is unaffected by canvas rotation; rect is affected by canvas rotation. -Both clips are aliased; this is unnoticable on <a href="undocumented#Region">Region</a> clip because it +<div><fiddle-embed name="7bb57c0e456c5fda2c2cca4abb68b19e"><div>region is unaffected by canvas rotation; iRect is affected by canvas rotation. +Both clips are <a href="#Alias">Aliased</a>; this is not noticeable on <a href="undocumented#Region">Region</a> clip because it aligns to pixel boundaries.</div></fiddle-embed></div> --- @@ -2509,7 +2502,7 @@ Return bounds of <a href="#Clip">Clip</a>, transformed by inverse of <a href="#M return <a href="#SkRect_MakeEmpty">SkRect::MakeEmpty</a>, where all <a href="undocumented#Rect">Rect</a> sides equal zero. <a href="undocumented#Rect">Rect</a> returned is outset by one to account for partial pixel coverage if <a href="#Clip">Clip</a> -is anti-aliased. +is <a href="undocumented#Anti_alias">Anti-aliased</a>. ### Return Value @@ -2541,7 +2534,7 @@ Return <a href="#SkCanvas_getLocalClipBounds_2_bounds">bounds</a> of <a href="#C return false, and set <a href="#SkCanvas_getLocalClipBounds_2_bounds">bounds</a> to <a href="#SkRect_MakeEmpty">SkRect::MakeEmpty</a>, where all <a href="undocumented#Rect">Rect</a> sides equal zero. <a href="#SkCanvas_getLocalClipBounds_2_bounds">bounds</a> is outset by one to account for partial pixel coverage if <a href="#Clip">Clip</a> -is anti-aliased. +is <a href="undocumented#Anti_alias">Anti-aliased</a>. ### Parameters @@ -2651,7 +2644,7 @@ Fill <a href="#Clip">Clip</a> with <a href="undocumented#Color">Color</a> <a hre ### Parameters <table> <tr> <td><a name="SkCanvas_drawColor_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiplied">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a></td> +<a href="#Unpremultiply">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a></td> </tr> <tr> <td><a name="SkCanvas_drawColor_mode"> <code><strong>mode </strong></code> </a></td> <td> <a href="undocumented#SkBlendMode">SkBlendMode</a> used to combine source <a href="#SkCanvas_drawColor_color">color</a> and destination</td> </tr> @@ -2676,7 +2669,7 @@ This has the effect of replacing all pixels contained by <a href="#Clip">Clip</a ### Parameters <table> <tr> <td><a name="SkCanvas_clear_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiplied">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a></td> +<a href="#Unpremultiply">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a></td> </tr> </table> @@ -3099,7 +3092,7 @@ void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint Draw <a href="undocumented#Round_Rect">Round Rect</a> <a href="#SkCanvas_drawDRRect_outer">outer</a> and <a href="#SkCanvas_drawDRRect_inner">inner</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawDRRect_paint">paint</a>. <a href="#SkCanvas_drawDRRect_outer">outer</a> must contain <a href="#SkCanvas_drawDRRect_inner">inner</a> or the drawing is undefined. -In <a href="#SkCanvas_drawDRRect_paint">paint</a>: <a href="#Style">Paint Style</a> determines if rrect is stroked or filled; +In <a href="#SkCanvas_drawDRRect_paint">paint</a>: <a href="#Style">Paint Style</a> determines if <a href="undocumented#Round_Rect">Round Rect</a> is stroked or filled; if stroked, <a href="#Stroke_Width">Paint Stroke Width</a> describes the line thickness. If stroked and <a href="undocumented#Round_Rect">Round Rect</a> corner has zero length radii, <a href="#Stroke_Join">Paint Stroke Join</a> can draw corners rounded or square. @@ -3166,7 +3159,7 @@ half the diameter of <a href="undocumented#Circle">Circle</a></td> void drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint) </pre> -Draw <a href="undocumented#Circle">Circle</a> at (cx, cy) with <a href="#SkCanvas_drawCircle_2_radius">radius</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawCircle_2_paint">paint</a>. +Draw <a href="undocumented#Circle">Circle</a> at <a href="#SkCanvas_drawCircle_2_center">center</a> with <a href="#SkCanvas_drawCircle_2_radius">radius</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawCircle_2_paint">paint</a>. If <a href="#SkCanvas_drawCircle_2_radius">radius</a> is zero or less, nothing is drawn. In <a href="#SkCanvas_drawCircle_2_paint">paint</a>: <a href="#Style">Paint Style</a> determines if <a href="undocumented#Circle">Circle</a> is stroked or filled; if stroked, <a href="#Stroke_Width">Paint Stroke Width</a> describes the line thickness. @@ -3258,9 +3251,9 @@ If <a href="#SkCanvas_drawRoundRect_rx">rx</a> and <a href="#SkCanvas_drawRoundR <table> <tr> <td><a name="SkCanvas_drawRoundRect_rect"> <code><strong>rect </strong></code> </a></td> <td> <a href="undocumented#Rect">Rect</a> bounds of <a href="undocumented#Round_Rect">Round Rect</a> to draw</td> </tr> <tr> <td><a name="SkCanvas_drawRoundRect_rx"> <code><strong>rx </strong></code> </a></td> <td> -semiaxis length in x of oval describing rounded corners</td> +axis length in x of oval describing rounded corners</td> </tr> <tr> <td><a name="SkCanvas_drawRoundRect_ry"> <code><strong>ry </strong></code> </a></td> <td> -semiaxis length in y of oval describing rounded corners</td> +axis length in y of oval describing rounded corners</td> </tr> <tr> <td><a name="SkCanvas_drawRoundRect_paint"> <code><strong>paint </strong></code> </a></td> <td> stroke, blend, color, and so on, used to draw</td> </tr> @@ -3396,23 +3389,23 @@ enum <a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> { <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a>, };</pre> -<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> controls the behavior at the edge of the <a href="undocumented#Rect">Rect</a> src, provided to -<a href="#SkCanvas_drawImageRect">drawImageRect</a>, trading off speed for precision. +<a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> controls the behavior at the edge of source <a href="undocumented#Rect">Rect</a>, +provided to <a href="#SkCanvas_drawImageRect">drawImageRect</a>, trading off speed for precision. -<a href="undocumented#Image_Filter">Image Filter</a> in <a href="SkPaint_Reference#Paint">Paint</a> may sample multiple pixels in the image. <a href="undocumented#Rect">Rect</a> src +<a href="undocumented#Image_Filter">Image Filter</a> in <a href="SkPaint_Reference#Paint">Paint</a> may sample multiple pixels in the image. Source <a href="undocumented#Rect">Rect</a> restricts the bounds of pixels that may be read. <a href="undocumented#Image_Filter">Image Filter</a> may slow down if -it cannot read outside the bounds, when sampling near the edge of <a href="undocumented#Rect">Rect</a> src. +it cannot read outside the bounds, when sampling near the edge of source <a href="undocumented#Rect">Rect</a>. <a href="#SkCanvas_SrcRectConstraint">SrcRectConstraint</a> specifies whether an <a href="undocumented#Image_Filter">Image Filter</a> is allowed to read pixels -outside <a href="undocumented#Rect">Rect</a> src. +outside source <a href="undocumented#Rect">Rect</a>. ### Constants <table> <tr> - <td><a name="SkCanvas_kStrict_SrcRectConstraint"> <code><strong>SkCanvas::kStrict_SrcRectConstraint </strong></code> </a></td><td>Requires Image_Filter to respect Rect src,</td><td>sampling only inside of its bounds, possibly with a performance penalty.</td> + <td><a name="SkCanvas_kStrict_SrcRectConstraint"> <code><strong>SkCanvas::kStrict_SrcRectConstraint </strong></code> </a></td><td>Requires Image_Filter to respect source Rect,</td><td>sampling only inside of its bounds, possibly with a performance penalty.</td> </tr> <tr> - <td><a name="SkCanvas_kFast_SrcRectConstraint"> <code><strong>SkCanvas::kFast_SrcRectConstraint </strong></code> </a></td><td>Permits Image_Filter to sample outside of Rect src</td><td>by half the width of <a href="undocumented#Image_Filter">Image Filter</a>, permitting it to run faster but with + <td><a name="SkCanvas_kFast_SrcRectConstraint"> <code><strong>SkCanvas::kFast_SrcRectConstraint </strong></code> </a></td><td>Permits Image_Filter to sample outside of source Rect</td><td>by half the width of <a href="undocumented#Image_Filter">Image Filter</a>, permitting it to run faster but with error at the image edges.</td> </tr> </table> @@ -3421,7 +3414,7 @@ error at the image edges.</td> <div><fiddle-embed name="5df49d1f4da37275a1f10ef7f1a749f0"><div>redBorder contains a black and white checkerboard bordered by red. redBorder is drawn scaled by 16 on the left. -The middle and right bitmaps are filtered checkboards. +The middle and right bitmaps are filtered checkerboards. Drawing the checkerboard with <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> shows only a blur of black and white. Drawing the checkerboard with <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows red to bleed in the corners.</div></fiddle-embed></div> @@ -3497,7 +3490,7 @@ as <a href="undocumented#Shader">Shader</a> made from <a href="#SkImage_makeShad replicates the <a href="#SkCanvas_drawImageRect_2_image">image</a>'s edge color when it samples outside of its bounds. <a href="#SkCanvas_drawImageRect_2_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within src; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +sample within <a href="#SkCanvas_drawImageRect_2_isrc">isrc</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters @@ -3512,7 +3505,7 @@ destination <a href="undocumented#Rect">Rect</a> of <a href="#SkCanvas_drawImage <a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and so on; or nullptr</td> </tr> <tr> <td><a name="SkCanvas_drawImageRect_2_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within src or draw faster</td> +filter strictly within <a href="#SkCanvas_drawImageRect_2_isrc">isrc</a> or draw faster</td> </tr> </table> @@ -3539,7 +3532,7 @@ as <a href="undocumented#Shader">Shader</a> made from <a href="#SkImage_makeShad replicates the <a href="#SkCanvas_drawImageRect_3_image">image</a>'s edge color when it samples outside of its bounds. <a href="#SkCanvas_drawImageRect_3_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within src; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +sample within <a href="#SkCanvas_drawImageRect_3_image">image</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters @@ -3552,7 +3545,7 @@ destination <a href="undocumented#Rect">Rect</a> of <a href="#SkCanvas_drawImage <a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and so on; or nullptr</td> </tr> <tr> <td><a name="SkCanvas_drawImageRect_3_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within src or draw faster</td> +filter strictly within <a href="#SkCanvas_drawImageRect_3_image">image</a> or draw faster</td> </tr> </table> @@ -3625,7 +3618,7 @@ as <a href="undocumented#Shader">Shader</a> made from <a href="#SkImage_makeShad replicates the <a href="#SkCanvas_drawImageRect_5_image">image</a>'s edge color when it samples outside of its bounds. <a href="#SkCanvas_drawImageRect_5_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within src; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +sample within <a href="#SkCanvas_drawImageRect_5_image">image</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters @@ -3640,7 +3633,7 @@ destination <a href="undocumented#Rect">Rect</a> of <a href="#SkCanvas_drawImage <a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and so on; or nullptr</td> </tr> <tr> <td><a name="SkCanvas_drawImageRect_5_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within src or draw faster</td> +filter strictly within <a href="#SkCanvas_drawImageRect_5_image">image</a> or draw faster</td> </tr> </table> @@ -3668,7 +3661,7 @@ as <a href="undocumented#Shader">Shader</a> made from <a href="#SkImage_makeShad replicates the <a href="#SkCanvas_drawImageRect_6_image">image</a>'s edge color when it samples outside of its bounds. <a href="#SkCanvas_drawImageRect_6_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within src; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +sample within <a href="#SkCanvas_drawImageRect_6_image">image</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters @@ -3681,7 +3674,7 @@ destination <a href="undocumented#Rect">Rect</a> of <a href="#SkCanvas_drawImage <a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and so on; or nullptr</td> </tr> <tr> <td><a name="SkCanvas_drawImageRect_6_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within src or draw faster</td> +filter strictly within <a href="#SkCanvas_drawImageRect_6_image">image</a> or draw faster</td> </tr> </table> @@ -3701,7 +3694,7 @@ void drawImageNine(const SkImage* image, const SkIRect& center, Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_dst">dst</a>. <a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_center">center</a> divides the <a href="#SkCanvas_drawImageNine_image">image</a> into nine sections: four sides, four corners, and -the <a href="#SkCanvas_drawImageNine_center">center</a>. Corners are unscaled or scaled down proportionately if their sides +the <a href="#SkCanvas_drawImageNine_center">center</a>. Corners are unmodified or scaled down proportionately if their sides are larger than <a href="#SkCanvas_drawImageNine_dst">dst</a>; <a href="#SkCanvas_drawImageNine_center">center</a> and four sides are scaled to fit remaining space, if any. Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageNine_paint">paint</a>. @@ -3731,9 +3724,9 @@ and so on; or nullptr</td> ### Example <div><fiddle-embed name="47f78f3f70ccd9e6c40ee3203a5c71dd"><div>The leftmost <a href="#SkCanvas_drawImageNine_image">image</a> is smaller than <a href="#SkCanvas_drawImageNine_center">center</a>; only corners are drawn, all scaled to fit. -The second <a href="#SkCanvas_drawImageNine_image">image</a> equals the size of <a href="#SkCanvas_drawImageNine_center">center</a>; only corners are drawn, unscaled. -The remaining images are larger than <a href="#SkCanvas_drawImageNine_center">center</a>. All corners draw unscaled. The sides -and <a href="#SkCanvas_drawImageNine_center">center</a> are scaled if needed to take up the remaining space.</div></fiddle-embed></div> +The second <a href="#SkCanvas_drawImageNine_image">image</a> equals the size of <a href="#SkCanvas_drawImageNine_center">center</a>; only corners are drawn without scaling. +The remaining images are larger than <a href="#SkCanvas_drawImageNine_center">center</a>. All corners draw without scaling. +The sides and <a href="#SkCanvas_drawImageNine_center">center</a> are scaled if needed to take up the remaining space.</div></fiddle-embed></div> --- @@ -3744,7 +3737,7 @@ void drawImageNine(const sk_sp<SkImage>& image, const SkIRect& center, Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_2_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_2_dst">dst</a>. <a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_2_center">center</a> divides the <a href="#SkCanvas_drawImageNine_2_image">image</a> into nine sections: four sides, four corners, and -the <a href="#SkCanvas_drawImageNine_2_center">center</a>. Corners are unscaled or scaled down proportionately if their sides +the <a href="#SkCanvas_drawImageNine_2_center">center</a>. Corners are not scaled, or scaled down proportionately if their sides are larger than <a href="#SkCanvas_drawImageNine_2_dst">dst</a>; <a href="#SkCanvas_drawImageNine_2_center">center</a> and four sides are scaled to fit remaining space, if any. Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawImageNine_2_paint">paint</a>. @@ -3775,7 +3768,7 @@ and so on; or nullptr</td> <div><fiddle-embed name="e941e553970569d1ffb03a42f7fcd6d9"><div>The two leftmost images has four corners and sides to the left and right of <a href="#SkCanvas_drawImageNine_2_center">center</a>. The leftmost <a href="#SkCanvas_drawImageNine_2_image">image</a> scales the width of corners proportionately to fit. -The third and fourth <a href="#SkCanvas_drawImageNine_2_image">image</a> corners are unscaled; the sides and <a href="#SkCanvas_drawImageNine_2_center">center</a> are scaled to +The third and fourth <a href="#SkCanvas_drawImageNine_2_image">image</a> corners are not scaled; the sides and <a href="#SkCanvas_drawImageNine_2_center">center</a> are scaled to fill the remaining space. The rightmost <a href="#SkCanvas_drawImageNine_2_image">image</a> has four corners scaled vertically to fit, and uses sides above and below <a href="#SkCanvas_drawImageNine_2_center">center</a> to fill the remaining space.</div></fiddle-embed></div> @@ -3889,7 +3882,7 @@ just as <a href="undocumented#Shader">Shader</a> made from <a href="#SkShader_Ma outside of its bounds. <a href="#SkCanvas_drawBitmapRect_2_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within src; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +sample within <a href="#SkCanvas_drawBitmapRect_2_isrc">isrc</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters @@ -3904,7 +3897,7 @@ destination <a href="undocumented#Rect">Rect</a> of image to draw to</td> <a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and so on; or nullptr</td> </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_2_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -sample strictly within src, or draw faster</td> +sample strictly within <a href="#SkCanvas_drawBitmapRect_2_isrc">isrc</a>, or draw faster</td> </tr> </table> @@ -3921,7 +3914,7 @@ void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, </pre> Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a>, scaled and translated to fill <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapRect_3_dst">dst</a>. -isrc is on integer pixel boundaries; <a href="#SkCanvas_drawBitmapRect_3_dst">dst</a> may include fractional boundaries. +<a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> bounds is on integer pixel boundaries; <a href="#SkCanvas_drawBitmapRect_3_dst">dst</a> may include fractional boundaries. Additionally transform draw using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and optional <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_3_paint">paint</a>. If <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawBitmapRect_3_paint">paint</a> is supplied, apply <a href="undocumented#Color_Filter">Color Filter</a>, <a href="#Alpha">Color Alpha</a>, <a href="undocumented#Image_Filter">Image Filter</a>, @@ -3934,7 +3927,7 @@ just as <a href="undocumented#Shader">Shader</a> made from <a href="#SkShader_Ma outside of its bounds. <a href="#SkCanvas_drawBitmapRect_3_constraint">constraint</a> set to <a href="#SkCanvas_kStrict_SrcRectConstraint">kStrict SrcRectConstraint</a> limits <a href="SkPaint_Reference#Paint">Paint</a> <a href="undocumented#Filter_Quality">Filter Quality</a> to -sample within src; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to +sample within <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a>; set to <a href="#SkCanvas_kFast_SrcRectConstraint">kFast SrcRectConstraint</a> allows sampling outside to improve performance. ### Parameters @@ -3947,7 +3940,7 @@ destination <a href="undocumented#Rect">Rect</a> of image to draw to</td> <a href="SkPaint_Reference#Paint">Paint</a> containing <a href="undocumented#Blend_Mode">Blend Mode</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and so on; or nullptr</td> </tr> <tr> <td><a name="SkCanvas_drawBitmapRect_3_constraint"> <code><strong>constraint </strong></code> </a></td> <td> -filter strictly within src or draw faster</td> +filter strictly within <a href="#SkCanvas_drawBitmapRect_3_bitmap">bitmap</a> or draw faster</td> </tr> </table> @@ -3967,7 +3960,7 @@ void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapNine_dst">dst</a>. <a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawBitmapNine_center">center</a> divides the <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> into nine sections: four sides, four corners, -and the <a href="#SkCanvas_drawBitmapNine_center">center</a>. Corners are unscaled or scaled down proportionately if their +and the <a href="#SkCanvas_drawBitmapNine_center">center</a>. Corners are not scaled, or scaled down proportionately if their sides are larger than <a href="#SkCanvas_drawBitmapNine_dst">dst</a>; <a href="#SkCanvas_drawBitmapNine_center">center</a> and four sides are scaled to fit remaining space, if any. @@ -4000,7 +3993,7 @@ and so on; or nullptr</td> <div><fiddle-embed name="a4a30aa10e566a85fe6f6cad2ff9935b"><div>The two leftmost <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> draws has four corners and sides to the left and right of <a href="#SkCanvas_drawBitmapNine_center">center</a>. The leftmost <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> draw scales the width of corners proportionately to fit. -The third and fourth draw corners are unscaled; the sides and <a href="#SkCanvas_drawBitmapNine_center">center</a> are scaled to +The third and fourth draw corners are not scaled; the sides and <a href="#SkCanvas_drawBitmapNine_center">center</a> are scaled to fill the remaining space. The rightmost <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> draw has four corners scaled vertically to fit, and uses sides above and below <a href="#SkCanvas_drawBitmapNine_center">center</a> to fill the remaining space.</div></fiddle-embed></div> @@ -4129,7 +4122,7 @@ and so on; or nullptr</td> <div><fiddle-embed name="773134f4fe127f9c9caa110c24c988dc"><div>The two leftmost <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> draws has four corners and sides to the left and right of center. The leftmost <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> draw scales the width of corners proportionately to fit. -The third and fourth draw corners are unscaled; the sides are scaled to +The third and fourth draw corners are not scaled; the sides are scaled to fill the remaining space; the center is transparent. The rightmost <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> draw has four corners scaled vertically to fit, and uses sides above and below center to fill the remaining space.</div></fiddle-embed></div> @@ -4180,8 +4173,8 @@ and so on; or nullptr</td> ### Example <div><fiddle-embed name="c52ee1d4c69363c6b109539c1da3ce83"><div>The leftmost <a href="#SkCanvas_drawImageLattice_image">image</a> is smaller than center; only corners are drawn, all scaled to fit. -The second <a href="#SkCanvas_drawImageLattice_image">image</a> equals the size of center; only corners are drawn, unscaled. -The remaining images are larger than center. All corners draw unscaled. The sides +The second <a href="#SkCanvas_drawImageLattice_image">image</a> equals the size of center; only corners are drawn without scaling. +The remaining images are larger than center. All corners draw without scaling. The sides are scaled if needed to take up the remaining space; the center is transparent.</div></fiddle-embed></div> --- @@ -4205,12 +4198,12 @@ and its baseline at <a href="#SkCanvas_drawText_y">y</a>. <a href="undocumented# All elements of <a href="#SkCanvas_drawText_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawText_text">text</a>. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_drawText_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or glyphs drawn</td> +character code points or <a href="#Glyph">Glyphs</a> drawn</td> </tr> <tr> <td><a name="SkCanvas_drawText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> byte length of <a href="#SkCanvas_drawText_text">text</a> array</td> </tr> <tr> <td><a name="SkCanvas_drawText_x"> <code><strong>x </strong></code> </a></td> <td> @@ -4249,12 +4242,12 @@ and its baseline at <a href="#SkCanvas_drawString_y">y</a>. <a href="undocumente All elements of <a href="#SkCanvas_drawString_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_drawString_string"> <code><strong>string </strong></code> </a></td> <td> -character code points or glyphs drawn, +character code points or <a href="#Glyph">Glyphs</a> drawn, ending with a char value of zero</td> </tr> <tr> <td><a name="SkCanvas_drawString_x"> <code><strong>x </strong></code> </a></td> <td> start of <a href="#SkCanvas_drawString_string">string</a> on x-axis</td> @@ -4293,12 +4286,12 @@ and its baseline at <a href="#SkCanvas_drawString_2_y">y</a>. <a href="undocumen All elements of <a href="#SkCanvas_drawString_2_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_drawString_2_string"> <code><strong>string </strong></code> </a></td> <td> -character code points or glyphs drawn, +character code points or <a href="#Glyph">Glyphs</a> drawn, ending with a char value of zero</td> </tr> <tr> <td><a name="SkCanvas_drawString_2_x"> <code><strong>x </strong></code> </a></td> <td> start of <a href="#SkCanvas_drawString_2_string">string</a> on x-axis</td> @@ -4328,7 +4321,7 @@ void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], </pre> Draw each glyph in <a href="#SkCanvas_drawPosText_text">text</a> with the origin in <a href="#SkCanvas_drawPosText_pos">pos</a> array, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and -<a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPosText_paint">paint</a>. The number of entries in <a href="#SkCanvas_drawPosText_pos">pos</a> array must match the number of glyphs +<a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPosText_paint">paint</a>. The number of entries in <a href="#SkCanvas_drawPosText_pos">pos</a> array must match the number of <a href="#Glyph">Glyphs</a> described by <a href="#SkCanvas_drawPosText_byteLength">byteLength</a> of <a href="#SkCanvas_drawPosText_text">text</a>. <a href="#SkCanvas_drawPosText_text">text</a>'s meaning depends on <a href="#Text_Encoding">Paint Text Encoding</a>; by default, <a href="#SkCanvas_drawPosText_text">text</a> encoding is @@ -4339,7 +4332,7 @@ baseline is positioned at y. <a href="undocumented#Text">Text</a> size is affect All elements of <a href="#SkCanvas_drawPosText_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawPosText_text">text</a>. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. Layout engines such as <a href="undocumented#Harfbuzz">Harfbuzz</a> typically position each glyph rather than using the font's advance widths. @@ -4347,7 +4340,7 @@ rather than using the font's advance widths. ### Parameters <table> <tr> <td><a name="SkCanvas_drawPosText_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or glyphs drawn</td> +character code points or <a href="#Glyph">Glyphs</a> drawn</td> </tr> <tr> <td><a name="SkCanvas_drawPosText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> byte length of <a href="#SkCanvas_drawPosText_text">text</a> array</td> </tr> <tr> <td><a name="SkCanvas_drawPosText_pos"> <code><strong>pos </strong></code> </a></td> <td> @@ -4373,26 +4366,26 @@ void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], Draw each glyph in <a href="#SkCanvas_drawPosTextH_text">text</a> with its (x, y) origin composed from <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> array and <a href="#SkCanvas_drawPosTextH_constY">constY</a>, using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPosTextH_paint">paint</a>. The number of entries in <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> array -must match the number of glyphs described by <a href="#SkCanvas_drawPosTextH_byteLength">byteLength</a> of <a href="#SkCanvas_drawPosTextH_text">text</a>. +must match the number of <a href="#Glyph">Glyphs</a> described by <a href="#SkCanvas_drawPosTextH_byteLength">byteLength</a> of <a href="#SkCanvas_drawPosTextH_text">text</a>. <a href="#SkCanvas_drawPosTextH_text">text</a>'s meaning depends on <a href="#Text_Encoding">Paint Text Encoding</a>; by default, <a href="#SkCanvas_drawPosTextH_text">text</a> encoding is -<a href="undocumented#UTF_8">UTF-8</a>. pos elements' meaning depends on <a href="#Text_Align">Paint Text Align</a> and <a href="#Vertical_Text">Paint Vertical Text</a>; +<a href="undocumented#UTF_8">UTF-8</a>. <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> elements' meaning depends on <a href="#Text_Align">Paint Text Align</a> and <a href="#Vertical_Text">Paint Vertical Text</a>; by default each glyph's left side bearing is positioned at an <a href="#SkCanvas_drawPosTextH_xpos">xpos</a> element and its baseline is positioned at <a href="#SkCanvas_drawPosTextH_constY">constY</a>. <a href="undocumented#Text">Text</a> size is affected by <a href="#Matrix">Matrix</a> and <a href="#Text_Size">Paint Text Size</a>. All elements of <a href="#SkCanvas_drawPosTextH_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawPosTextH_text">text</a>. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. Layout engines such as <a href="undocumented#Harfbuzz">Harfbuzz</a> typically position each glyph -rather than using the font's advance widths if all glyphs share the same +rather than using the font's advance widths if all <a href="#Glyph">Glyphs</a> share the same baseline. ### Parameters <table> <tr> <td><a name="SkCanvas_drawPosTextH_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or glyphs drawn</td> +character code points or <a href="#Glyph">Glyphs</a> drawn</td> </tr> <tr> <td><a name="SkCanvas_drawPosTextH_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> byte length of <a href="#SkCanvas_drawPosTextH_text">text</a> array</td> </tr> <tr> <td><a name="SkCanvas_drawPosTextH_xpos"> <code><strong>xpos </strong></code> </a></td> <td> @@ -4433,12 +4426,12 @@ baseline at origin y. <a href="undocumented#Text">Text</a> size is affected by < All elements of <a href="#SkCanvas_drawTextOnPathHV_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextOnPathHV_text">text</a>. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_drawTextOnPathHV_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or glyphs drawn</td> +character code points or <a href="#Glyph">Glyphs</a> drawn</td> </tr> <tr> <td><a name="SkCanvas_drawTextOnPathHV_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> byte length of <a href="#SkCanvas_drawTextOnPathHV_text">text</a> array</td> </tr> <tr> <td><a name="SkCanvas_drawTextOnPathHV_path"> <code><strong>path </strong></code> </a></td> <td> @@ -4481,18 +4474,18 @@ baseline at origin y. <a href="undocumented#Text">Text</a> size is affected by < All elements of <a href="#SkCanvas_drawTextOnPath_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextOnPath_text">text</a>. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_drawTextOnPath_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or glyphs drawn</td> +character code points or <a href="#Glyph">Glyphs</a> drawn</td> </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> byte length of <a href="#SkCanvas_drawTextOnPath_text">text</a> array</td> </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_path"> <code><strong>path </strong></code> </a></td> <td> <a href="SkPath_Reference#Path">Path</a> providing <a href="#SkCanvas_drawTextOnPath_text">text</a> baseline</td> </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_matrix"> <code><strong>matrix </strong></code> </a></td> <td> -transform of glyphs before mapping to <a href="#SkCanvas_drawTextOnPath_path">path</a>; may be nullptr +transform of <a href="#Glyph">Glyphs</a> before mapping to <a href="#SkCanvas_drawTextOnPath_path">path</a>; may be nullptr to use identity <a href="#Matrix">Matrix</a></td> </tr> <tr> <td><a name="SkCanvas_drawTextOnPath_paint"> <code><strong>paint </strong></code> </a></td> <td> <a href="#SkCanvas_drawTextOnPath_text">text</a> size, blend, color, and so on, used to draw</td> @@ -4521,16 +4514,16 @@ using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPai each glyph. Optional <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawTextRSXform_cullRect">cullRect</a> is a conservative bounds of <a href="#SkCanvas_drawTextRSXform_text">text</a>, taking into account -<a href="undocumented#RSXform">RSXform</a> and <a href="#SkCanvas_drawTextRSXform_paint">paint</a>. If cullrect is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +<a href="undocumented#RSXform">RSXform</a> and <a href="#SkCanvas_drawTextRSXform_paint">paint</a>. If <a href="#SkCanvas_drawTextRSXform_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. All elements of <a href="#SkCanvas_drawTextRSXform_paint">paint</a>: <a href="undocumented#Path_Effect">Path Effect</a>, <a href="undocumented#Rasterizer">Rasterizer</a>, <a href="undocumented#Mask_Filter">Mask Filter</a>, <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, <a href="undocumented#Image_Filter">Image Filter</a>, and <a href="undocumented#Draw_Looper">Draw Looper</a>; apply to <a href="#SkCanvas_drawTextRSXform_text">text</a>. By default, draws -filled 12 point black glyphs. +filled 12 point black <a href="#Glyph">Glyphs</a>. ### Parameters <table> <tr> <td><a name="SkCanvas_drawTextRSXform_text"> <code><strong>text </strong></code> </a></td> <td> -character code points or glyphs drawn</td> +character code points or <a href="#Glyph">Glyphs</a> drawn</td> </tr> <tr> <td><a name="SkCanvas_drawTextRSXform_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> byte length of <a href="#SkCanvas_drawTextRSXform_text">text</a> array</td> </tr> <tr> <td><a name="SkCanvas_drawTextRSXform_xform"> <code><strong>xform </strong></code> </a></td> <td> @@ -4558,7 +4551,7 @@ void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, Draw <a href="undocumented#Text_Blob">Text Blob</a> <a href="#SkCanvas_drawTextBlob_blob">blob</a> at (<a href="#SkCanvas_drawTextBlob_x">x</a>, <a href="#SkCanvas_drawTextBlob_y">y</a>), using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawTextBlob_paint">paint</a>. -<a href="#SkCanvas_drawTextBlob_blob">blob</a> contains glyphs, their positions, and <a href="#SkCanvas_drawTextBlob_paint">paint</a> attributes specific to text: +<a href="#SkCanvas_drawTextBlob_blob">blob</a> contains <a href="#Glyph">Glyphs</a>, their positions, and <a href="#SkCanvas_drawTextBlob_paint">paint</a> attributes specific to text: <a href="undocumented#Typeface">Typeface</a>, <a href="#Text_Size">Paint Text Size</a>, <a href="#Text_Scale_X">Paint Text Scale X</a>, <a href="#Text_Skew_X">Paint Text Skew X</a>, <a href="#Text_Align">Paint Text Align</a>, <a href="#Hinting">Paint Hinting</a>, <a href="SkPaint_Reference#Anti_alias">Anti-alias</a>, <a href="#Fake_Bold">Paint Fake Bold</a>, <a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a>, <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a>, <a href="SkPaint_Reference#LCD_Text">LCD Text</a>, <a href="SkPaint_Reference#Linear_Text">Linear Text</a>, @@ -4570,7 +4563,7 @@ Elements of <a href="#SkCanvas_drawTextBlob_paint">paint</a>: <a href="undocumen ### Parameters <table> <tr> <td><a name="SkCanvas_drawTextBlob_blob"> <code><strong>blob </strong></code> </a></td> <td> -glyphs, positions, and their paints' text size, typeface, and so on</td> +<a href="#Glyph">Glyphs</a>, positions, and their paints' text size, typeface, and so on</td> </tr> <tr> <td><a name="SkCanvas_drawTextBlob_x"> <code><strong>x </strong></code> </a></td> <td> horizontal offset applied to <a href="#SkCanvas_drawTextBlob_blob">blob</a></td> </tr> <tr> <td><a name="SkCanvas_drawTextBlob_y"> <code><strong>y </strong></code> </a></td> <td> @@ -4593,7 +4586,7 @@ void drawTextBlob(const sk_sp<SkTextBlob>& blob, SkScalar x, SkScalar y, Draw <a href="undocumented#Text_Blob">Text Blob</a> <a href="#SkCanvas_drawTextBlob_2_blob">blob</a> at (<a href="#SkCanvas_drawTextBlob_2_x">x</a>, <a href="#SkCanvas_drawTextBlob_2_y">y</a>), using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawTextBlob_2_paint">paint</a>. -<a href="#SkCanvas_drawTextBlob_2_blob">blob</a> contains glyphs, their positions, and <a href="#SkCanvas_drawTextBlob_2_paint">paint</a> attributes specific to text: +<a href="#SkCanvas_drawTextBlob_2_blob">blob</a> contains <a href="#Glyph">Glyphs</a>, their positions, and <a href="#SkCanvas_drawTextBlob_2_paint">paint</a> attributes specific to text: <a href="undocumented#Typeface">Typeface</a>, <a href="#Text_Size">Paint Text Size</a>, <a href="#Text_Scale_X">Paint Text Scale X</a>, <a href="#Text_Skew_X">Paint Text Skew X</a>, <a href="#Text_Align">Paint Text Align</a>, <a href="#Hinting">Paint Hinting</a>, <a href="SkPaint_Reference#Anti_alias">Anti-alias</a>, <a href="#Fake_Bold">Paint Fake Bold</a>, <a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a>, <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a>, <a href="SkPaint_Reference#LCD_Text">LCD Text</a>, <a href="SkPaint_Reference#Linear_Text">Linear Text</a>, @@ -4605,7 +4598,7 @@ Elements of <a href="#SkCanvas_drawTextBlob_2_paint">paint</a>: <a href="undocum ### Parameters <table> <tr> <td><a name="SkCanvas_drawTextBlob_2_blob"> <code><strong>blob </strong></code> </a></td> <td> -glyphs, positions, and their paints' text size, typeface, and so on</td> +<a href="#Glyph">Glyphs</a>, positions, and their paints' text size, typeface, and so on</td> </tr> <tr> <td><a name="SkCanvas_drawTextBlob_2_x"> <code><strong>x </strong></code> </a></td> <td> horizontal offset applied to <a href="#SkCanvas_drawTextBlob_2_blob">blob</a></td> </tr> <tr> <td><a name="SkCanvas_drawTextBlob_2_y"> <code><strong>y </strong></code> </a></td> <td> @@ -4793,7 +4786,7 @@ void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPaint& paint) </pre> -Draw a cubic <a href="undocumented#Coons">Coons</a> patch: the interpolation of four <a href="#SkCanvas_drawPatch_cubics">cubics</a> with shared corners, +Draws a <a href="undocumented#Coons">Coons</a> patch: the interpolation of four <a href="#SkCanvas_drawPatch_cubics">cubics</a> with shared corners, associating a color, and optionally a texture coordinate, with each corner. The <a href="undocumented#Coons">Coons</a> patch uses <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>, <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPatch_paint">paint</a>'s <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, @@ -4801,8 +4794,8 @@ The <a href="undocumented#Coons">Coons</a> patch uses <a href="#Clip">Clip</a> a as the <a href="undocumented#Coons">Coons</a> patch texture; <a href="undocumented#Blend_Mode">Blend Mode</a> <a href="#SkCanvas_drawPatch_mode">mode</a> combines <a href="undocumented#Color">Color</a> <a href="#SkCanvas_drawPatch_colors">colors</a> and <a href="undocumented#Shader">Shader</a> if both are provided. -<a href="undocumented#Point">Point</a> array <a href="#SkCanvas_drawPatch_cubics">cubics</a> specifies four <a href="#SkCanvas_drawPatch_cubics">cubics</a> starting at the top left corner, -in clockwise order, sharing every fourth point. The last cubic ends at the +<a href="undocumented#Point">Point</a> array <a href="#SkCanvas_drawPatch_cubics">cubics</a> specifies four <a href="#Cubic">Cubics</a> starting at the top left corner, +in clockwise order, sharing every fourth point. The last <a href="#Cubic">Cubic</a> ends at the first point. <a href="undocumented#Color">Color</a> array color associates <a href="#SkCanvas_drawPatch_colors">colors</a> with corners in top left, top right, @@ -4818,7 +4811,7 @@ corners in top left, top right, bottom right, bottom left order. </tr> <tr> <td><a name="SkCanvas_drawPatch_colors"> <code><strong>colors </strong></code> </a></td> <td> <a href="undocumented#Color">Color</a> array, one for each corner</td> </tr> <tr> <td><a name="SkCanvas_drawPatch_texCoords"> <code><strong>texCoords </strong></code> </a></td> <td> -<a href="undocumented#Point">Point</a> array of texure coordinates, mapping <a href="undocumented#Shader">Shader</a> to corners; +<a href="undocumented#Point">Point</a> array of texture coordinates, mapping <a href="undocumented#Shader">Shader</a> to corners; may be nullptr</td> </tr> # <tr> <td><a name="SkCanvas_drawPatch_mode"> <code><strong>mode </strong></code> </a></td> <td> @@ -4839,7 +4832,7 @@ void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], const SkPaint& paint) </pre> -Draw a cubic <a href="undocumented#Coons">Coons</a> patch: the interpolation of four <a href="#SkCanvas_drawPatch_2_cubics">cubics</a> with shared corners, +Draws <a href="#Cubic">Cubic</a> <a href="undocumented#Coons">Coons</a> patch: the interpolation of four <a href="#SkCanvas_drawPatch_2_cubics">cubics</a> with shared corners, associating a color, and optionally a texture coordinate, with each corner. The <a href="undocumented#Coons">Coons</a> patch uses <a href="#Clip">Clip</a> and <a href="#Matrix">Matrix</a>, <a href="SkPaint_Reference#Paint">Paint</a> <a href="#SkCanvas_drawPatch_2_paint">paint</a>'s <a href="undocumented#Shader">Shader</a>, <a href="undocumented#Color_Filter">Color Filter</a>, @@ -4847,8 +4840,8 @@ The <a href="undocumented#Coons">Coons</a> patch uses <a href="#Clip">Clip</a> a as the <a href="undocumented#Coons">Coons</a> patch texture; <a href="undocumented#Blend_Mode">Blend Mode</a> mode combines <a href="undocumented#Color">Color</a> <a href="#SkCanvas_drawPatch_2_colors">colors</a> and <a href="undocumented#Shader">Shader</a> if both are provided. -<a href="undocumented#Point">Point</a> array <a href="#SkCanvas_drawPatch_2_cubics">cubics</a> specifies four <a href="#SkCanvas_drawPatch_2_cubics">cubics</a> starting at the top left corner, -in clockwise order, sharing every fourth point. The last cubic ends at the +<a href="undocumented#Point">Point</a> array <a href="#SkCanvas_drawPatch_2_cubics">cubics</a> specifies four <a href="#Cubic">Cubics</a> starting at the top left corner, +in clockwise order, sharing every fourth point. The last <a href="#Cubic">Cubic</a> ends at the first point. <a href="undocumented#Color">Color</a> array color associates <a href="#SkCanvas_drawPatch_2_colors">colors</a> with corners in top left, top right, @@ -4864,7 +4857,7 @@ corners in top left, top right, bottom right, bottom left order. </tr> <tr> <td><a name="SkCanvas_drawPatch_2_colors"> <code><strong>colors </strong></code> </a></td> <td> <a href="undocumented#Color">Color</a> array, one for each corner</td> </tr> <tr> <td><a name="SkCanvas_drawPatch_2_texCoords"> <code><strong>texCoords </strong></code> </a></td> <td> -<a href="undocumented#Point">Point</a> array of texure coordinates, mapping <a href="undocumented#Shader">Shader</a> to corners; +<a href="undocumented#Point">Point</a> array of texture coordinates, mapping <a href="undocumented#Shader">Shader</a> to corners; may be nullptr</td> </tr> # <tr> <td><a name="SkCanvas_drawPatch_2_paint"> <code><strong>paint </strong></code> </a></td> <td> @@ -4899,7 +4892,7 @@ to draw, if present. For each entry in the array, <a href="undocumented#Rect">Re <a href="#SkCanvas_drawAtlas_xform">xform</a>, text, and <a href="#SkCanvas_drawAtlas_colors">colors</a> if present, must contain <a href="#SkCanvas_drawAtlas_count">count</a> entries. Optional <a href="#SkCanvas_drawAtlas_colors">colors</a> are applied for each sprite using <a href="undocumented#Blend_Mode">Blend Mode</a>. Optional <a href="#SkCanvas_drawAtlas_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If cullrect is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +If <a href="#SkCanvas_drawAtlas_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. ### Parameters @@ -4942,7 +4935,7 @@ to draw, if present. For each entry in the array, <a href="undocumented#Rect">Re <a href="#SkCanvas_drawAtlas_2_xform">xform</a>, text, and <a href="#SkCanvas_drawAtlas_2_colors">colors</a> if present, must contain <a href="#SkCanvas_drawAtlas_2_count">count</a> entries. Optional <a href="#SkCanvas_drawAtlas_2_colors">colors</a> is applied for each sprite using <a href="undocumented#Blend_Mode">Blend Mode</a>. Optional <a href="#SkCanvas_drawAtlas_2_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If cullrect is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +If <a href="#SkCanvas_drawAtlas_2_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. ### Parameters @@ -4983,7 +4976,7 @@ to draw, if present. For each entry in the array, <a href="undocumented#Rect">Re <a href="#SkCanvas_drawAtlas_3_xform">xform</a> and text must contain <a href="#SkCanvas_drawAtlas_3_count">count</a> entries. Optional <a href="#SkCanvas_drawAtlas_3_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If cullrect is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +If <a href="#SkCanvas_drawAtlas_3_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. ### Parameters @@ -5021,7 +5014,7 @@ to draw, if present. For each entry in the array, <a href="undocumented#Rect">Re <a href="#SkCanvas_drawAtlas_4_xform">xform</a> and text must contain <a href="#SkCanvas_drawAtlas_4_count">count</a> entries. Optional <a href="#SkCanvas_drawAtlas_4_cullRect">cullRect</a> is a conservative bounds of all transformed sprites. -If cullrect is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. +If <a href="#SkCanvas_drawAtlas_4_cullRect">cullRect</a> is outside of <a href="#Clip">Clip</a>, canvas can skip drawing. ### Parameters diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md index 94168b052e..cbb77e720d 100644 --- a/site/user/api/SkPaint_Reference.md +++ b/site/user/api/SkPaint_Reference.md @@ -21,7 +21,7 @@ algorithms that alter the drawing geometry, color, and transparency. For instanc The objects contained by <a href="#Paint">Paint</a> are opaque, and cannot be edited outside of the <a href="#Paint">Paint</a> to affect it. The implementation is free to defer computations associated with the <a href="#Paint">Paint</a>, or ignore them altogether. For instance, some <a href="undocumented#GPU">GPU</a> implementations draw all -<a href="SkPath_Reference#Path">Path</a> geometries with anti-aliasing, regardless of how <a href="#SkPaint_kAntiAlias_Flag">SkPaint::kAntiAlias Flag</a> +<a href="SkPath_Reference#Path">Path</a> geometries with <a href="undocumented#Anti_alias">Anti-aliasing</a>, regardless of how <a href="#SkPaint_kAntiAlias_Flag">SkPaint::kAntiAlias Flag</a> is set in <a href="#Paint">Paint</a>. <a href="#Paint">Paint</a> describes a single color, a single font, a single image quality, and so on. @@ -37,14 +37,14 @@ Multiple colors are drawn either by using multiple paints or with objects like | topics | description | | --- | --- | | <a href="#Initializers">Initializers</a> | Constructors and initialization. | -| <a href="#Destructor">Destructor</a> | <a href="#Paint">Paint</a> termination. | +| <a href="undocumented#Destructor">Destructor</a> | <a href="#Paint">Paint</a> termination. | | <a href="#Management">Management</a> | <a href="#Paint">Paint</a> copying, moving, comparing. | | <a href="#SkPaint_Hinting">Hinting</a> | <a href="undocumented#Glyph">Glyph</a> outline adjustment. | | <a href="#SkPaint_Flags">Flags</a> | Attributes represented by single bits. | | <a href="SkPaint_Reference#Anti_alias">Anti-alias</a> | Approximating coverage with transparency. | | <a href="#Dither">Dither</a> | Distributing color error. | | <a href="#Device_Text">Device Text</a> | Increase precision of glyph position. | -| <a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> | Custom-sized bitmap glyphs. | +| <a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> | Custom sized bitmap <a href="#Glyph">Glyphs</a>. | | <a href="#Automatic_Hinting">Automatic Hinting</a> | Always adjust glyph paths. | | <a href="#Vertical_Text">Vertical Text</a> | Orient text from top to bottom. | | <a href="#Fake_Bold">Fake Bold</a> | Approximate font styles. | @@ -70,12 +70,12 @@ Multiple colors are drawn either by using multiple paints or with objects like | <a href="#Text_Size">Text Size</a> | Overall height in points. | | <a href="#Text_Scale_X">Text Scale X</a> | <a href="undocumented#Text">Text</a> horizontal scale. | | <a href="#Text_Skew_X">Text Skew X</a> | <a href="undocumented#Text">Text</a> horizontal slant. | -| <a href="#Text_Encoding">Text Encoding</a> | <a href="undocumented#Text">Text</a> encoded as characters or glyphs. | +| <a href="#Text_Encoding">Text Encoding</a> | <a href="undocumented#Text">Text</a> encoded as characters or <a href="#Glyph">Glyphs</a>. | | <a href="#Font_Metrics">Font Metrics</a> | Common glyph dimensions. | | <a href="#Measure_Text">Measure Text</a> | Width, height, bounds of text. | -| <a href="#Text_Path">Text Path</a> | Geometry of glyphs. | +| <a href="#Text_Path">Text Path</a> | Geometry of <a href="#Glyph">Glyphs</a>. | | <a href="#Text_Intercepts">Text Intercepts</a> | Advanced underline, strike through. | -| <a href="#Fast_Bounds">Fast Bounds</a> | Appproxiate area required by <a href="#Paint">Paint</a>. | +| <a href="#Fast_Bounds">Fast Bounds</a> | Approximate area required by <a href="#Paint">Paint</a>. | ## <a name="Constants"></a> Constants @@ -122,12 +122,12 @@ Multiple colors are drawn either by using multiple paints or with objects like | <a href="#SkPaint_canComputeFastBounds">canComputeFastBounds</a> | Returns true if settings allow for fast bounds computation. | | <a href="#SkPaint_computeFastBounds">computeFastBounds</a> | Returns fill bounds for quick reject tests. | | <a href="#SkPaint_computeFastStrokeBounds">computeFastStrokeBounds</a> | Returns stroke bounds for quick reject tests. | -| <a href="#SkPaint_containsText">containsText</a> | Returns if all text corresponds to glyphs. | -| <a href="#SkPaint_countText">countText</a> | Returns number of glyphs in text. | +| <a href="#SkPaint_containsText">containsText</a> | Returns if all text corresponds to <a href="#Glyph">Glyphs</a>. | +| <a href="#SkPaint_countText">countText</a> | Returns number of <a href="#Glyph">Glyphs</a> in text. | | <a href="#SkPaint_doComputeFastBounds">doComputeFastBounds</a> | Returns bounds for quick reject tests. | | <a href="#SkPaint_flatten">flatten</a> | Serializes into a buffer. | | <a href="#SkPaint_getAlpha">getAlpha</a> | Returns <a href="#Alpha">Color Alpha</a>, color opacity. | -| <a href="#SkPaint_getBlendMode">getBlendMode</a> | Returns <a href="undocumented#Blend_Mode">Blend Mode</a>, how colors combine with dest. | +| <a href="#SkPaint_getBlendMode">getBlendMode</a> | Returns <a href="undocumented#Blend_Mode">Blend Mode</a>, how colors combine with <a href="undocumented#Device">Device</a>. | | <a href="#SkPaint_getColor">getColor</a> | Returns <a href="#Alpha">Color Alpha</a> and <a href="#RGB">Color RGB</a>, one drawing color. | | <a href="#SkPaint_getColorFilter">getColorFilter</a> | Returns <a href="undocumented#Color_Filter">Color Filter</a>, how colors are altered. | | <a href="#SkPaint_getDrawLooper">getDrawLooper</a> | Returns <a href="undocumented#Draw_Looper">Draw Looper</a>, multiple layers. | @@ -162,9 +162,9 @@ Multiple colors are drawn either by using multiple paints or with objects like | <a href="#SkPaint_getTextSize">getTextSize</a> | Returns text size in points. | | <a href="#SkPaint_getTextWidths">getTextWidths</a> | Returns advance and bounds for each glyph in text. | | <a href="#SkPaint_getTypeface">getTypeface</a> | Returns <a href="undocumented#Typeface">Typeface</a>, font description. | -| <a href="#SkPaint_glyphsToUnichars">glyphsToUnichars</a> | Converts glyphs into text. | +| <a href="#SkPaint_glyphsToUnichars">glyphsToUnichars</a> | Converts <a href="#Glyph">Glyphs</a> into text. | | <a href="#SkPaint_isAntiAlias">isAntiAlias</a> | Returns true if <a href="SkPaint_Reference#Anti_alias">Anti-alias</a> is set. | -| <a href="#SkPaint_isAutohinted">isAutohinted</a> | Returns true if glyphs are always hinted. | +| <a href="#SkPaint_isAutohinted">isAutohinted</a> | Returns true if <a href="#Glyph">Glyphs</a> are always hinted. | | <a href="#SkPaint_isDevKernText">isDevKernText</a> | Returns true if <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> is set. | | <a href="#SkPaint_isDither">isDither</a> | Returns true if <a href="#Dither">Dither</a> is set. | | <a href="#SkPaint_isEmbeddedBitmapText">isEmbeddedBitmapText</a> | Returns true if <a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> is set. | @@ -187,7 +187,7 @@ Multiple colors are drawn either by using multiple paints or with objects like | <a href="#SkPaint_setAlpha">setAlpha</a> | Sets <a href="#Alpha">Color Alpha</a>, color opacity. | | <a href="#SkPaint_setAntiAlias">setAntiAlias</a> | Sets or clears <a href="SkPaint_Reference#Anti_alias">Anti-alias</a>. | | <a href="#SkPaint_setARGB">setARGB</a> | Sets color by component. | -| <a href="#SkPaint_setAutohinted">setAutohinted</a> | Sets glyphs to always be hinted. | +| <a href="#SkPaint_setAutohinted">setAutohinted</a> | Sets <a href="#Glyph">Glyphs</a> to always be hinted. | | <a href="#SkPaint_setBlendMode">setBlendMode</a> | Sets <a href="undocumented#Blend_Mode">Blend Mode</a>, how colors combine with destination. | | <a href="#SkPaint_setColor">setColor</a> | Sets <a href="#Alpha">Color Alpha</a> and <a href="#RGB">Color RGB</a>, one drawing color. | | <a href="#SkPaint_setColorFilter">setColorFilter</a> | Sets <a href="undocumented#Color_Filter">Color Filter</a>, alters color. | @@ -219,7 +219,7 @@ Multiple colors are drawn either by using multiple paints or with objects like | <a href="#SkPaint_setTypeface">setTypeface</a> | Sets <a href="undocumented#Typeface">Typeface</a>, font description. | | <a href="#SkPaint_setVerticalText">setVerticalText</a> | Sets or clears <a href="#Vertical_Text">Vertical Text</a>. | | <a href="#SkPaint_textToGlyphs">textToGlyphs</a> | Converts text into glyph indices. | -| <a href="#SkPaint_toString">toString</a> | Converts <a href="#Paint">Paint</a> to machine parsable form (<a href="undocumented#Developer_Mode">Developer Mode</a>) | +| <a href="#SkPaint_toString">toString</a> | Converts <a href="#Paint">Paint</a> to machine readable form. | | <a href="#SkPaint_unflatten">unflatten</a> | Populates from a serialized stream. | # <a name="Initializers"></a> Initializers @@ -270,7 +270,7 @@ Constructs <a href="#Paint">Paint</a> with default values. | <a href="#Vertical_Text">Vertical Text</a> | false | The flags, text size, hinting, and miter limit may be overridden at compile time by defining -paint default values. The overrides may be included in <a href="undocumented#SkUserConfig.h">SkUserConfig.h</a> or predefined by the +paint default values. The overrides may be included in "<a href="undocumented#SkUserConfig">SkUserConfig</a>.h" or predefined by the build system. ### Return Value @@ -643,7 +643,7 @@ by the client. ### Parameters <table> <tr> <td><a name="SkPaint_unflatten_buffer"> <code><strong>buffer </strong></code> </a></td> <td> -serialized data to <a href="#SkPaint_unflatten">unflatten</a></td> +serialized data describing <a href="#Paint">Paint</a> content</td> </tr> </table> @@ -683,7 +683,7 @@ to 26.6 fractional pixels.</td> With <a href="undocumented#FreeType">FreeType</a>, this is equivalent in spirit to the <a href="undocumented#FT_LOAD_TARGET_LIGHT">FT LOAD TARGET LIGHT</a> value supplied to <a href="undocumented#FT_Load_Glyph">FT Load Glyph</a>. It chooses a lighter hinting algorithm for non-monochrome modes. -Generated glyphs may be fuzzy but better resemble their original shape.</td> +Generated <a href="#Glyph">Glyphs</a> may be fuzzy but better resemble their original shape.</td> </tr> <tr> <td><a name="SkPaint_kNormal_Hinting"> <code><strong>SkPaint::kNormal_Hinting </strong></code> </a></td><td>2</td><td>Modifies glyph outlines to improve constrast. This is the default. @@ -747,9 +747,9 @@ Does not check for valid values of <a href="#SkPaint_setHinting_hintingLevel">hi | <a href="#Hinting">Hinting</a> | value | effect on generated glyph outlines | | --- | --- | --- | | <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> | 0 | leaves glyph outlines unchanged from their native representation | -| <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a> | 1 | modifies glyph outlines minimally to improve constrast | -| <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> | 2 | modifies glyph outlines to improve constrast | -| <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> | 3 | modifies glyph outlines for maxiumum constrast | +| <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a> | 1 | modifies glyph outlines minimally to improve contrast | +| <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> | 2 | modifies glyph outlines to improve contrast | +| <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> | 3 | modifies glyph outlines for maximum contrast | ### Parameters @@ -929,17 +929,17 @@ paint.isDither() If <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is clear, pixel centers contained by the shape edge are drawn opaque. If <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is set, pixels are drawn with <a href="#Alpha">Color Alpha</a> equal to their coverage. -The rule for aliased pixels is inconsistent across platforms. A shape edge +The rule for <a href="#Alias">Aliased</a> pixels is inconsistent across platforms. A shape edge passing through the pixel center may, but is not required to, draw the pixel. -<a href="undocumented#Raster_Engine">Raster Engine</a> draws aliased pixels whose centers are on or to the right of the start of an +<a href="undocumented#Raster_Engine">Raster Engine</a> draws <a href="#Alias">Aliased</a> pixels whose centers are on or to the right of the start of an active <a href="SkPath_Reference#Path">Path</a> edge, and whose center is to the left of the end of the active <a href="SkPath_Reference#Path">Path</a> edge. -A platform may only support anti-aliased drawing. Some <a href="undocumented#GPU_backed">GPU-backed</a> platforms use -supersampling to anti-alias all drawing, and have no mechanism to selectively -alias. +A platform may only support <a href="undocumented#Anti_alias">Anti-aliased</a> drawing. Some <a href="undocumented#GPU_backed">GPU-backed</a> platforms use +<a href="undocumented#Supersampling">Supersampling</a> to <a href="SkPaint_Reference#Anti_alias">Anti-alias</a> all drawing, and have no mechanism to selectively +<a href="undocumented#Alias">Alias</a>. -The amount of coverage computed for anti-aliased pixels also varies across platforms. +The amount of coverage computed for <a href="undocumented#Anti_alias">Anti-aliased</a> pixels also varies across platforms. <a href="SkPaint_Reference#Anti_alias">Anti-alias</a> is disabled by default. <a href="SkPaint_Reference#Anti_alias">Anti-alias</a> can be enabled by default by setting <a href="undocumented#SkPaintDefaults_Flags">SkPaintDefaults Flags</a> to <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> @@ -949,8 +949,8 @@ at compile time. <div><fiddle-embed name="a6575a49467ce8d28bb01cc7638fa04d"><div>A red line is drawn with transparency on the edges to make it look smoother. A blue line draws only where the pixel centers are contained. -The lines are drawn into an offscreen bitmap, then drawn magified to make the -aliasing easier to see.</div></fiddle-embed></div> +The lines are drawn into <a href="undocumented#Bitmap">Bitmap</a>, then drawn magnified to make the +<a href="#Alias">Aliasing</a> easier to see.</div></fiddle-embed></div> <a name="SkPaint_isAntiAlias"></a> ## isAntiAlias @@ -1017,7 +1017,7 @@ paint1 == paint2 --- # <a name="Dither"></a> Dither -<a href="#Dither">Dither</a> increases fidelity by adjusting the color of adjcent pixels. +<a href="#Dither">Dither</a> increases fidelity by adjusting the color of adjacent pixels. This can help to smooth color transitions and reducing banding in gradients. Dithering lessens visible banding from <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> and <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a> gradients, @@ -1120,7 +1120,7 @@ Gradient <a href="undocumented#RGB_565">Color RGB-565</a> When set, <a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> takes advantage of the organization of <a href="#RGB">Color RGB</a> stripes that create a color, and relies -on the small size of the stripe and visual perception to make the color fringing inperceptible. +on the small size of the stripe and visual perception to make the color fringing imperceptible. <a href="SkPaint_Reference#LCD_Text">LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order the color components as <a href="#RGB">Color RGB</a> or <a href="#RBG">Color RBG</a>. @@ -1136,8 +1136,8 @@ Either or both techniques can be enabled. ### Example <div><fiddle-embed name="4606ae1be792d6bc46d496432f050ee9"><div>Four commas are drawn normally and with combinations of <a href="SkPaint_Reference#LCD_Text">LCD Text</a> and <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a>. -When <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a> is disabled, the comma glyphs are indentical, but not evenly spaced. -When <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a> is enabled, the comma glyphs are unique, but appear evenly spaced.</div></fiddle-embed></div> +When <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a> is disabled, the comma <a href="#Glyph">Glyphs</a> are identical, but not evenly spaced. +When <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a> is enabled, the comma <a href="#Glyph">Glyphs</a> are unique, but appear evenly spaced.</div></fiddle-embed></div> ## <a name="Linear_Text"></a> Linear Text @@ -1213,7 +1213,7 @@ of the color increases, the edge of the glyph appears to move towards the outsid bool isSubpixelText() const </pre> -If true, glyphs at different sub-pixel positions may differ on pixel edge coverage. +If true, <a href="#Glyph">Glyphs</a> at different sub-pixel positions may differ on pixel edge coverage. Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a>. @@ -1243,7 +1243,7 @@ paint.isSubpixelText() == !!(paint.getFlags() & SkPaint::kSubpixelText_Flag) void setSubpixelText(bool subpixelText) </pre> -Requests, but does not require, that glyphs respect sub-pixel positioning. +Requests, but does not require, that <a href="#Glyph">Glyphs</a> respect sub-pixel positioning. Sets <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> if <a href="#SkPaint_setSubpixelText_subpixelText">subpixelText</a> is true. Clears <a href="#SkPaint_kSubpixelText_Flag">kSubpixelText Flag</a> if <a href="#SkPaint_setSubpixelText_subpixelText">subpixelText</a> is false. @@ -1273,7 +1273,7 @@ paint1 == paint2 When set, <a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> takes advantage of the organization of <a href="#RGB">Color RGB</a> stripes that create a color, and relies -on the small size of the stripe and visual perception to make the color fringing inperceptible. +on the small size of the stripe and visual perception to make the color fringing imperceptible. <a href="SkPaint_Reference#LCD_Text">LCD Text</a> can be enabled on devices that orient stripes horizontally or vertically, and that order the color components as <a href="#RGB">Color RGB</a> or <a href="#RBG">Color RBG</a>. @@ -1284,7 +1284,7 @@ the color components as <a href="#RGB">Color RGB</a> or <a href="#RBG">Color RBG bool isLCDRenderText() const </pre> -If true, glyphs may use <a href="undocumented#LCD">LCD</a> striping to improve glyph edges. +If true, <a href="#Glyph">Glyphs</a> may use <a href="undocumented#LCD">LCD</a> striping to improve glyph edges. Returns true if <a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> is set. @@ -1314,7 +1314,7 @@ paint.isLCDRenderText() == !!(paint.getFlags() & SkPaint::kLCDRenderText_Flag) void setLCDRenderText(bool lcdText) </pre> -Requests, but does not require, that glyphs use <a href="undocumented#LCD">LCD</a> striping for glyph edges. +Requests, but does not require, that <a href="#Glyph">Glyphs</a> use <a href="undocumented#LCD">LCD</a> striping for glyph edges. Sets <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> if <a href="#SkPaint_setLCDRenderText_lcdText">lcdText</a> is true. Clears <a href="#SkPaint_kLCDRenderText_Flag">kLCDRenderText Flag</a> if <a href="#SkPaint_setLCDRenderText_lcdText">lcdText</a> is false. @@ -1341,7 +1341,7 @@ paint1 == paint2 --- # <a name="Font_Embedded_Bitmaps"></a> Font Embedded Bitmaps -<a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> allows selecting custom-sized bitmap glyphs. +<a href="SkPaint_Reference#Font_Embedded_Bitmaps">Font Embedded Bitmaps</a> allows selecting custom sized bitmap <a href="#Glyph">Glyphs</a>. <a href="#SkPaint_Flags">Flags</a> <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> when set chooses an embedded bitmap glyph over an outline contained in a font if the platform supports this option. @@ -1357,10 +1357,11 @@ the outline glyph if <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmap ### Example <pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0"> -!fiddle<div>The hintgasp <a href="undocumented#TrueType">TrueType</a> font in the <a href="undocumented#Skia">Skia</a> resources/fonts directory includes an embedded -bitmap glyph at odd font sizes. This example works on platforms that use <a href="undocumented#FreeType">FreeType</a> -as their <a href="#Engine">Font Engine</a>. -<a href="undocumented#Windows">Windows</a> may, but is not required to, return a bitmap glyph if <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is set.</div><a href="undocumented#SkBitmap">SkBitmap</a> bitmap; +<div>The "" <a href="undocumented#TrueType">TrueType</a> font in the <a href="undocumented#Skia">Skia</a> resources/fonts directory +includes an embedded bitmap <a href="undocumented#Glyph">Glyph</a> at odd font sizes. This example works +on platforms that use <a href="undocumented#FreeType">FreeType</a> as their <a href="#Engine">Font Engine</a>. +<a href="undocumented#Windows">Windows</a> may, but is not required to, return a bitmap glyph if +<a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is set.</div><a href="undocumented#SkBitmap">SkBitmap</a> bitmap; bitmap.allocN32Pixels(30, 15); bitmap.eraseColor(0); <a href="SkCanvas_Reference#SkCanvas">SkCanvas</a> offscreen(bitmap); @@ -1374,7 +1375,7 @@ paint.</pre> bool isEmbeddedBitmapText() const </pre> -If true, <a href="#Engine">Font Engine</a> may return glyphs from font bitmaps instead of from outlines. +If true, <a href="#Engine">Font Engine</a> may return <a href="#Glyph">Glyphs</a> from font bitmaps instead of from outlines. Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a>. @@ -1432,7 +1433,7 @@ paint1 == paint2 # <a name="Automatic_Hinting"></a> Automatic Hinting If <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> or <a href="#SkPaint_kFull_Hinting">kFull Hinting</a>, <a href="#Automatic_Hinting">Automatic Hinting</a> -instructs the <a href="undocumented#Font_Manager">Font Manager</a> to always hint glyphs. +instructs the <a href="undocumented#Font_Manager">Font Manager</a> to always hint <a href="#Glyph">Glyphs</a>. <a href="#Automatic_Hinting">Automatic Hinting</a> has no effect if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> or <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a>. @@ -1447,7 +1448,7 @@ bool isAutohinted() const If true, and if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> or <a href="#SkPaint_kFull_Hinting">kFull Hinting</a>, and if platform uses <a href="undocumented#FreeType">FreeType</a> as the <a href="undocumented#Font_Manager">Font Manager</a>, instruct the <a href="undocumented#Font_Manager">Font Manager</a> to always hint -glyphs. +<a href="#Glyph">Glyphs</a>. Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a>. @@ -1482,7 +1483,7 @@ void setAutohinted(bool useAutohinter) </pre> If <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a> or <a href="#SkPaint_kFull_Hinting">kFull Hinting</a> and <a href="#SkPaint_setAutohinted_useAutohinter">useAutohinter</a> is set, -instruct the <a href="undocumented#Font_Manager">Font Manager</a> to always hint glyphs. +instruct the <a href="undocumented#Font_Manager">Font Manager</a> to always hint <a href="#Glyph">Glyphs</a>. <a href="#Automatic_Hinting">Automatic Hinting</a> has no effect if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a> or <a href="#SkPaint_kSlight_Hinting">kSlight Hinting</a>. @@ -1510,14 +1511,14 @@ setting for <a href="#SkPaint_kAutoHinting_Flag">kAutoHinting Flag</a></td> # <a name="Vertical_Text"></a> Vertical Text <a href="undocumented#Text">Text</a> may be drawn by positioning each glyph, or by positioning the first glyph and -using <a href="#Advance">Font Advance</a> to position subsequent glyphs. By default, each successive glyph -is positioned to the right of the preceeding glyph. <a href="#Vertical_Text">Vertical Text</a> sets successive -glyphs to position below the preceeding glyph. +using <a href="#Advance">Font Advance</a> to position subsequent <a href="#Glyph">Glyphs</a>. By default, each successive glyph +is positioned to the right of the preceding glyph. <a href="#Vertical_Text">Vertical Text</a> sets successive +<a href="#Glyph">Glyphs</a> to position below the preceding glyph. -<a href="undocumented#Skia">Skia</a> can translate text character codes as a series of glyphs, but does not implement +<a href="undocumented#Skia">Skia</a> can translate text character codes as a series of <a href="#Glyph">Glyphs</a>, but does not implement font substitution, -textual substitution, line layout, or contextual spacing like kerning pairs. Use -a text shaping engine likeHarfBuzzhttp://harfbuzz.org/to translate text runs +textual substitution, line layout, or contextual spacing like <a href="undocumented#Kerning">Kerning</a> pairs. Use +a text shaping engine likeHarfBuzzto translate text runs into glyph series. <a href="#Vertical_Text">Vertical Text</a> is clear if text is drawn left to right or set if drawn from top to bottom. @@ -1540,7 +1541,7 @@ into glyph series. bool isVerticalText() const </pre> -If true, glyphs are drawn top to bottom instead of left to right. +If true, <a href="#Glyph">Glyphs</a> are drawn top to bottom instead of left to right. Equivalent to <a href="#SkPaint_getFlags">getFlags</a> masked with <a href="#SkPaint_kVerticalText_Flag">kVerticalText Flag</a>. @@ -1605,8 +1606,8 @@ bold font face using the platform's <a href="undocumented#Font_Manager">Font Man Use <a href="#Text_Skew_X">Text Skew X</a> to approximate an italic font style when the italic font face is not available. -A <a href="undocumented#FreeType_based">FreeType-based</a> port may define <a href="undocumented#SK_USE_FREETYPE_EMBOLDEN">SK USE FREETYPE EMBOLDEN</a> at compile time to direct -the font engine to create the bold glyphs. Otherwise, the extra bold is computed +A <a href="undocumented#FreeType">FreeType</a> based port may define <a href="undocumented#SK_USE_FREETYPE_EMBOLDEN">SK USE FREETYPE EMBOLDEN</a> at compile time to direct +the font engine to create the bold <a href="#Glyph">Glyphs</a>. Otherwise, the extra bold is computed by increasing the stroke width and setting the <a href="#SkPaint_Style">Style</a> to <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a> as needed. <a href="#Fake_Bold">Fake Bold</a> is disabled by default. @@ -1653,7 +1654,7 @@ paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag) void setFakeBoldText(bool fakeBoldText) </pre> -Use increased stroke width when creating glyph bitmaps to approximate bolding. +Use increased stroke width when creating glyph bitmaps to approximate a bold typeface. Sets <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> if <a href="#SkPaint_setFakeBoldText_fakeBoldText">fakeBoldText</a> is true. Clears <a href="#SkPaint_kFakeBoldText_Flag">kFakeBoldText Flag</a> if <a href="#SkPaint_setFakeBoldText_fakeBoldText">fakeBoldText</a> is false. @@ -1680,13 +1681,13 @@ paint1 == paint2 --- # <a name="Full_Hinting_Spacing"></a> Full Hinting Spacing -<a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> adjusts the character spacing by the difference of the -hinted and unhinted left and right side bearings, -if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kFull_Hinting">kFull Hinting</a>. <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> only -applies to platforms that use <a href="undocumented#FreeType">FreeType</a> as their <a href="#Engine">Font Engine</a>. +if <a href="#SkPaint_Hinting">Hinting</a> is set to <a href="#SkPaint_kFull_Hinting">kFull Hinting</a>, <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> adjusts the character +spacing by the difference of the hinted and <a href="undocumented#Unhinted">Unhinted</a> <a href="undocumented#Left_Side_Bearing">Left Side Bearing</a> and +<a href="undocumented#Right_Side_Bearing">Right Side Bearing</a>. <a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> only applies to platforms that use +<a href="undocumented#FreeType">FreeType</a> as their <a href="#Engine">Font Engine</a>. -<a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> is not related to text kerning, where the space between -a specific pair of characters is adjusted using data in the font's kerning tables. +<a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> is not related to text <a href="undocumented#Kerning">Kerning</a>, where the space between +a specific pair of characters is adjusted using data in the font's <a href="undocumented#Kerning">Kerning</a> tables. <a name="SkPaint_isDevKernText"></a> ## isDevKernText @@ -1746,8 +1747,8 @@ paint1 == paint2 <a href="undocumented#Filter_Quality">Filter Quality</a> trades speed for image filtering when the image is scaled. A lower <a href="undocumented#Filter_Quality">Filter Quality</a> draws faster, but has less fidelity. A higher <a href="undocumented#Filter_Quality">Filter Quality</a> draws slower, but looks better. -If the image is unscaled, the <a href="undocumented#Filter_Quality">Filter Quality</a> choice will not result in a noticable -difference. +If the image is drawn without scaling, the <a href="undocumented#Filter_Quality">Filter Quality</a> choice will not result +in a noticeable difference. <a href="undocumented#Filter_Quality">Filter Quality</a> is used in <a href="#Paint">Paint</a> passed as a parameter to @@ -1838,7 +1839,7 @@ or stroked shape in a 32-bit value. Each component occupies 8-bits, ranging from zero: no contribution; to 255: full intensity. All values in any combination are valid. -<a href="undocumented#Color">Color</a> is not premultiplied; +<a href="undocumented#Color">Color</a> is not <a href="#Premultiply">Premultiplied</a>; <a href="#Alpha">Color Alpha</a> sets the transparency independent of <a href="#RGB">Color RGB</a>: <a href="#RGB_Red">Color RGB Red</a>, <a href="#RGB_Blue">Color RGB Blue</a>, and <a href="#RGB_Green">Color RGB Green</a>. The bit positions of <a href="#Alpha">Color Alpha</a> and <a href="#RGB">Color RGB</a> are independent of the bit positions @@ -1859,13 +1860,13 @@ on the output device, which may have more or fewer bits, and may have a differen SkColor getColor() const </pre> -Retrieves <a href="#Alpha">Color Alpha</a> and <a href="#RGB">Color RGB</a>, unpremultiplied, packed into 32 bits. +Retrieves <a href="#Alpha">Alpha</a> and <a href="#RGB">Color RGB</a>, <a href="#Unpremultiply">Unpremultiplied</a>, packed into 32 bits. Use helpers <a href="undocumented#SkColorGetA">SkColorGetA</a>, <a href="undocumented#SkColorGetR">SkColorGetR</a>, <a href="undocumented#SkColorGetG">SkColorGetG</a>, and <a href="undocumented#SkColorGetB">SkColorGetB</a> to extract a color component. ### Return Value -<a href="undocumented#Unpremultiplied">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a> +<a href="#Unpremultiply">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a> ### Example @@ -1892,13 +1893,13 @@ Yellow is 100% red, 100% green, and 0% blue. void setColor(SkColor color) </pre> -Sets <a href="#Alpha">Color Alpha</a> and <a href="#RGB">Color RGB</a> used when stroking and filling. The <a href="#SkPaint_setColor_color">color</a> is a 32-bit value, -unpremutiplied, packing 8-bit components for <a href="#Alpha">Color Alpha</a>, <a href="#RGB_Red">Color RGB Red</a>, <a href="#RGB_Blue">Color RGB Blue</a>, and <a href="#RGB_Green">Color RGB Green</a>. +Sets <a href="#Alpha">Alpha</a> and <a href="#RGB">Color RGB</a> used when stroking and filling. The <a href="#SkPaint_setColor_color">color</a> is a 32-bit value, +<a href="#Unpremultiply">Unpremultiplied</a>, packing 8-bit components for <a href="#Alpha">Alpha</a>, <a href="#Red">Red</a>, <a href="#Blue">Blue</a>, and <a href="#Green">Green</a>. ### Parameters <table> <tr> <td><a name="SkPaint_setColor_color"> <code><strong>color </strong></code> </a></td> <td> -<a href="undocumented#Unpremultiplied">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a></td> +<a href="#Unpremultiply">Unpremultiplied</a> <a href="#ARGB">Color ARGB</a></td> </tr> </table> @@ -1931,11 +1932,11 @@ green1 == green2 uint8_t getAlpha() const </pre> -Retrieves <a href="#Alpha">Color Alpha</a> from the <a href="undocumented#Color">Color</a> used when stroking and filling. +Retrieves <a href="#Alpha">Alpha</a> from the <a href="undocumented#Color">Color</a> used when stroking and filling. ### Return Value -<a href="#Alpha">Color Alpha</a> ranging from zero, fully transparent, to 255, fully opaque +<a href="#Alpha">Alpha</a> ranging from zero, fully transparent, to 255, fully opaque ### Example @@ -1958,7 +1959,7 @@ Retrieves <a href="#Alpha">Color Alpha</a> from the <a href="undocumented#Color" void setAlpha(U8CPU a) </pre> -Replaces <a href="#Alpha">Color Alpha</a>, leaving <a href="#RGB">Color RGB</a> +Replaces <a href="#Alpha">Alpha</a>, leaving <a href="#RGB">Color RGB</a> unchanged. An out of range value triggers an assert in the debug build. <a href="#SkPaint_setAlpha_a">a</a> is <a href="#SkPaint_setAlpha_a">a</a> value from zero to 255. <a href="#SkPaint_setAlpha_a">a</a> set to zero makes <a href="undocumented#Color">Color</a> fully transparent; <a href="#SkPaint_setAlpha_a">a</a> set to 255 makes <a href="undocumented#Color">Color</a> @@ -1967,7 +1968,7 @@ fully opaque. ### Parameters <table> <tr> <td><a name="SkPaint_setAlpha_a"> <code><strong>a </strong></code> </a></td> <td> -<a href="#Alpha">Color Alpha</a> component of <a href="undocumented#Color">Color</a></td> +<a href="#Alpha">Alpha</a> component of <a href="undocumented#Color">Color</a></td> </tr> </table> @@ -1993,8 +1994,7 @@ void setARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) </pre> Sets <a href="undocumented#Color">Color</a> used when drawing solid fills. The color components range from 0 to 255. -The color is unpremultiplied; -<a href="#Alpha">Color Alpha</a> sets the transparency independent of <a href="#RGB">Color RGB</a>. +The color is <a href="#Unpremultiply">Unpremultiplied</a>; <a href="#Alpha">Alpha</a> sets the transparency independent of <a href="#RGB">Color RGB</a>. ### Parameters @@ -2085,8 +2085,8 @@ a fill draw. <table> <tr> <td><a name="SkPaint_kFill_Style"> <code><strong>SkPaint::kFill_Style </strong></code> </a></td><td>0</td><td>Set to fill geometry. -Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, <a href="undocumented#Oval">Oval</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. -<a href="undocumented#Bitmap">Bitmap</a>, <a href="undocumented#Image">Image</a>, <a href="undocumented#Patch">Patch</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Sprite">Sprite</a>, and <a href="undocumented#Vertices">Vertices</a> are painted as if +Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. +<a href="undocumented#Bitmap">Bitmap</a>, <a href="undocumented#Image">Image</a>, <a href="#Patch">Patches</a>, <a href="undocumented#Region">Region</a>, <a href="#Sprite">Sprites</a>, and <a href="undocumented#Vertices">Vertices</a> are painted as if <a href="#SkPaint_kFill_Style">kFill Style</a> is set, and ignore the set <a href="#SkPaint_Style">Style</a>. The <a href="#Fill_Type">Path Fill Type</a> specifies additional rules to fill the area outside the path edge, and to create an unfilled hole inside the shape. @@ -2094,15 +2094,14 @@ and to create an unfilled hole inside the shape. </tr> <tr> <td><a name="SkPaint_kStroke_Style"> <code><strong>SkPaint::kStroke_Style </strong></code> </a></td><td>1</td><td>Set to stroke geometry. -Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Arc">Arc</a>, <a href="undocumented#Circle">Circle</a>, <a href="undocumented#Oval">Oval</a>, -<a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. -<a href="undocumented#Arc">Arc</a>, <a href="undocumented#Line">Line</a>, <a href="undocumented#Point">Point</a>, and <a href="#Array">Point Array</a> are always drawn as if <a href="#SkPaint_kStroke_Style">kStroke Style</a> is set, +Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Arc">Arcs</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. +<a href="#Arc">Arcs</a>, <a href="#Line">Lines</a>, and <a href="#Point">Points</a>, are always drawn as if <a href="#SkPaint_kStroke_Style">kStroke Style</a> is set, and ignore the set <a href="#SkPaint_Style">Style</a>. The stroke construction is unaffected by the <a href="#Fill_Type">Path Fill Type</a>.</td> </tr> <tr> <td><a name="SkPaint_kStrokeAndFill_Style"> <code><strong>SkPaint::kStrokeAndFill_Style </strong></code> </a></td><td>2</td><td>Set to stroke and fill geometry. -Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, <a href="undocumented#Oval">Oval</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. +Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. <a href="SkPath_Reference#Path">Path</a> is treated as if it is set to <a href="#SkPath_kWinding_FillType">SkPath::kWinding FillType</a>, and the set <a href="#Fill_Type">Path Fill Type</a> is ignored.</td> </tr> @@ -2204,7 +2203,7 @@ The default width for the paint is zero. ### Example -<div><fiddle-embed name="01e3e08a3022a351628ff54e84887756">raster gpu<div>The pixels hit to represent thin lines vary with the angle of the +<div><fiddle-embed name="01e3e08a3022a351628ff54e84887756"><div>The pixels hit to represent thin lines vary with the angle of the line and the platform's implementation.</div></fiddle-embed></div> <a name="SkPaint_getStrokeWidth"></a> @@ -2282,7 +2281,7 @@ is replaced with <a href="#SkPaint_kBevel_Join">kBevel Join</a>. miter limit = 1 / sin ( angle / 2 )<a href="#Miter_Limit">Miter Limit</a> default value is 4. The default may be changed at compile time by setting <a href="undocumented#SkPaintDefaults_MiterLimit">SkPaintDefaults MiterLimit</a> -in <a href="undocumented#SkUserConfig.h">SkUserConfig.h</a> or as a define supplied by the build environment. +in "<a href="undocumented#SkUserConfig">SkUserConfig</a>.h" or as a define supplied by the build environment. Here are some miter limits and the angles that triggers them. @@ -2698,8 +2697,8 @@ true if the path represents <a href="#Style_Fill">Style Fill</a>, or false if it ### Example -<div><fiddle-embed name="cedd6233848198e1fca4d1e14816baaf"><div>A very small quad stroke is turned into a filled path with increasing levels of precision. -At the lowest precision, the quad stroke is approximated by a rectangle. +<div><fiddle-embed name="cedd6233848198e1fca4d1e14816baaf"><div>A very small <a href="#Quad">Quad</a> stroke is turned into a filled path with increasing levels of precision. +At the lowest precision, the <a href="#Quad">Quad</a> stroke is approximated by a rectangle. At the highest precision, the filled path has high fidelity compared to the original stroke.</div></fiddle-embed></div> --- @@ -3134,7 +3133,7 @@ replace <a href="SkPath_Reference#Path">Path</a> with a modification when drawn< --- # <a name="Mask_Filter_Methods"></a> Mask Filter Methods -<a href="undocumented#Mask_Filter">Mask Filter</a> uses <a href="#Alpha">Color Alpha</a> of the shape drawn to create <a href="undocumented#Mask_Alpha">Mask Alpha</a>. +<a href="undocumented#Mask_Filter">Mask Filter</a> uses coverage of the shape drawn to create <a href="undocumented#Mask_Alpha">Mask Alpha</a>. <a href="undocumented#Mask_Filter">Mask Filter</a> operates at a lower level than <a href="undocumented#Rasterizer">Rasterizer</a>; <a href="undocumented#Mask_Filter">Mask Filter</a> takes a <a href="undocumented#Mask">Mask</a>, and returns a <a href="undocumented#Mask">Mask</a>. <a href="undocumented#Mask_Filter">Mask Filter</a> may change the geometry and transparency of the shape, such as creating a blur effect. @@ -3327,7 +3326,7 @@ and returns a <a href="undocumented#Mask">Mask</a>. <a href="undocumented#Rasterizer">Rasterizer</a> may change the geometry and transparency of the shape, such as creating a shadow effect. <a href="undocumented#Rasterizer">Rasterizer</a> forms the base of <a href="#Layer">Rasterizer Layer</a>, which creates effects like embossing and outlining. -<a href="undocumented#Rasterizer">Rasterizer</a> applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Arc">Arc</a>, <a href="undocumented#Circle">Circle</a>, <a href="undocumented#Oval">Oval</a>, +<a href="undocumented#Rasterizer">Rasterizer</a> applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Arc">Arcs</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>. ### Example @@ -3423,7 +3422,7 @@ how geometry is converted to <a href="undocumented#Mask_Alpha">Mask Alpha</a></t with <a href="undocumented#Blend_Mode">Blend Mode</a> set to <a href="#SkBlendMode_kSrcOver">SkBlendMode::kSrcOver</a>. <a href="undocumented#Image_Filter">Image Filter</a> creates a new bitmap, which is drawn to the device using the set <a href="undocumented#Blend_Mode">Blend Mode</a>. <a href="undocumented#Image_Filter">Image Filter</a> is higher level than <a href="undocumented#Mask_Filter">Mask Filter</a>; for instance, an <a href="undocumented#Image_Filter">Image Filter</a> -can operate on all channels of <a href="undocumented#Color">Color</a>, while <a href="undocumented#Mask_Filter">Mask Filter</a> generates <a href="#Alpha">Color Alpha</a> only. +can operate on all channels of <a href="undocumented#Color">Color</a>, while <a href="undocumented#Mask_Filter">Mask Filter</a> generates <a href="#Alpha">Alpha</a> only. <a href="undocumented#Image_Filter">Image Filter</a> operates independently of and can be used in combination with <a href="undocumented#Mask_Filter">Mask Filter</a> and <a href="undocumented#Rasterizer">Rasterizer</a>. @@ -3660,11 +3659,11 @@ enum <a href="#SkPaint_Align">Align</a> { };</pre> <a href="#SkPaint_Align">Align</a> adjusts the text relative to the text position. -<a href="#SkPaint_Align">Align</a> affects glyphs drawn with: <a href="#SkCanvas_drawText">SkCanvas::drawText</a>, <a href="#SkCanvas_drawPosText">SkCanvas::drawPosText</a>, +<a href="#SkPaint_Align">Align</a> affects <a href="#Glyph">Glyphs</a> drawn with: <a href="#SkCanvas_drawText">SkCanvas::drawText</a>, <a href="#SkCanvas_drawPosText">SkCanvas::drawPosText</a>, <a href="#SkCanvas_drawPosTextH">SkCanvas::drawPosTextH</a>, <a href="#SkCanvas_drawTextOnPath">SkCanvas::drawTextOnPath</a>, <a href="#SkCanvas_drawTextOnPathHV">SkCanvas::drawTextOnPathHV</a>, <a href="#SkCanvas_drawTextRSXform">SkCanvas::drawTextRSXform</a>, <a href="#SkCanvas_drawTextBlob">SkCanvas::drawTextBlob</a>, and <a href="#SkCanvas_drawString">SkCanvas::drawString</a>; -as well as calls that place text glyphs like <a href="#SkPaint_getTextWidths">getTextWidths</a> and <a href="#SkPaint_getTextPath">getTextPath</a>. +as well as calls that place text <a href="#Glyph">Glyphs</a> like <a href="#SkPaint_getTextWidths">getTextWidths</a> and <a href="#SkPaint_getTextPath">getTextPath</a>. The text position is set by the font for both horizontal and vertical text. Typically, for horizontal text, the position is to the left side of the glyph on the @@ -3942,16 +3941,16 @@ enum <a href="#SkPaint_TextEncoding">TextEncoding</a> { };</pre> <a href="#SkPaint_TextEncoding">TextEncoding</a> determines whether text specifies character codes and their encoded size, -or glyph indices. Character codes use the encoding specified by the<a href="undocumented#Unicode">Unicode</a> standardhttp://unicode.org/standard/standard.html. +or glyph indices. Character codes use the encoding specified by the<a href="undocumented#Unicode">Unicode</a> standard. Character codes encoded size are specified by <a href="undocumented#UTF_8">UTF-8</a>, <a href="undocumented#UTF_16">UTF-16</a>, or <a href="undocumented#UTF_32">UTF-32</a>. All character encoding are able to represent all of <a href="undocumented#Unicode">Unicode</a>, differing only in the total storage required. -<a href="undocumented#UTF_8">UTF-8</a> (<a href="undocumented#RFC">RFC</a> 3629)https://tools.ietf.org/html/rfc3629is made up of 8-bit bytes, +<a href="undocumented#UTF_8">UTF-8</a> (<a href="undocumented#RFC">RFC</a> 3629)is made up of 8-bit bytes, and is a superset of <a href="undocumented#ASCII">ASCII</a>. -<a href="undocumented#UTF_16">UTF-16</a> (<a href="undocumented#RFC">RFC</a> 2781)https://tools.ietf.org/html/rfc2781is made up of 16-bit words, +<a href="undocumented#UTF_16">UTF-16</a> (<a href="undocumented#RFC">RFC</a> 2781)is made up of 16-bit words, and is a superset of <a href="undocumented#Unicode">Unicode</a> ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF. -<a href="undocumented#UTF_32">UTF-32</a>http://www.unicode.org/versions/<a href="undocumented#Unicode5">Unicode5</a>.0.0/ch03.pdfis +<a href="undocumented#UTF_32">UTF-32</a>is made up of 32-bit words, and is a superset of <a href="undocumented#Unicode">Unicode</a>. <a href="undocumented#Font_Manager">Font Manager</a> uses font data to convert character code points into glyph indices. @@ -4050,7 +4049,7 @@ one of: <a href="#SkPaint_kUTF8_TextEncoding">kUTF8 TextEncoding</a>, <a href="# --- # <a name="Font_Metrics"></a> Font Metrics -<a href="#Font_Metrics">Font Metrics</a> describe dimensions common to the glyphs in <a href="undocumented#Typeface">Typeface</a>. +<a href="#Font_Metrics">Font Metrics</a> describe dimensions common to the <a href="#Glyph">Glyphs</a> in <a href="undocumented#Typeface">Typeface</a>. The dimensions are computed by <a href="undocumented#Font_Manager">Font Manager</a> from font data and do not take <a href="#Paint">Paint</a> settings other than <a href="#Text_Size">Text Size</a> into account. @@ -4099,7 +4098,7 @@ bool <a href="#SkPaint_FontMetrics_hasStrikeoutPosition">hasStrikeoutPosition(Sk <a href="#SkPaint_FontMetrics">FontMetrics</a> is filled out by <a href="#SkPaint_getFontMetrics">getFontMetrics</a>. <a href="#SkPaint_FontMetrics">FontMetrics</a> contents reflect the values computed by <a href="undocumented#Font_Manager">Font Manager</a> using <a href="undocumented#Typeface">Typeface</a>. Values are set to zero if they are -not availble. +not available. <a href="#SkPaint_FontMetrics_fUnderlineThickness">fUnderlineThickness</a> and <a href="#SkPaint_FontMetrics_fUnderlinePosition">fUnderlinePosition</a> have a bit set in <a href="#SkPaint_FontMetrics_fFlags">fFlags</a> if their values are valid, since their value may be zero. @@ -4178,12 +4177,12 @@ Maximum character width. <a name="SkPaint_FontMetrics_fXMin"> <code><strong>SkScalar fXMin</strong></code> </a> -Minimum bounding box x value for all glyphs. +Minimum bounding box x value for all <a href="#Glyph">Glyphs</a>. Typically less than zero. <a name="SkPaint_FontMetrics_fXMax"> <code><strong>SkScalar fXMax</strong></code> </a> -Maximum bounding box x value for all glyphs. +Maximum bounding box x value for all <a href="#Glyph">Glyphs</a>. Typically greater than zero. <a name="SkPaint_FontMetrics_fXHeight"> <code><strong>SkScalar fXHeight</strong></code> </a> @@ -4236,8 +4235,8 @@ bool hasUnderlineThickness(SkScalar* thickness) const </pre> If <a href="#Font_Metrics">Font Metrics</a> has a valid underline <a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a> to that value. If it doesn't, return false, and ignore -<a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a>. +<a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a> is not valid, +return false, and ignore <a href="#SkPaint_FontMetrics_hasUnderlineThickness_thickness">thickness</a>. ### Parameters @@ -4260,8 +4259,8 @@ bool hasUnderlinePosition(SkScalar* position) const </pre> If <a href="#Font_Metrics">Font Metrics</a> has a valid underline <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a> to that value. If it doesn't, return false, and ignore -<a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a>. +<a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a> is not valid, +return false, and ignore <a href="#SkPaint_FontMetrics_hasUnderlinePosition_position">position</a>. ### Parameters @@ -4284,8 +4283,8 @@ bool hasStrikeoutThickness(SkScalar* thickness) const </pre> If <a href="#Font_Metrics">Font Metrics</a> has a valid strikeout <a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a> to that value. If it doesn't, return false, and ignore -<a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a>. +<a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a> is not valid, +return false, and ignore <a href="#SkPaint_FontMetrics_hasStrikeoutThickness_thickness">thickness</a>. ### Parameters @@ -4308,8 +4307,8 @@ bool hasStrikeoutPosition(SkScalar* position) const </pre> If <a href="#Font_Metrics">Font Metrics</a> has a valid strikeout <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a>, return true, and set -<a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a> to that value. If it doesn't, return false, and ignore -<a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a>. +<a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a> to that value. If the underline <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a> is not valid, +return false, and ignore <a href="#SkPaint_FontMetrics_hasStrikeoutPosition_position">position</a>. ### Parameters @@ -4405,7 +4404,7 @@ textSize: 32 fontSpacing: 37.25 SkRect getFontBounds() const </pre> -Returns the union of bounds of all glyphs. +Returns the union of bounds of all <a href="#Glyph">Glyphs</a>. Returned dimensions are computed by <a href="undocumented#Font_Manager">Font Manager</a> from font data, ignoring <a href="#SkPaint_Hinting">Hinting</a>. Includes <a href="#Text_Size">Text Size</a>, <a href="#Text_Scale_X">Text Scale X</a>, and <a href="#Text_Skew_X">Text Skew X</a>, but not <a href="#Fake_Bold">Fake Bold</a> or <a href="undocumented#Path_Effect">Path Effect</a>. @@ -4416,7 +4415,7 @@ returns the same bounds as <a href="#Font_Metrics">Font Metrics</a> { <a href="# ### Return Value -union of bounds of all glyphs +union of bounds of all <a href="#Glyph">Glyphs</a> ### Example @@ -4457,7 +4456,7 @@ If <a href="#Text_Encoding">Text Encoding</a> is <a href="#SkPaint_kUTF8_TextEnc ### Parameters <table> <tr> <td><a name="SkPaint_textToGlyphs_text"> <code><strong>text </strong></code> </a></td> <td> -character stroage encoded with <a href="#Text_Encoding">Text Encoding</a></td> +character storage encoded with <a href="#Text_Encoding">Text Encoding</a></td> </tr> <tr> <td><a name="SkPaint_textToGlyphs_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> length of character storage in bytes</td> </tr> <tr> <td><a name="SkPaint_textToGlyphs_glyphs"> <code><strong>glyphs </strong></code> </a></td> <td> @@ -4482,14 +4481,14 @@ number of <a href="#SkPaint_textToGlyphs_glyphs">glyphs</a> represented by <a hr int countText(const void* text, size_t byteLength) const </pre> -Returns the number of glyphs in <a href="#SkPaint_countText_text">text</a>. -Uses <a href="#Text_Encoding">Text Encoding</a> to count the glyphs. +Returns the number of <a href="#Glyph">Glyphs</a> in <a href="#SkPaint_countText_text">text</a>. +Uses <a href="#Text_Encoding">Text Encoding</a> to count the <a href="#Glyph">Glyphs</a>. Returns the same result as <a href="#SkPaint_textToGlyphs">textToGlyphs</a>. ### Parameters <table> <tr> <td><a name="SkPaint_countText_text"> <code><strong>text </strong></code> </a></td> <td> -character stroage encoded with <a href="#Text_Encoding">Text Encoding</a></td> +character storage encoded with <a href="#Text_Encoding">Text Encoding</a></td> </tr> <tr> <td><a name="SkPaint_countText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> length of character storage in bytes</td> </tr> @@ -4497,7 +4496,7 @@ length of character storage in bytes</td> ### Return Value -number of glyphs represented by <a href="#SkPaint_countText_text">text</a> of length <a href="#SkPaint_countText_byteLength">byteLength</a> +number of <a href="#Glyph">Glyphs</a> represented by <a href="#SkPaint_countText_text">text</a> of length <a href="#SkPaint_countText_byteLength">byteLength</a> ### Example @@ -4528,12 +4527,12 @@ If <a href="#Text_Encoding">Text Encoding</a> is <a href="#SkPaint_kGlyphID_Text returns true if all glyph indices in <a href="#SkPaint_containsText_text">text</a> are non-zero; does not check to see if <a href="#SkPaint_containsText_text">text</a> contains valid glyph indices for <a href="undocumented#Typeface">Typeface</a>. -Returns true if bytelength is zero. +Returns true if <a href="#SkPaint_containsText_byteLength">byteLength</a> is zero. ### Parameters <table> <tr> <td><a name="SkPaint_containsText_text"> <code><strong>text </strong></code> </a></td> <td> -array of characters or glyphs</td> +array of characters or <a href="#Glyph">Glyphs</a></td> </tr> <tr> <td><a name="SkPaint_containsText_byteLength"> <code><strong>byteLength </strong></code> </a></td> <td> number of bytes in <a href="#SkPaint_containsText_text">text</a> array</td> </tr> @@ -4769,13 +4768,13 @@ glyph count in <a href="#SkPaint_getTextWidths_text">text</a> ### Example -<div><fiddle-embed name="6b9e101f49e9c2c28755c5bdcef64dfb"><div>Bounds of glyphs increase for stroked <a href="#SkPaint_getTextWidths_text">text</a>, but <a href="#SkPaint_getTextWidths_text">text</a> advance remains the same. +<div><fiddle-embed name="6b9e101f49e9c2c28755c5bdcef64dfb"><div>Bounds of <a href="#Glyph">Glyphs</a> increase for stroked <a href="#SkPaint_getTextWidths_text">text</a>, but <a href="#SkPaint_getTextWidths_text">text</a> advance remains the same. The underlines show the <a href="#SkPaint_getTextWidths_text">text</a> advance, spaced to keep them distinct.</div></fiddle-embed></div> --- # <a name="Text_Path"></a> Text Path -<a href="#Text_Path">Text Path</a> describes the geometry of glyphs used to draw text. +<a href="#Text_Path">Text Path</a> describes the geometry of <a href="#Glyph">Glyphs</a> used to draw text. <a name="SkPaint_getTextPath"></a> ## getTextPath @@ -4802,7 +4801,7 @@ x-coordinate of the origin of the <a href="#SkPaint_getTextPath_text">text</a></ </tr> <tr> <td><a name="SkPaint_getTextPath_y"> <code><strong>y </strong></code> </a></td> <td> y-coordinate of the origin of the <a href="#SkPaint_getTextPath_text">text</a></td> </tr> <tr> <td><a name="SkPaint_getTextPath_path"> <code><strong>path </strong></code> </a></td> <td> -geometry of the glyphs</td> +geometry of the <a href="#Glyph">Glyphs</a></td> </tr> </table> @@ -4837,20 +4836,20 @@ number of bytes of <a href="#SkPaint_getPosTextPath_text">text</a></td> </tr> <tr> <td><a name="SkPaint_getPosTextPath_pos"> <code><strong>pos </strong></code> </a></td> <td> positions of each glyph</td> </tr> <tr> <td><a name="SkPaint_getPosTextPath_path"> <code><strong>path </strong></code> </a></td> <td> -geometry of the glyphs</td> +geometry of the <a href="#Glyph">Glyphs</a></td> </tr> </table> ### Example -<div><fiddle-embed name="7f27c93472aa99a7542fb3493076f072"><div>Simplifies three glyphs to eliminate overlaps, and strokes the result.</div></fiddle-embed></div> +<div><fiddle-embed name="7f27c93472aa99a7542fb3493076f072"><div>Simplifies three <a href="#Glyph">Glyphs</a> to eliminate overlaps, and strokes the result.</div></fiddle-embed></div> --- # <a name="Text_Intercepts"></a> Text Intercepts -<a href="#Text_Intercepts">Text Intercepts</a> describe the intersection of drawn text glyphs with a pair +<a href="#Text_Intercepts">Text Intercepts</a> describe the intersection of drawn text <a href="#Glyph">Glyphs</a> with a pair of lines parallel to the text advance. <a href="#Text_Intercepts">Text Intercepts</a> permits creating a -underline that skips descenders. +underline that skips <a href="undocumented#Descenders">Descenders</a>. <a name="SkPaint_getTextIntercepts"></a> ## getTextIntercepts @@ -4862,7 +4861,7 @@ int getTextIntercepts(const void* text, size_t length, SkScalar x, SkScalar y, Returns the number of <a href="#SkPaint_getTextIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getTextIntercepts_bounds">bounds</a>. <a href="#SkPaint_getTextIntercepts_bounds">bounds</a> describes a pair of lines parallel to the <a href="#SkPaint_getTextIntercepts_text">text</a> advance. -The return count is zero or a multiple of two, and is at most twice the number of glyphs in +The return count is zero or a multiple of two, and is at most twice the number of <a href="#Glyph">Glyphs</a> in the string. Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getTextIntercepts_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. @@ -4893,7 +4892,7 @@ number of intersections; may be zero ### Example -<div><fiddle-embed name="2a0b80ed20d193c688085b79deb5bdc9"><div>Underline uses intercepts to draw on either side of the glyph descender.</div></fiddle-embed></div> +<div><fiddle-embed name="2a0b80ed20d193c688085b79deb5bdc9"><div>Underline uses intercepts to draw on either side of the glyph Descender.</div></fiddle-embed></div> --- @@ -4907,7 +4906,7 @@ int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[], Returns the number of <a href="#SkPaint_getPosTextIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getPosTextIntercepts_bounds">bounds</a>. <a href="#SkPaint_getPosTextIntercepts_bounds">bounds</a> describes a pair of lines parallel to the <a href="#SkPaint_getPosTextIntercepts_text">text</a> advance. -The return count is zero or a multiple of two, and is at most twice the number of glyphs in +The return count is zero or a multiple of two, and is at most twice the number of <a href="#Glyph">Glyphs</a> in the string. Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getPosTextIntercepts_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. @@ -4936,7 +4935,7 @@ number of intersections; may be zero ### Example -<div><fiddle-embed name="98b2dfc552d0540a7c041fe7a2839bd7"><div><a href="undocumented#Text">Text</a> intercepts draw on either side of, but not inside, glyphs in a run.</div></fiddle-embed></div> +<div><fiddle-embed name="98b2dfc552d0540a7c041fe7a2839bd7"><div><a href="undocumented#Text">Text</a> intercepts draw on either side of, but not inside, <a href="#Glyph">Glyphs</a> in a run.</div></fiddle-embed></div> --- @@ -4951,7 +4950,7 @@ int getPosTextHIntercepts(const void* text, size_t length, const SkScalar xpos[] Returns the number of <a href="#SkPaint_getPosTextHIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getPosTextHIntercepts_bounds">bounds</a>. <a href="#SkPaint_getPosTextHIntercepts_bounds">bounds</a> describes a pair of lines parallel to the <a href="#SkPaint_getPosTextHIntercepts_text">text</a> advance. -The return count is zero or a multiple of two, and is at most twice the number of glyphs in +The return count is zero or a multiple of two, and is at most twice the number of <a href="#Glyph">Glyphs</a> in the string. Uses <a href="#Text_Encoding">Text Encoding</a> to decode <a href="#SkPaint_getPosTextHIntercepts_text">text</a>, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. @@ -4996,18 +4995,18 @@ int getTextBlobIntercepts(const SkTextBlob* blob, const SkScalar bounds[2], Returns the number of <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a> that intersect <a href="#SkPaint_getTextBlobIntercepts_bounds">bounds</a>. <a href="#SkPaint_getTextBlobIntercepts_bounds">bounds</a> describes a pair of lines parallel to the text advance. -The return count is zero or a multiple of two, and is at most twice the number of glyphs in +The return count is zero or a multiple of two, and is at most twice the number of <a href="#Glyph">Glyphs</a> in the string. Uses <a href="#Text_Encoding">Text Encoding</a> to decode text, <a href="undocumented#Typeface">Typeface</a> to get the glyph paths, and <a href="#Text_Size">Text Size</a>, <a href="#Fake_Bold">Fake Bold</a>, and <a href="undocumented#Path_Effect">Path Effect</a> to scale and modify the glyph paths. -Uses pos array and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a>. +Uses run array and <a href="#Text_Align">Text Align</a> to position <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a>. Pass nullptr for <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a> to determine the size of the interval array. <a href="#SkPaint_getTextBlobIntercepts_intervals">intervals</a> are cached to improve performance for multiple calls. ### Parameters <table> <tr> <td><a name="SkPaint_getTextBlobIntercepts_blob"> <code><strong>blob </strong></code> </a></td> <td> -glyphs, positions, and text paint attributes</td> +<a href="#Glyph">Glyphs</a>, positions, and text paint attributes</td> </tr> <tr> <td><a name="SkPaint_getTextBlobIntercepts_bounds"> <code><strong>bounds </strong></code> </a></td> <td> lower and upper line parallel to the advance</td> </tr> <tr> <td><a name="SkPaint_getTextBlobIntercepts_intervals"> <code><strong>intervals </strong></code> </a></td> <td> @@ -5035,8 +5034,8 @@ bool nothingToDraw() const Returns true if <a href="#Paint">Paint</a> prevents all drawing; otherwise, the <a href="#Paint">Paint</a> may or may not allow drawing. -Returns true if <a href="undocumented#Blend_Mode">Blend Mode</a> and <a href="#Alpha">Color Alpha</a> are enabled, -and computed <a href="#Alpha">Color Alpha</a> is zero. +Returns true if, for example, <a href="undocumented#Blend_Mode">Blend Mode</a> combined with <a href="#Alpha">Color Alpha</a> computes a +new <a href="#Alpha">Alpha</a> of zero. ### Return Value @@ -5090,13 +5089,13 @@ const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const Only call this if <a href="#SkPaint_canComputeFastBounds">canComputeFastBounds</a> returned true. This takes a raw rectangle (the raw bounds of a shape), and adjusts it for stylistic effects in the paint (e.g. stroking). If needed, it uses the <a href="#SkPaint_computeFastBounds_storage">storage</a> -rect parameter. It returns the adjusted bounds that can then be used +parameter. It returns the adjusted bounds that can then be used for <a href="#SkCanvas_quickReject">SkCanvas::quickReject</a> tests. -The returned rect will either be <a href="#SkPaint_computeFastBounds_orig">orig</a> or <a href="#SkPaint_computeFastBounds_storage">storage</a>, thus the caller +The returned <a href="undocumented#Rect">Rect</a> will either be <a href="#SkPaint_computeFastBounds_orig">orig</a> or <a href="#SkPaint_computeFastBounds_storage">storage</a>, thus the caller should not rely on <a href="#SkPaint_computeFastBounds_storage">storage</a> being set to the result, but should always -use the retured value. It is legal for <a href="#SkPaint_computeFastBounds_orig">orig</a> and <a href="#SkPaint_computeFastBounds_storage">storage</a> to be the same -rect. +use the returned value. It is legal for <a href="#SkPaint_computeFastBounds_orig">orig</a> and <a href="#SkPaint_computeFastBounds_storage">storage</a> to be the same +<a href="undocumented#Rect">Rect</a>. ### Parameters @@ -5143,8 +5142,9 @@ const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage, Style style) const </pre> -Take the <a href="#SkPaint_doComputeFastBounds_style">style</a> explicitly, so the caller can force us to be stroked -without having to make a copy of the paint just to change that field. +Computes the bounds, overriding the <a href="#Paint">Paint</a> <a href="#SkPaint_Style">Style</a>. This can be used to +account for additional width required by stroking <a href="#SkPaint_doComputeFastBounds_orig">orig</a>, without +altering <a href="#SkPaint_Style">Style</a> set to fill. ### Parameters @@ -5170,12 +5170,14 @@ fast computed bounds void toString(SkString* str) const; </pre> -Converts <a href="#Paint">Paint</a> to machine parsable form in developer mode. +Creates string representation of <a href="#Paint">Paint</a>. The representation is read by +internal debugging tools. The interface and implementation may be +suppressed by defining <a href="undocumented#SK_IGNORE_TO_STRING">SK IGNORE TO STRING</a>. ### Parameters <table> <tr> <td><a name="SkPaint_toString_str"> <code><strong>str </strong></code> </a></td> <td> -storage for string containing parsable <a href="#Paint">Paint</a></td> +storage for string representation of <a href="#Paint">Paint</a></td> </tr> </table> diff --git a/site/user/api/SkPath_Reference.md b/site/user/api/SkPath_Reference.md index abd5e67644..9de8b30713 100644 --- a/site/user/api/SkPath_Reference.md +++ b/site/user/api/SkPath_Reference.md @@ -16,7 +16,7 @@ the middle entry as the end of the first <a href="undocumented#Line">Line</a> an <a href="#Path">Path</a> components <a href="#Arc">Arc</a>, <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> are composed of <a href="#Line">Lines</a> and <a href="#Curve">Curves</a> with as many <a href="#Verb">Verbs</a> and <a href="#Point">Points</a> required for an exact description. Once added to <a href="#Path">Path</a>, these components may lose their -identity; although <a href="#Path">Path</a> can be inspected to determine if it decribes a single +identity; although <a href="#Path">Path</a> can be inspected to determine if it describes a single <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, <a href="undocumented#Round_Rect">Round Rect</a>, and so on. ### Example @@ -51,7 +51,7 @@ are required to satisfy <a href="#Verb_Array">Verb Array</a>. First <a href="#Ve ### Example <div><fiddle-embed name="0374f2dcd7effeb1dd435205a6c2de6f"><div>Each <a href="#SkPath_moveTo">SkPath::moveTo</a> starts a new <a href="#Contour">Contour</a>, and content after <a href="#SkPath_close">SkPath::close()</a> -also starts a new <a href="#Contour">Contour</a>. Since <a href="#SkPath_conicTo">SkPath::conicTo</a> wasn't preceded by +also starts a new <a href="#Contour">Contour</a>. Since <a href="#SkPath_conicTo">SkPath::conicTo</a> is not preceded by <a href="#SkPath_moveTo">SkPath::moveTo</a>, the first <a href="undocumented#Point">Point</a> of the third <a href="#Contour">Contour</a> starts at the last <a href="undocumented#Point">Point</a> of the second <a href="#Contour">Contour</a>.</div></fiddle-embed></div> @@ -82,10 +82,10 @@ makes them visible. outline a figure. <a href="#Path">Path</a> always starts with a move verb to a <a href="undocumented#Cartesian">Cartesian</a> coordinate, and may be followed by additional verbs that add lines or curves. Adding a <a href="#SkPath_close">close</a> verb makes the geometry into a continuous loop, a closed contour. -<a href="#Path">Paths</a> may contain any number of contours, each beginnning with a move verb. +<a href="#Path">Paths</a> may contain any number of contours, each beginning with a move verb. <a href="#Path">Path</a> contours may contain only a move verb, or may also contain lines, -quadratic Beziers, conics, and cubic Beziers. <a href="#Path">Path</a> contours may be open or +<a href="#Quad">Quadratic Beziers</a>, <a href="#Conic">Conics</a>, and <a href="#Cubic">Cubic Beziers</a>. <a href="#Path">Path</a> contours may be open or closed. When used to draw a filled area, <a href="#Path">Path</a> describes whether the fill is inside or @@ -102,12 +102,11 @@ Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and co | constants | description | | --- | --- | | <a href="#SkPath_AddPathMode">AddPathMode</a> | Sets <a href="#SkPath_addPath">addPath</a> options. | -| <a href="#SkPath_ArcSize">ArcSize</a> | Sets <a href="#SkPath_arcTo_4">arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y)</a> options. | +| <a href="#SkPath_ArcSize">ArcSize</a> | Used by <a href="#SkPath_arcTo_4">arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y)</a>. | | <a href="#SkPath_Convexity">Convexity</a> | Returns if <a href="#Path">Path</a> is convex or concave. | | <a href="#SkPath_Direction">Direction</a> | Sets <a href="#Contour">Contour</a> clockwise or counterclockwise. | | <a href="#SkPath_FillType">FillType</a> | Sets winding rule and inverse fill. | -| <a href="#SkPath_SegmentMask">SegmentMask</a> | -<a href="#SkPath_Verb">Verb</a>| Controls how <a href="#Path">Path</a> <a href="#Point">Points</a> are interpreted. | +| <a href="#SkPath_SegmentMask">SegmentMask</a> | <a href="#SkPath_Verb">Verb</a> | Controls how <a href="#Path">Path</a> <a href="#Point">Points</a> are interpreted. | ## <a name="Classes_and_Structs"></a> Classes and Structs @@ -159,8 +158,8 @@ Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and co | <a href="#SkPath_countPoints">countPoints</a> | Returns <a href="#Point_Array">Point Array</a> length. | | <a href="#SkPath_countVerbs">countVerbs</a> | Returns <a href="#Verb_Array">Verb Array</a> length. | | <a href="#SkPath_cubicTo">cubicTo</a> | Appends <a href="#Cubic">Cubic</a>. | -| <a href="#SkPath_dump_2">dump</a> | Sends text representation using floats to stdout. | -| <a href="#SkPath_dumpHex">dumpHex</a> | Sends text representation using hexadecimal to stdout. | +| <a href="#SkPath_dump_2">dump</a> | Sends text representation using floats to standard output. | +| <a href="#SkPath_dumpHex">dumpHex</a> | Sends text representation using hexadecimal to standard output. | | <a href="#SkPath_getBounds">getBounds</a> | Returns maximum and minimum of <a href="#Point_Array">Point Array</a>. | | <a href="#SkPath_getConvexity">getConvexity</a> | Returns geometry convexity, computing if necessary. | | <a href="#SkPath_getConvexityOrUnknown">getConvexityOrUnknown</a> | Returns geometry convexity if known. | @@ -430,7 +429,7 @@ Releases ownership of any shared data and deletes data if <a href="#Path">Path</ ### Example -<div><fiddle-embed name="01ad6be9b7d15a2217daea273eb3d466"><div>delete calls <a href="#Path">Path</a> destructor, but copy of original in path2 is unaffected.</div></fiddle-embed></div> +<div><fiddle-embed name="01ad6be9b7d15a2217daea273eb3d466"><div>delete calls <a href="#Path">Path</a> <a href="undocumented#Destructor">Destructor</a>, but copy of original in path2 is unaffected.</div></fiddle-embed></div> ### See Also @@ -456,7 +455,7 @@ pointers are not exposed. ### Parameters <table> <tr> <td><a name="SkPath_copy_assignment_operator_path"> <code><strong>path </strong></code> </a></td> <td> -<a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Weight">Weights</a>, amd <a href="#Fill_Type">Fill Type</a> to copy</td> +<a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, <a href="#Weight">Weights</a>, and <a href="#Fill_Type">Fill Type</a> to copy</td> </tr> </table> @@ -575,7 +574,7 @@ Return true if <a href="#Path">Paths</a> contain equal <a href="#Verb">Verbs</a> If <a href="#Path">Paths</a> contain one or more <a href="#Conic">Conics</a>, the <a href="#Weight">Weights</a> must match. <a href="#SkPath_conicTo">conicTo</a> may add different <a href="#Verb">Verbs</a> depending on <a href="#Conic_Weight">Conic Weight</a>, so it is not -trival to <a href="#SkPath_interpolate">interpolate</a> a pair of <a href="#Path">Paths</a> containing <a href="#Conic">Conics</a> with different +trivial to <a href="#SkPath_interpolate">interpolate</a> a pair of <a href="#Path">Paths</a> containing <a href="#Conic">Conics</a> with different <a href="#Conic_Weight">Conic Weight</a> values. ### Parameters @@ -1064,7 +1063,7 @@ bool isRRect(SkRRect* rrect, Direction* dir = nullptr, unsigned* start = nullptr </pre> Returns true if constructed by <a href="#SkPath_addRoundRect">addRoundRect</a>, <a href="#SkPath_addRRect">addRRect</a>; and if construction -is not empty, not <a href="undocumented#Rect">Rect</a>, and not <a href="undocumented#Oval">Oval</a>. <a href="#Path">Path</a> constructed with other other calls +is not empty, not <a href="undocumented#Rect">Rect</a>, and not <a href="undocumented#Oval">Oval</a>. <a href="#Path">Path</a> constructed with other calls will not return true though <a href="#Path">Path</a> draws <a href="undocumented#Round_Rect">Round Rect</a>. <a href="#SkPath_isRRect_rrect">rrect</a> receives bounds of <a href="undocumented#Round_Rect">Round Rect</a>. @@ -1089,11 +1088,12 @@ storage for <a href="#SkPath_isRRect_start">start</a> of <a href="undocumented#R ### Return Value -true for <a href="undocumented#Round_Rect">Round Rect</a> <a href="#Path">Path</a> constructed by <a href="#SkPath_addRoundRect">addRoundRect</a> or <a href="#SkPath_addRRect">addRRect</a> +true if <a href="#Path">Path</a> <a href="#SkPath_contains">contains</a> only <a href="undocumented#Round_Rect">Round Rect</a> ### Example -<div><fiddle-embed name="f2b7e57a385e6604475c99ec8daa2697"></fiddle-embed></div> +<div><fiddle-embed name="f2b7e57a385e6604475c99ec8daa2697"><div>Draw rounded rectangle and its bounds. Draw an arc indicating where the rounded +rectangle starts and its direction.</div></fiddle-embed></div> ### See Also @@ -1108,7 +1108,7 @@ true for <a href="undocumented#Round_Rect">Round Rect</a> <a href="#Path">Path</ void reset() </pre> -Sets <a href="#Path">Path</a> to its intial state. +Sets <a href="#Path">Path</a> to its initial state. Removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a>, and sets <a href="#SkPath_FillType">FillType</a> to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. Internal storage associated with <a href="#Path">Path</a> is released. @@ -1129,7 +1129,7 @@ Internal storage associated with <a href="#Path">Path</a> is released. void rewind() </pre> -Sets <a href="#Path">Path</a> to its intial state, preserving internal storage. +Sets <a href="#Path">Path</a> to its initial state, preserving internal storage. Removes <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Array</a>, and <a href="#Weight">Weights</a>, and sets <a href="#SkPath_FillType">FillType</a> to <a href="#SkPath_kWinding_FillType">kWinding FillType</a>. Internal storage associated with <a href="#Path">Path</a> is retained. @@ -1303,7 +1303,7 @@ Mark temporary paths, discarded or modified after use, as volatile to inform <a href="undocumented#Device">Device</a> that the path need not be cached. Mark animating <a href="#Path">Path</a> volatile to improve performance. -Mark unchanging <a href="#Path">Path</a> non-volative to improve repeated rendering. +Mark unchanging <a href="#Path">Path</a> non-volatile to improve repeated rendering. <a href="undocumented#Raster_Surface">Raster Surface</a> <a href="#Path">Path</a> draws are affected by volatile for some shadows. <a href="undocumented#GPU_Surface">GPU Surface</a> <a href="#Path">Path</a> draws are affected by volatile for some shadows and concave geometries. @@ -1356,8 +1356,8 @@ true if <a href="undocumented#Line">Line</a> is degenerate; its length is effect ### Example -<div><fiddle-embed name="97a031f9186ade586928563840ce9116"><div>As single precision floats, 100 and 100.000001f have the same bit representation, -and are exactly equal. 100 and 100.0001f have different bit representations, and +<div><fiddle-embed name="97a031f9186ade586928563840ce9116"><div>As single precision floats, 100 and 100.000001 have the same bit representation, +and are exactly equal. 100 and 100.0001 have different bit representations, and are not exactly equal, but are nearly equal.</div> #### Example Output @@ -1392,11 +1392,11 @@ treated as a point. ### Parameters <table> <tr> <td><a name="SkPath_IsQuadDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> -quad start point</td> +<a href="#Quad">Quad</a> start point</td> </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> -quad control point</td> +<a href="#Quad">Quad</a> control point</td> </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_p3"> <code><strong>p3 </strong></code> </a></td> <td> -quad end point</td> +<a href="#Quad">Quad</a> end point</td> </tr> <tr> <td><a name="SkPath_IsQuadDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> if true, returns true only if <a href="#SkPath_IsQuadDegenerate_p1">p1</a>, <a href="#SkPath_IsQuadDegenerate_p2">p2</a>, and <a href="#SkPath_IsQuadDegenerate_p3">p3</a> are equal; if false, returns true if <a href="#SkPath_IsQuadDegenerate_p1">p1</a>, <a href="#SkPath_IsQuadDegenerate_p2">p2</a>, and <a href="#SkPath_IsQuadDegenerate_p3">p3</a> are equal or nearly equal</td> @@ -1409,9 +1409,9 @@ true if <a href="#Quad">Quad</a> is degenerate; its length is effectively zero ### Example -<div><fiddle-embed name="1d50896c528cd4581966646b7d96acff"><div>As single precision floats: 100, 100.00001f, and 100.00002f have different bit representations +<div><fiddle-embed name="1d50896c528cd4581966646b7d96acff"><div>As single precision floats: 100, 100.00001, and 100.00002 have different bit representations but nearly the same value. Translating all three by 1000 gives them the same bit representation; -the fractional portion of the number can't be represented by the float and is lost.</div> +the fractional portion of the number can not be represented by the float and is lost.</div> #### Example Output @@ -1445,13 +1445,13 @@ treated as a point. ### Parameters <table> <tr> <td><a name="SkPath_IsCubicDegenerate_p1"> <code><strong>p1 </strong></code> </a></td> <td> -cubic start point</td> +<a href="#Cubic">Cubic</a> start point</td> </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p2"> <code><strong>p2 </strong></code> </a></td> <td> -cubic control point 1</td> +<a href="#Cubic">Cubic</a> control point 1</td> </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p3"> <code><strong>p3 </strong></code> </a></td> <td> -cubic control point 2</td> +<a href="#Cubic">Cubic</a> control point 2</td> </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_p4"> <code><strong>p4 </strong></code> </a></td> <td> -cubic end point</td> +<a href="#Cubic">Cubic</a> end point</td> </tr> <tr> <td><a name="SkPath_IsCubicDegenerate_exact"> <code><strong>exact </strong></code> </a></td> <td> if true, returns true only if <a href="#SkPath_IsCubicDegenerate_p1">p1</a>, <a href="#SkPath_IsCubicDegenerate_p2">p2</a>, <a href="#SkPath_IsCubicDegenerate_p3">p3</a>, and <a href="#SkPath_IsCubicDegenerate_p4">p4</a> are equal; if false, returns true if <a href="#SkPath_IsCubicDegenerate_p1">p1</a>, <a href="#SkPath_IsCubicDegenerate_p2">p2</a>, <a href="#SkPath_IsCubicDegenerate_p3">p3</a>, and <a href="#SkPath_IsCubicDegenerate_p4">p4</a> are equal or nearly equal</td> @@ -1522,7 +1522,7 @@ second move is not line <a href="#Point_Array">Point Array</a> <a href="#SkPath_contains">contains</a> <a href="#Point">Points</a> satisfying the allocated <a href="#Point">Points</a> for each <a href="#SkPath_Verb">Verb</a> in <a href="#Verb_Array">Verb Array</a>. For instance, <a href="#Path">Path</a> containing one <a href="#Contour">Contour</a> with <a href="undocumented#Line">Line</a> -and <a href="#Quad">Quad</a> is described by <a href="#Verb_Array">Verb Array</a>: move to, line to, quad to; and +and <a href="#Quad">Quad</a> is described by <a href="#Verb_Array">Verb Array</a>: Verb::kMoveTo, Verb::kLineTo, Verb::kQuadTo; and one <a href="undocumented#Point">Point</a> for move, one <a href="undocumented#Point">Point</a> for <a href="undocumented#Line">Line</a>, two <a href="#Point">Points</a> for <a href="#Quad">Quad</a>; totaling four <a href="#Point">Points</a>. <a href="#Point_Array">Point Array</a> may be read directly from <a href="#Path">Path</a> with <a href="#SkPath_getPoints">getPoints</a>, or inspected with @@ -1749,7 +1749,7 @@ Cached state is also exchanged. <a href="#SkPath_swap">swap</a> internally excha it is lightweight and does not allocate memory. <a href="#SkPath_swap">swap</a> usage has largely been replaced by <a href="#SkPath_copy_assignment_operator">operator=(const SkPath& path)</a>. -<a href="#Path">Paths</a> do not copy their content on assignment util they are written to, +<a href="#Path">Paths</a> do not copy their content on assignment until they are written to, making assignment as efficient as <a href="#SkPath_swap">swap</a>. ### Parameters @@ -1946,7 +1946,7 @@ reducing the number and size of allocations when creating <a href="#Path">Path</ ### Parameters <table> <tr> <td><a name="SkPath_incReserve_extraPtCount"> <code><strong>extraPtCount </strong></code> </a></td> <td> -number of additional <a href="#Point">Points</a> to preallocate</td> +number of additional <a href="#Point">Points</a> to allocate</td> </tr> </table> @@ -2021,7 +2021,7 @@ void rMoveTo(SkScalar dx, SkScalar dy) Adds beginning of <a href="#Contour">Contour</a> relative to <a href="#Last_Point">Last Point</a>. If <a href="#Path">Path</a> is empty, starts <a href="#Contour">Contour</a> at (<a href="#SkPath_rMoveTo_dx">dx</a>, <a href="#SkPath_rMoveTo_dy">dy</a>). Otherwise, start <a href="#Contour">Contour</a> at <a href="#Last_Point">Last Point</a> <a href="#SkPath_offset">offset</a> by (<a href="#SkPath_rMoveTo_dx">dx</a>, <a href="#SkPath_rMoveTo_dy">dy</a>). -Function name stands for relative move to. +Function name stands for "relative move to". ### Parameters @@ -2114,7 +2114,7 @@ Adds <a href="undocumented#Line">Line</a> from <a href="#Last_Point">Last Point< Appends <a href="#SkPath_kMove_Verb">kMove Verb</a> to <a href="#Verb_Array">Verb Array</a> and (0, 0) to <a href="#Point_Array">Point Array</a>, if needed; then appends <a href="#SkPath_kLine_Verb">kLine Verb</a> to <a href="#Verb_Array">Verb Array</a> and <a href="undocumented#Line">Line</a> end to <a href="#Point_Array">Point Array</a>. <a href="undocumented#Line">Line</a> end is <a href="#Last_Point">Last Point</a> plus <a href="undocumented#Vector">Vector</a> (<a href="#SkPath_rLineTo_dx">dx</a>, <a href="#SkPath_rLineTo_dy">dy</a>). -Function name stands for relative line to. +Function name stands for "relative line to". ### Parameters @@ -2239,7 +2239,7 @@ if needed; then appends <a href="#SkPath_kQuad_Verb">kQuad Verb</a> to <a href=" control and <a href="#Quad">Quad</a> end to <a href="#Point_Array">Point Array</a>. <a href="#Quad">Quad</a> control is <a href="#Last_Point">Last Point</a> plus <a href="undocumented#Vector">Vector</a> (<a href="#SkPath_rQuadTo_dx1">dx1</a>, <a href="#SkPath_rQuadTo_dy1">dy1</a>). <a href="#Quad">Quad</a> end is <a href="#Last_Point">Last Point</a> plus <a href="undocumented#Vector">Vector</a> (<a href="#SkPath_rQuadTo_dx2">dx2</a>, <a href="#SkPath_rQuadTo_dy2">dy2</a>). -Function name stands for relative quad to. +Function name stands for "relative quad to". ### Parameters @@ -2309,7 +2309,7 @@ done </fiddle-embed></div> -If weight is greater than one, <a href="#Conic">Conic</a> is a hyperbolic segment. As w gets large, +If weight is greater than one, <a href="#Conic">Conic</a> is a hyperbolic segment. As weight gets large, a hyperbolic segment can be approximated by straight lines connecting the control <a href="undocumented#Point">Point</a> with the end <a href="#Point">Points</a>. @@ -2410,7 +2410,7 @@ weight of added <a href="#Conic">Conic</a></td> ### Example <div><fiddle-embed name="22d25e03b19d5bae92118877e462361b"><div><a href="#Conic">Conics</a> and arcs use identical representations. As the arc sweep increases -the conic weight also increases, but remains smaller than one.</div></fiddle-embed></div> +the <a href="#Conic_Weight">Conic Weight</a> also increases, but remains smaller than one.</div></fiddle-embed></div> ### See Also @@ -2440,7 +2440,7 @@ In all cases appends <a href="#Point">Points</a> control and end to <a href="#Po control is <a href="#Last_Point">Last Point</a> plus <a href="undocumented#Vector">Vector</a> (<a href="#SkPath_rConicTo_dx1">dx1</a>, <a href="#SkPath_rConicTo_dy1">dy1</a>). end is <a href="#Last_Point">Last Point</a> plus <a href="undocumented#Vector">Vector</a> (<a href="#SkPath_rConicTo_dx2">dx2</a>, <a href="#SkPath_rConicTo_dy2">dy2</a>). -Function name stands for relative conic to. +Function name stands for "relative conic to". ### Parameters @@ -2468,7 +2468,7 @@ weight of added <a href="#Conic">Conic</a></td> --- # <a name="Cubic"></a> Cubic -<a href="#Cubic">Cubic</a> describes a cubic <a href="undocumented#Bezier">Bezier</a>, a third-order curve. +<a href="#Cubic">Cubic</a> describes a <a href="undocumented#Bezier">Bezier</a> curve segment described by a third-order polynomial. <a href="#Cubic">Cubic</a> begins at a start <a href="undocumented#Point">Point</a>, curving towards the first control <a href="undocumented#Point">Point</a>; and curves from the end <a href="undocumented#Point">Point</a> towards the second control <a href="undocumented#Point">Point</a>. @@ -2570,7 +2570,7 @@ if needed; then appends <a href="#SkPath_kCubic_Verb">kCubic Verb</a> to <a href control and <a href="#Cubic">Cubic</a> end to <a href="#Point_Array">Point Array</a>. <a href="#Cubic">Cubic</a> control is <a href="#Last_Point">Last Point</a> plus <a href="undocumented#Vector">Vector</a> (dx1, dy1). <a href="#Cubic">Cubic</a> end is <a href="#Last_Point">Last Point</a> plus <a href="undocumented#Vector">Vector</a> (dx2, dy2). -Function name stands for relative cubic to. +Function name stands for "relative cubic to". ### Parameters @@ -2717,7 +2717,7 @@ The length of <a href="undocumented#Vector">Vector</a> from (<a href="#SkPath_ar tangents are nearly parallel, <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> from last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> to (<a href="#SkPath_arcTo_2_x1">x1</a>, <a href="#SkPath_arcTo_2_y1">y1</a>). <a href="#SkPath_arcTo">arcTo</a> appends at most one <a href="undocumented#Line">Line</a> and one <a href="#Conic">Conic</a>. -<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="undocumented#PostScript_arct">PostScript arct</a> and <a href="undocumented#HTML_Canvas_arcTo">HTML Canvas arcTo</a>. +<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arct">PostScript Arct</a> and <a href="undocumented#HTML_Canvas_ArcTo">HTML Canvas ArcTo</a>. ### Parameters @@ -2770,7 +2770,7 @@ The length of <a href="undocumented#Vector">Vector</a> from <a href="#SkPath_arc tangents are nearly parallel, <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> from last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> to <a href="#SkPath_arcTo_3_p1">p1</a>. <a href="#SkPath_arcTo">arcTo</a> appends at most one <a href="undocumented#Line">Line</a> and one <a href="#Conic">Conic</a>. -<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="undocumented#PostScript_arct">PostScript arct</a> and <a href="undocumented#HTML_Canvas_arcTo">HTML Canvas arcTo</a>. +<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arct">PostScript Arct</a> and <a href="undocumented#HTML_Canvas_ArcTo">HTML Canvas ArcTo</a>. ### Parameters @@ -2840,7 +2840,7 @@ void arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y) </pre> -Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> is implemented by one or more <a href="#Conic">Conic</a> weighted to describe part of <a href="undocumented#Oval">Oval</a> +Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>. <a href="#Arc">Arc</a> is implemented by one or more <a href="#Conic">Conics</a> weighted to describe part of <a href="undocumented#Oval">Oval</a> with radii (<a href="#SkPath_arcTo_4_rx">rx</a>, <a href="#SkPath_arcTo_4_ry">ry</a>) rotated by <a href="#SkPath_arcTo_4_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> curves from last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> to (<a href="#SkPath_arcTo_4_x">x</a>, <a href="#SkPath_arcTo_4_y">y</a>), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger. @@ -2849,8 +2849,8 @@ or if last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> equal (<a href="#SkPath_arcTo_4_x">x</a>, <a href="#SkPath_arcTo_4_y">y</a>) if both are greater than zero but too small. <a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. -<a href="#SkPath_arcTo">arcTo</a> implements the functionatlity of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> sweep-flag value is -opposite the integer value of <a href="#SkPath_arcTo_4_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> sweep-flag uses 1 for clockwise, while <a href="#SkPath_kCW_Direction">kCW Direction</a> +<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "" value is +opposite the integer value of <a href="#SkPath_arcTo_4_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "" uses 1 for clockwise, while <a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. ### Parameters @@ -2860,7 +2860,7 @@ radius in <a href="#SkPath_arcTo_4_x">x</a> before x-axis rotation</td> </tr> <tr> <td><a name="SkPath_arcTo_4_ry"> <code><strong>ry </strong></code> </a></td> <td> radius in <a href="#SkPath_arcTo_4_y">y</a> before x-axis rotation</td> </tr> <tr> <td><a name="SkPath_arcTo_4_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> -x-axis rotation in degrees; positve values are clockwise</td> +x-axis rotation in degrees; positive values are clockwise</td> </tr> <tr> <td><a name="SkPath_arcTo_4_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> chooses smaller or larger <a href="#Arc">Arc</a></td> </tr> <tr> <td><a name="SkPath_arcTo_4_sweep"> <code><strong>sweep </strong></code> </a></td> <td> @@ -2894,19 +2894,19 @@ and smaller or larger. <a href="#Arc">Arc</a> <a href="#SkPath_arcTo_5_sweep">sweep</a> is always less than 360 degrees. <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> to <a href="#SkPath_arcTo_5_xy">xy</a> if either radii are zero, or if last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> equals (x, y). <a href="#SkPath_arcTo">arcTo</a> scales radii <a href="#SkPath_arcTo_5_r">r</a> to fit last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> and -<a href="#SkPath_arcTo_5_xy">xy</a> if both are greater than zero but too small. +<a href="#SkPath_arcTo_5_xy">xy</a> if both are greater than zero but too small to describe an arc. <a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. -<a href="#SkPath_arcTo">arcTo</a> implements the functionatlity of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> sweep-flag value is -opposite the integer value of <a href="#SkPath_arcTo_5_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> sweep-flag uses 1 for clockwise, while <a href="#SkPath_kCW_Direction">kCW Direction</a> -cast to int is zero. +<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "" value is +opposite the integer value of <a href="#SkPath_arcTo_5_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "" uses 1 for clockwise, while +<a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. ### Parameters <table> <tr> <td><a name="SkPath_arcTo_5_r"> <code><strong>r </strong></code> </a></td> <td> radii in x and y before x-axis rotation</td> </tr> <tr> <td><a name="SkPath_arcTo_5_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> -x-axis rotation in degrees; positve values are clockwise</td> +x-axis rotation in degrees; positive values are clockwise</td> </tr> <tr> <td><a name="SkPath_arcTo_5_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> chooses smaller or larger <a href="#Arc">Arc</a></td> </tr> <tr> <td><a name="SkPath_arcTo_5_sweep"> <code><strong>sweep </strong></code> </a></td> <td> @@ -2935,19 +2935,20 @@ void rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, </pre> Append <a href="#Arc">Arc</a> to <a href="#Path">Path</a>, relative to last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a>. <a href="#Arc">Arc</a> is implemented by one or -more <a href="#Conic">Conic</a>, weighted to describe part of <a href="undocumented#Oval">Oval</a> with radii (r.fX, r.fY) rotated by -<a href="#SkPath_rArcTo_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> curves from last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> (x0, y0) to(x0 + <a href="#SkPath_rArcTo_dx">dx</a>, y0 + <a href="#SkPath_rArcTo_dy">dy</a>), +more <a href="#Conic">Conic</a>, weighted to describe part of <a href="undocumented#Oval">Oval</a> with radii (<a href="#SkPath_rArcTo_rx">rx</a>, <a href="#SkPath_rArcTo_ry">ry</a>) rotated by +<a href="#SkPath_rArcTo_xAxisRotate">xAxisRotate</a> degrees. <a href="#Arc">Arc</a> curves from last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> (x0, y0) to end <a href="undocumented#Point">Point</a>(x0 + <a href="#SkPath_rArcTo_dx">dx</a>, y0 + <a href="#SkPath_rArcTo_dy">dy</a>), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger. If <a href="#Path">Path</a> is empty, the start <a href="#Arc">Arc</a> <a href="undocumented#Point">Point</a> is (0, 0). -<a href="#Arc">Arc</a> <a href="#SkPath_rArcTo_sweep">sweep</a> is always less than 360 degrees. <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> to xy if either -radii are zero, or if last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> equals (x, y). <a href="#SkPath_arcTo">arcTo</a> scales radii r to fit -last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> and xy if both are greater than zero but too small. +<a href="#Arc">Arc</a> <a href="#SkPath_rArcTo_sweep">sweep</a> is always less than 360 degrees. <a href="#SkPath_arcTo">arcTo</a> appends <a href="undocumented#Line">Line</a> to end <a href="undocumented#Point">Point</a> +if either radii are zero, or if last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> equals end <a href="undocumented#Point">Point</a>. +<a href="#SkPath_arcTo">arcTo</a> scales radii (<a href="#SkPath_rArcTo_rx">rx</a>, <a href="#SkPath_rArcTo_ry">ry</a>) to fit last <a href="#Path">Path</a> <a href="undocumented#Point">Point</a> and end <a href="undocumented#Point">Point</a> if both are +greater than zero but too small to describe an arc. <a href="#SkPath_arcTo">arcTo</a> appends up to four <a href="#Conic">Conic</a> curves. -<a href="#SkPath_arcTo">arcTo</a> implements the functionatlity of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> sweep-flag value is -opposite the integer value of <a href="#SkPath_rArcTo_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> sweep-flag uses 1 for clockwise, while +<a href="#SkPath_arcTo">arcTo</a> implements the functionality of <a href="#Arc">SVG Arc</a>, although <a href="undocumented#SVG">SVG</a> "" value is +opposite the integer value of <a href="#SkPath_rArcTo_sweep">sweep</a>; <a href="undocumented#SVG">SVG</a> "" uses 1 for clockwise, while <a href="#SkPath_kCW_Direction">kCW Direction</a> cast to int is zero. ### Parameters @@ -2957,7 +2958,7 @@ radius in x before x-axis rotation</td> </tr> <tr> <td><a name="SkPath_rArcTo_ry"> <code><strong>ry </strong></code> </a></td> <td> radius in y before x-axis rotation</td> </tr> <tr> <td><a name="SkPath_rArcTo_xAxisRotate"> <code><strong>xAxisRotate </strong></code> </a></td> <td> -x-axis rotation in degrees; positve values are clockwise</td> +x-axis rotation in degrees; positive values are clockwise</td> </tr> <tr> <td><a name="SkPath_rArcTo_largeArc"> <code><strong>largeArc </strong></code> </a></td> <td> chooses smaller or larger <a href="#Arc">Arc</a></td> </tr> <tr> <td><a name="SkPath_rArcTo_sweep"> <code><strong>sweep </strong></code> </a></td> <td> @@ -2987,7 +2988,7 @@ void close() </pre> Append <a href="#SkPath_kClose_Verb">kClose Verb</a> to <a href="#Path">Path</a>. A closed <a href="#Contour">Contour</a> connects the first and last <a href="undocumented#Point">Point</a> -with <a href="undocumented#Line">Line</a>, forming a continous loop. Open and closed <a href="#Contour">Contour</a> draw the same +with <a href="undocumented#Line">Line</a>, forming a continuous loop. Open and closed <a href="#Contour">Contour</a> draw the same with <a href="#SkPaint_kFill_Style">SkPaint::kFill Style</a>. With <a href="#SkPaint_kStroke_Style">SkPaint::kStroke Style</a>, open <a href="#Contour">Contour</a> draws <a href="#Stroke_Cap">Paint Stroke Cap</a> at <a href="#Contour">Contour</a> start and end; closed <a href="#Contour">Contour</a> draws <a href="#Stroke_Join">Paint Stroke Join</a> at <a href="#Contour">Contour</a> start and end. @@ -3167,7 +3168,7 @@ bool isRect(SkRect* rect, bool* isClosed = nullptr, Direction* direction = nullptr) const </pre> -Returns true if <a href="#Path">Path</a> is eqivalent to <a href="undocumented#Rect">Rect</a> when filled. +Returns true if <a href="#Path">Path</a> is equivalent to <a href="undocumented#Rect">Rect</a> when filled. If false: <a href="#SkPath_isRect_rect">rect</a>, <a href="#SkPath_isRect_isClosed">isClosed</a>, and <a href="#SkPath_isRect_direction">direction</a> are unchanged. If true: <a href="#SkPath_isRect_rect">rect</a>, <a href="#SkPath_isRect_isClosed">isClosed</a>, and <a href="#SkPath_isRect_direction">direction</a> are written to if not nullptr. @@ -3692,7 +3693,7 @@ index of initial point of <a href="undocumented#Round_Rect">Round Rect</a></td> void addPoly(const SkPoint pts[], int count, bool close) </pre> -Add <a href="#Contour">Contour</a> created from <a href="undocumented#Line">Line</a> array, adding<a href="#SkPath_addPoly_count">count</a> - 1<a href="undocumented#Line">Line</a> segments. <a href="#Contour">Contour</a> added starts at pt[0], then adds a line +Add <a href="#Contour">Contour</a> created from <a href="undocumented#Line">Line</a> array, adding<a href="#SkPath_addPoly_count">count</a> - 1<a href="undocumented#Line">Line</a> segments. <a href="#Contour">Contour</a> added starts at <a href="#SkPath_addPoly_pts">pts</a>[0], then adds a line for every additional <a href="undocumented#Point">Point</a> in <a href="#SkPath_addPoly_pts">pts</a> array. If <a href="#SkPath_close">close</a> is true, appends <a href="#SkPath_kClose_Verb">kClose Verb</a> to <a href="#Path">Path</a>, connecting <a href="#SkPath_addPoly_pts">pts</a>[<a href="#SkPath_addPoly_count">count</a> - 1] and <a href="#SkPath_addPoly_pts">pts</a>[0]. @@ -4223,7 +4224,7 @@ void dump(SkWStream* stream, bool forceClose, bool dumpAsHex) const </pre> Writes text representation of <a href="#Path">Path</a> to <a href="#SkPath_dump_stream">stream</a>. If <a href="#SkPath_dump_stream">stream</a> is nullptr, <a href="#SkPath_dump_2">dump</a> writes to -stdout. Set <a href="#SkPath_dump_forceClose">forceClose</a> to true to get +standard output. Set <a href="#SkPath_dump_forceClose">forceClose</a> to true to get edges used to fill <a href="#Path">Path</a>. Set <a href="#SkPath_dump_dumpAsHex">dumpAsHex</a> true to get exact binary representations of floating point numbers used in <a href="#Point_Array">Point Array</a> and <a href="#Weight">Conic Weights</a>. @@ -4234,7 +4235,7 @@ writable <a href="undocumented#Stream">Stream</a> receiving <a href="#Path">Path </tr> <tr> <td><a name="SkPath_dump_forceClose"> <code><strong>forceClose </strong></code> </a></td> <td> true if missing <a href="#SkPath_kClose_Verb">kClose Verb</a> is output</td> </tr> <tr> <td><a name="SkPath_dump_dumpAsHex"> <code><strong>dumpAsHex </strong></code> </a></td> <td> -true if <a href="undocumented#SkScalar">SkScalar</a> values are written as hexidecimal</td> +true if <a href="undocumented#SkScalar">SkScalar</a> values are written as hexadecimal</td> </tr> </table> @@ -4275,7 +4276,7 @@ path.close(); void dump() const </pre> -Writes text representation of <a href="#Path">Path</a> to stdout. The representation may be +Writes text representation of <a href="#Path">Path</a> to standard output. The representation may be directly compiled as <a href="undocumented#C">C</a>++ code. Floating point values are written with limited precision; it may not be possible to reconstruct original <a href="#Path">Path</a> from output. @@ -4308,12 +4309,12 @@ path is not equal to copy void dumpHex() const </pre> -Writes text representation of <a href="#Path">Path</a> to stdout. The representation may be +Writes text representation of <a href="#Path">Path</a> to standard output. The representation may be directly compiled as <a href="undocumented#C">C</a>++ code. Floating point values are written in hexadecimal to preserve their exact bit pattern. The output reconstructs the original <a href="#Path">Path</a>. -Use instead of <a href="#SkPath_dump_2">dump</a> when submittingbug reports against <a href="undocumented#Skia">Skia</a>http://bug.skia.org. +Use instead of <a href="#SkPath_dump_2">dump</a> when submittingbug reports against <a href="undocumented#Skia">Skia</a>. Slight value changes in <a href="#Point_Array">Point Array</a> may cause the bug to disappear. ### Example diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md index 83c5b8b617..cc23a48ef0 100644 --- a/site/user/api/undocumented.md +++ b/site/user/api/undocumented.md @@ -93,6 +93,10 @@ bool equalsWithinTolerance(const SkPoint& p) const # <a name="SkDumpCanvas"></a> Class SkDumpCanvas +# <a name="Alias"></a> Alias + +# <a name="Anti-alias"></a> Anti-alias + # <a name="BBH_Factory"></a> BBH Factory # <a name="SkBBHFactory"></a> Class SkBBHFactory @@ -229,12 +233,18 @@ int SkColorSetARGB(a, r, g, b) # <a name="Color_Space"></a> Color Space +# <a name="Core_Graphics"></a> Core Graphics + +# <a name="Core_Text"></a> Core Text + # <a name="Data"></a> Data # <a name="Draw_Filter"></a> Draw Filter # <a name="SkDrawFilter"></a> Class SkDrawFilter +# <a name="Draw_Layer"></a> Draw Layer + # <a name="Draw_Looper"></a> Draw Looper # <a name="SkDrawLooper"></a> Class SkDrawLooper @@ -306,6 +316,10 @@ static std::unique_ptr<SkCanvas> # <a name="GPU_Surface"></a> GPU Surface +# <a name="HTML_Canvas"></a> HTML Canvas + +## <a name="ArcTo"></a> ArcTo + # <a name="Image"></a> Image ## <a name="Alpha_Type"></a> Alpha Type @@ -403,6 +417,8 @@ sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode, # <a name="SkIRect"></a> Struct SkIRect +# <a name="Left_Side_Bearing"></a> Left Side Bearing + # <a name="Mask"></a> Mask # <a name="Mask_Alpha"></a> Mask Alpha @@ -436,6 +452,8 @@ sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode, </tr> </table> +# <a name="OS_X"></a> OS X + # <a name="Paint_Defaults"></a> Paint Defaults ### Constants @@ -507,6 +525,14 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL, # <a name="SkPixmap"></a> Class SkPixmap +# <a name="PostScript"></a> PostScript + +## <a name="Arct"></a> Arct + +# <a name="Premultiply"></a> Premultiply + +# <a name="Raster_Engine"></a> Raster Engine + # <a name="Raster_Surface"></a> Raster Surface # <a name="Rasterizer"></a> Rasterizer @@ -519,6 +545,8 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL, # <a name="sk_sp"></a> Class sk_sp +# <a name="Right_Side_Bearing"></a> Right Side Bearing + # <a name="Round_Rect"></a> Round Rect # <a name="SkRRect"></a> Class SkRRect @@ -583,6 +611,8 @@ static sk_sp<SkShader> MakeBitmapShader(const SkBitmap& src, TileMode tmx, # <a name="SkString"></a> Class SkString +# <a name="Supersampling"></a> Supersampling + # <a name="Surface"></a> Surface # <a name="SkSurface"></a> Class SkSurface @@ -627,6 +657,8 @@ static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo&, void* pixels, # <a name="SkTextBlob"></a> Class SkTextBlob +# <a name="Unpremultiply"></a> Unpremultiply + # <a name="Vertices"></a> Vertices ## <a name="Colors"></a> Colors diff --git a/site/user/api/usingBookmaker.md b/site/user/api/usingBookmaker.md index f25f2abc94..d29b86fd99 100644 --- a/site/user/api/usingBookmaker.md +++ b/site/user/api/usingBookmaker.md @@ -4,7 +4,7 @@ usingBookmaker # <a name="Bookmaker"></a> Bookmaker How to use the <a href="#Bookmaker">Bookmaker</a> utility. -Install<a href="usingBookmaker#Go">Go</a>https://golang.org/doc/installif needed. +Install<a href="usingBookmaker#Go">Go</a>if needed. Get the fiddle command line interface tool. By default this will appear in your home directory. @@ -94,4 +94,4 @@ $ ./out/dir/bookmaker -p -b docs -i include/core/<a href="usingBookmaker#SkXXX"> ## <a name="Bugs"></a> Bugs -<a href="#Bookmaker">Bookmaker</a> bugs are trackedherebug.skia.org/6898. +<a href="#Bookmaker">Bookmaker</a> bugs are trackedhere. |