From ce1012403bacf017c0d91c779fa9e9bddd1475f8 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Fri, 1 Sep 2017 15:51:02 -0400 Subject: bookmaker spelling with fixed linux build Work on spell-checker to identify errors and isolate more concepts requiring definitions. fix linux build Docs-Preview: https://skia.org/?cl=42103 Docs-Preview: https://skia.org/?cl=41180 Tbr: caryclark@google.com Bug: skia: 6898 Change-Id: Id939b0c2915c22e0fa1b15623c1a56fbe9d4051d Reviewed-on: https://skia-review.googlesource.com/42103 Reviewed-by: Cary Clark Commit-Queue: Cary Clark --- site/user/api/SkCanvas_Reference.md | 677 ++++++++++++++++++------------------ site/user/api/SkPaint_Reference.md | 282 +++++++-------- site/user/api/SkPath_Reference.md | 135 +++---- site/user/api/undocumented.md | 32 ++ site/user/api/usingBookmaker.md | 4 +- 5 files changed, 579 insertions(+), 551 deletions(-) (limited to 'site/user') 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 Canvas from Surface Canvas generated by GPU Surface uses Vulkan or OpenGL to draw to the GPU. To draw to a document, obtain Canvas from SVG Canvas, Document PDF, or Picture Recorder. -Document-based Canvas and other Canvas subclasses reference Device describing the +Document based Canvas and other Canvas Subclasses reference Device describing the destination. Canvas can be constructed to draw to Bitmap without first creating Raster Surface. @@ -46,7 +46,7 @@ This approach may be deprecated in the future. | struct | description | | --- | --- | | Lattice | Divides Bitmap, Image into a rectangular grid. | -| SaveLayerRec | Contains state to create the layer offscreen. | +| SaveLayerRec | Contains state to create Layer. | ## Constructors @@ -95,7 +95,7 @@ when no Surface is required, and some helpers | drawLine | Draws line segment between two points. | | drawOval | Draws Oval using Clip, Matrix, and Paint. | | drawPaint | Fills Clip with Paint. | -| drawPatch | Draws cubic Coons patch. | +| drawPatch | Draws Coons patch. | | drawPath | Draws Path using Clip, Matrix, and Paint. | | drawPicture | Draws Picture using Clip and Matrix. | | drawPoint | Draws point at (x, y) position. | @@ -114,7 +114,7 @@ when no Surface is required, and some helpers | drawString | Draws null terminated string at (x, y) using font advance. | | drawVertices | Draws Vertices, a triangle mesh. | | flush | Triggers execution of all pending draw operations. | -| getBaseLayerSize | Gets size of base layer in global coordinates. | +| getBaseLayerSize | Gets size of base Layer in global coordinates. | | getDeviceClipBounds | Returns IRect bounds of Clip. | | getDrawFilter | Legacy; to be deprecated. | | getGrContext | Returns GPU Context of the GPU Surface. | @@ -137,15 +137,14 @@ when no Surface is required, and some helpers | restoreToCount | Restores changes to Clip and Matrix to given depth. | | rotate | Rotates Matrix. | | save | Saves Clip and Matrix on stack. | -| saveLayer | Saves Clip and Matrix on stack; creates offscreen. | -| saveLayerAlpha | Saves Clip and Matrix on stack; creates offscreen; sets opacity. | -| saveLayerPreserveLCDTextRequests | Saves Clip and Matrix on stack; creates offscreen for LCD text. | +| saveLayer | Saves Clip and Matrix on stack; creates Layer. | +| saveLayerAlpha | Saves Clip and Matrix on stack; creates Layer; sets opacity. | +| saveLayerPreserveLCDTextRequests | Saves Clip and Matrix on stack; creates Layer for LCD text. | | scale | Scales Matrix. | | setAllowSimplifyClip | Experimental. | | setDrawFilter | Legacy; to be deprecated. | | setMatrix | Sets Matrix. | -| skew | Skews Matrix. | -| translate | Translates Matrix. | +| skew | Skews Matrix. | translate | Translates Matrix. | | writePixels | Copies and converts rectangle of pixels to Canvas. | @@ -190,7 +189,7 @@ interval from one Surface row to the next, or ### Example -
Allocates a three by three bitmap, clears it to white, and draws a black pixel +
Allocates a three by three bitmap, clears it to white, and draws a black pixel in the center.
#### Example Output @@ -230,7 +229,7 @@ Valid parameters include: pixels is not nullptr; rowBytes is zero or large enough to contain width pixels of kN32 SkColorType. -Pass zero for rowBytes to compute rowBytes from fo width and size of pixel. +Pass zero for rowBytes to compute rowBytes from width and size of pixel. If rowBytes is greater than zero, it must be equal to or greater than width times bytes required for Image Color Type. @@ -256,7 +255,7 @@ interval from one Surface row to the next, or ### Example -
Allocates a three by three bitmap, clears it to white, and draws a black pixel +
Allocates a three by three bitmap, clears it to white, and draws a black pixel in the center.
#### Example Output @@ -309,7 +308,7 @@ SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr) Creates Canvas of the specified dimensions without a Surface. -Used by subclasses with custom implementations for draw methods. +Used by Subclasses with custom implementations for draw methods. If props equals nullptr, Surface Properties are created with Surface Properties Legacy Font Host settings, which choose the pixel striping direction and order. Since a platform may dynamically @@ -407,7 +406,7 @@ storage of Raster Surface ### Example -
The actual output depends on the installed fonts.
+
The actual output depends on the installed fonts.
#### Example Output @@ -497,7 +496,7 @@ device independent fonts ### Example -
The actual output depends on the installed fonts.
+
The actual output depends on the installed fonts.
#### Example Output @@ -526,14 +525,14 @@ device independent fonts virtual ~SkCanvas() -Draw saved layers, if any. +Draw saved Layers, if any. Free up resources used by Canvas. ### Example -
Canvas offscreen draws into bitmap. saveLayerAlpha 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 +
Canvas Layer draws into bitmap. saveLayerAlpha sets up an additional +drawing surface that blends with the bitmap. When Layer goes out of +scope, Layer Destructor is called. The saved Layer is restored, drawing transparent letters.
### See Also @@ -660,13 +659,13 @@ If Canvas is associated with Layer in global canvas coordinates. The +origin of the base Layer is always (0,0). The area available for drawing may be smaller (due to clipping or saveLayer). ### Return Value -integral width and height of base layer +integral width and height of base Layer ### Example @@ -766,7 +765,7 @@ storage for writable pixels' Image Info; may be nullptr rowBytes storage for writable pixels' row bytes; may be nullptr origin -storage for Canvas top layer origin, its top left corner; +storage for Canvas top Layer origin, its top left corner; may be nullptr @@ -781,11 +780,11 @@ address of pixels, or nullptr if inaccessible ### Example -
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 +
Draws "" on the device. Then draws "" in Layer, and reads +Layer to add a large dotted "". Finally blends Layer with the device. -The offscreen and blended result appear on the CPU and GPU but the large dotted +The Layer and blended result appear on the CPU and GPU but the large dotted "" appear only on the CPU.
--- @@ -800,13 +799,13 @@ SkRasterHandleAllocator::Handle accessTopRasterHandle() const Returns custom context that tracks the Matrix and Clip. Use Raster Handle Allocator to blend Skia 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 SkRasterHandleAllocator::MakeCanvas, 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, Copies rectangle of pixels from Canvas into dstPixels. Matrix and Clip are -ignored. Source rectangle corners are (srcX, srcY) and -(this->imageInfo.width(), this->imageInfo.height()). -Destination rectangle corners are (0, 0) and (dstInfo.width(), dstInfo.height()). +ignored. Source rectangle corners are (srcX, srcY) and(this->imageInfo.width(), this->imageInfo.height()). +Destination rectangle corners are (0, 0) and(dstInfo.width(), dstInfo.height()). Copies each readable pixel intersecting both rectangles, without scaling, converting to dstInfo.colorType() and dstInfo.alphaType() if required. @@ -929,15 +927,15 @@ true if pixels were copied
A black circle drawn on a blue background provides an image to copy. readPixels copies one quarter of the canvas into each of the four corners. -The offscreen draws over the image.
+The Layer draws over the image.
### Example -
Canvas returned by Raster Surface has premultiplied pixel values. -clear takes unpremultiplied input with Color Alpha equal 0x80 -and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multipled by Color Alpha -to generate premultipled value 0x802B5580. readPixels converts pixel back -to unpremultipled value 0x8056A9FF, introducing error.
+
Canvas returned by Raster Surface has Premultiplied pixel values. +clear takes Unpremultiplied input with Color Alpha equal 0x80 +and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha +to generate Premultiplied value 0x802B5580. readPixels converts pixel back +to Unpremultiplied value 0x8056A9FF, introducing error.
#### Example Output @@ -959,9 +957,8 @@ bool readPixels(const SkPixmap& pixmap, int srcX, int srcY) Copies rectangle of pixels from Canvas into pixmap. Matrix and Clip are -ignored. Source rectangle corners are (srcX, srcY) and -(this->imageInfo.width(), this->imageInfo.height()). -Destination rectangle are (0, 0) and (pixmap.width(), pixmap.height()). +ignored. Source rectangle corners are (srcX, srcY) and(this->imageInfo.width(), this->imageInfo.height()). +Destination rectangle are (0, 0) and(pixmap.width(), pixmap.height()). Copies each readable pixel intersecting both rectangles, without scaling, converting to pixmap.colorType() and pixmap.alphaType() if required. @@ -1005,9 +1002,9 @@ true if pixels were copied ### Example -
clear takes unpremultiplied input with Color Alpha equal 0x80 -and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multipled by Color Alpha -to generate premultipled value 0x802B5580.
+
clear takes Unpremultiplied input with Color Alpha equal 0x80 +and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha +to generate Premultiplied value 0x802B5580.
#### Example Output @@ -1028,8 +1025,7 @@ bool readPixels(const SkBitmap& bitmap, int srcX, int srcY) Copies rectangle of pixels from Canvas into bitmap. Matrix and Clip are -ignored. Source rectangle corners are (srcX, srcY) and -(this->imageInfo.width(), this->imageInfo.height()). +ignored. Source rectangle corners are (srcX, srcY) and(this->imageInfo.width(), this->imageInfo.height()). Destination rectangle corners are (0, 0) and (bitmap.width(), bitmap.height()). Copies each readable pixel intersecting both rectangles, without scaling, converting to bitmap.colorType() and bitmap.alphaType() if required. @@ -1074,9 +1070,9 @@ true if pixels were copied ### Example -
clear takes unpremultiplied input with Color Alpha equal 0x80 -and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multipled by Color Alpha -to generate premultipled value 0x802B5580.
+
clear takes Unpremultiplied input with Color Alpha equal 0x80 +and Color RGB equal 0x55, 0xAA, 0xFF. Color RGB is multiplied by Color Alpha +to generate Premultiplied value 0x802B5580.
#### Example Output @@ -1102,10 +1098,9 @@ bool writePixels(const SkImageInfo& info, const void* pixels, size_t rowBytes, Copies rectangle from pixels to Canvas. Matrix and Clip are ignored. Source rectangle corners are (0, 0) and (info.width(), info.height()). -Destination rectangle corners are (x, y) and -(this->imageInfo.width(), this->imageInfo.height()). Copies each readable pixel -intersecting both rectangles, without scaling, converting to -this->imageInfo.colorType() and this->imageInfo.alphaType() if required. +Destination rectangle corners are (x, y) and(this->imageInfo.width(), this->imageInfo.height()). +Copies each readable pixel +intersecting both rectangles, without scaling, converting tothis->imageInfo.colorType()andthis->imageInfo.alphaType()if required. Pixels are writable when Device is raster, or backed by a GPU. Pixels are not writable when SkCanvas is returned by SkDocument::beginPage, @@ -1123,7 +1118,7 @@ Does not copy, and returns false if: - +
Source and destination rectangles do not intersect.
pixels could not be converted to this->imageInfo.colorType() or this->imageInfo.alphaType().
pixels could not be converted tothis->imageInfo.colorType()orthis->imageInfo.alphaType().
Canvas pixels are not writable; for instance, Canvas is document-based.
rowBytes is too small to contain one row of pixels.
@@ -1162,11 +1157,11 @@ bool writePixels(const SkBitmap& bitmap, int x, int y) Copies rectangle from pixels to Canvas. Matrix and Clip are ignored. -Source rectangle corners are (0, 0) and (bitmap.width(), bitmap.height()). -Destination rectangle corners are (x, y) and -(this->imageInfo.width(), this->imageInfo.height()). Copies each readable pixel -intersecting both rectangles, without scaling, converting to -this->imageInfo.colorType() and this->imageInfo.alphaType() if required. +Source rectangle corners are (0, 0) and(bitmap.width(), bitmap.height()). + +Destination rectangle corners are (x, y) and(this->imageInfo.width(), this->imageInfo.height()). +Copies each readable pixel +intersecting both rectangles, without scaling, converting tothis->imageInfo.colorType()andthis->imageInfo.alphaType()if required. Pixels are writable when Device is raster, or backed by a GPU. Pixels are not writable when SkCanvas is returned by SkDocument::beginPage, @@ -1185,8 +1180,8 @@ Does not copy, and returns false if: - - + +
Source and destination rectangles do not intersect.
bitmap does not have allocated pixels.
bitmap pixels could not be converted to this->imageInfo.colorType() or this->imageInfo.alphaType().
Canvas pixels are not writable; for instance, Canvas is document-based.
bitmap pixels could not be converted tothis->imageInfo.colorType()orthis->imageInfo.alphaType().
Canvas pixels are not writable; for instance, Canvas is document based.
bitmap pixels are inaccessible; for instance, bitmap wraps a texture.
@@ -1278,16 +1273,100 @@ the red square is not translated, and is drawn at the origin.
Layer + +## restore + +
+void restore()
+
+ +Removes changes to Matrix, Clip, and Draw Filter since Canvas state was +last saved. The state is removed from the stack. + +Does nothing if the stack is empty. + +### Example + +
+ +--- + + +## getSaveCount + +
+int getSaveCount() const
+
+ +Returns the number of saved states, each containing: Matrix, Clip, and Draw Filter. +Equals the number of save calls less the number of restore calls plus one. +The save count of a new canvas is one. + +### Return Value + +depth of save state stack + +### Example + +
+ +#### Example Output + +~~~~ +depth = 1 +depth = 2 +depth = 1 +~~~~ + +
+ +--- + + +## restoreToCount + +
+void restoreToCount(int saveCount)
+
+ +Restores state to Matrix, Clip, and Draw Filter values when save, saveLayer, +saveLayerPreserveLCDTextRequests, or saveLayerAlpha returned saveCount. -Layer allocates a temporary offscreen Bitmap to draw into. When the drawing is +Does nothing if saveCount is greater than state stack count. +Restores state to initial values if saveCount is less than or equal to one. + +### Parameters + + + +
saveCount +depth of state stack to restore
+ +### Example + +
+ +#### Example Output + +~~~~ +depth = 1 +depth = 3 +depth = 1 +~~~~ + +
+ +--- + +# Layer +Layer allocates a temporary Bitmap to draw into. When the drawing is complete, the Bitmap is drawn into the Canvas. -Layer is saved in a stack along with other saved state. When state with a Layer -is restored, the offscreen Bitmap is drawn into the previous layer. +Layer is saved in a stack along with other saved state. When state with a Layer +is restored, the Bitmap is drawn into the previous Layer. -Layer may be initialized with the contents of the previous layer. When Layer is -restored, its Bitmap can be modified by Paint passed to Layer to apply +Layer may be initialized with the contents of the previous Layer. When Layer is +restored, its Bitmap can be modified by Paint passed to Layer to apply Color Alpha, Color Filter, Image Filter, and Blend Mode. @@ -1298,15 +1377,15 @@ int saveLayer(const SkRect* bounds, const SkPaint* paint) Saves Matrix, Clip, and Draw Filter (Draw Filter deprecated on most platforms), -and allocates an offscreen Bitmap for subsequent drawing. +and allocates a Bitmap for subsequent drawing. Calling restore discards changes to Matrix, Clip, and Draw Filter, -and draws the offscreen bitmap. +and draws the Bitmap. Matrix may be changed by translate, scale, rotate, skew, concat, setMatrix, and resetMatrix. Clip may be changed by clipRect, clipRRect, clipPath, clipRegion. -Rect bounds suggests but does not define the offscreen size. To clip drawing to +Rect bounds suggests but does not define the Bitmap size. To clip drawing to a specific rectangle, use clipRect. Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and @@ -1317,9 +1396,9 @@ Call restoreToCount with returned value t ### Parameters +hint to limit the size of the Layer; may be nullptr +graphics state for Layer; may be nullptr
bounds -hint to limit the size of the offscreen; may be nullptr
paint -graphics state for offscreen; may be nullptr
@@ -1329,7 +1408,7 @@ depth of saved stack ### Example -
Rectangles are blurred by Image Filter when restore draws offscreen to main +
Rectangles are blurred by Image Filter when restore draws Layer to main Canvas.
--- @@ -1339,15 +1418,15 @@ int saveLayer(const SkRect& bounds, const SkPaint* paint) Saves Matrix, Clip, and Draw Filter (Draw Filter deprecated on most platforms), -and allocates an offscreen Bitmap for subsequent drawing. +and allocates a Bitmap for subsequent drawing. Calling restore discards changes to Matrix, Clip, and Draw Filter, -and draws the offscreen Bitmap. +and draws the Bitmap. Matrix may be changed by translate, scale, rotate, skew, concat, setMatrix, and resetMatrix. Clip may be changed by clipRect, clipRRect, clipPath, clipRegion. -Rect bounds suggests but does not define the offscreen size. To clip drawing to +Rect bounds suggests but does not define the Layer size. To clip drawing to a specific rectangle, use clipRect. Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and @@ -1358,9 +1437,9 @@ Call restoreToCount with returned value t ### Parameters +hint to limit the size of Layer; may be nullptr +graphics state for Layer; may be nullptr
bounds -hint to limit the size of the offscreen; may be nullptr
paint -graphics state for offscreen; may be nullptr
@@ -1370,9 +1449,9 @@ depth of saved stack ### Example -
Rectangles are blurred by Image Filter when restore draws offscreen to main Canvas. -The red rectangle is clipped; it does not fully fit on the offscreen Canvas. -Image Filter blurs past edge of offscreen so red rectangle is blurred on all sides.
+
Rectangles are blurred by Image Filter when restore draws Layer to main Canvas. +The red rectangle is clipped; it does not fully fit on Layer. +Image Filter blurs past edge of Layer so red rectangle is blurred on all sides.
--- @@ -1384,16 +1463,16 @@ int saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint) Saves Matrix, Clip, and Draw Filter (Draw Filter deprecated on most platforms), -and allocates an offscreen bitmap for subsequent drawing. -LCD Text is preserved when the offscreen is drawn to the prior layer. +and allocates a Bitmap for subsequent drawing. +LCD Text is preserved when the Layer is drawn to the prior Layer. Calling restore discards changes to Matrix, Clip, and Draw Filter, -and draws the offscreen bitmap. +and draws Layer. Matrix may be changed by translate, scale, rotate, skew, concat, setMatrix, and resetMatrix. Clip may be changed by clipRect, clipRRect, clipPath, clipRegion. -Rect bounds suggests but does not define the offscreen size. To clip drawing to +Rect bounds suggests but does not define the Layer size. To clip drawing to a specific rectangle, use clipRect. Optional Paint paint applies Color Alpha, Color Filter, Image Filter, and @@ -1402,15 +1481,15 @@ Optional Paint restoreToCount with returned value to restore this and subsequent saves. Draw text on an opaque background so that LCD Text blends correctly with the -prior layer. LCD Text drawn on a background with transparency may result in +prior Layer. LCD Text drawn on a background with transparency may result in incorrect banding. ### Parameters +hint to limit the size of Layer; may be nullptr +graphics state for Layer; may be nullptr
bounds -hint to limit the size of the offscreen; may be nullptr
paint -graphics state for offscreen; may be nullptr
@@ -1432,16 +1511,16 @@ int saveLayerAlpha(const SkRect* bounds, U8CPU alpha) Saves Matrix, Clip, and Draw Filter (Draw Filter deprecated on most platforms), -and allocates an offscreen bitmap for subsequent drawing. +and allocates Bitmap for subsequent drawing. Calling restore discards changes to Matrix, Clip, and Draw Filter, -and blends the offscreen bitmap with alpha opacity onto the prior layer. +and blends Layer with alpha opacity onto prior Layer. Matrix may be changed by translate, scale, rotate, skew, concat, setMatrix, and resetMatrix. Clip may be changed by clipRect, clipRRect, clipPath, clipRegion. -Rect bounds suggests but does not define the offscreen size. To clip drawing to +Rect bounds suggests but does not define Layer size. To clip drawing to a specific rectangle, use clipRect. alpha of zero is fully transparent, 255 is fully opaque. @@ -1451,9 +1530,9 @@ Call restoreToCount with returned value t ### Parameters +hint to limit the size of Layer; may be nullptr +opacity of Layer
bounds -hint to limit the size of the offscreen; may be nullptr
alpha -opacity of the offscreen
@@ -1480,32 +1559,32 @@ enum { typedef uint32_t SaveLayerFlags; SaveLayerFlags provides options that may be used in any combination in SaveLayerRec, -defining how the offscreen allocated by saveLayer operates. +defining how Layer allocated by saveLayer operates. ### Constants - - - + +Skips setting a clip to the Layer bounds.
SkCanvas::kIsOpaque_SaveLayerFlag 1Creates offscreen without transparency. Flag is ignored if layer Paint contains + SkCanvas::kIsOpaque_SaveLayerFlag 1Creates Layer without transparency. Flag is ignored if Layer Paint contains Image Filter or Color Filter.
SkCanvas::kPreserveLCDText_SaveLayerFlag 2Creates offscreen for LCD text. Flag is ignored if layer Paint contains + SkCanvas::kPreserveLCDText_SaveLayerFlag 2Creates Layer for LCD text. Flag is ignored if Layer Paint contains Image Filter or Color Filter.
SkCanvas::kInitWithPrevious_SaveLayerFlag 4Initializes offscreen with the contents of the previous layer. SkCanvas::kInitWithPrevious_SaveLayerFlag 4Initializes Layer with the contents of the previous Layer.
SkCanvas::kDontClipToLayer_Legacy_SaveLayerFlag 0x80000000Only present on Android. -Skips setting a clip to the layer bounds.
### Example -
Canvas layer captures red and blue circles scaled up by four. -scalePaint blends offscreen back with transparency.
+
Canvas Layer captures red and blue circles scaled up by four. +scalePaint blends Layer back with transparency.
@@ -1521,47 +1600,47 @@ const SkImageFilter* SaveLayerFlags fSaveLayerFlags; }; -SaveLayerRec contains the state used to create the layer offscreen. +SaveLayerRec contains the state used to create the Layer. const SkRect* fBounds -fBounds is used as a hint to limit the size of the offscreen; may be nullptr. -fBounds suggests but does not define the offscreen size. To clip drawing to +fBounds is used as a hint to limit the size of Layer; may be nullptr. +fBounds suggests but does not define Layer size. To clip drawing to a specific rectangle, use clipRect. const SkPaint* fPaint -fPaint modifies how the offscreen overlays the prior layer; may be nullptr. +fPaint modifies how Layer overlays the prior Layer; may be nullptr. Color Alpha, Blend Mode, Color Filter, Draw Looper, Image Filter, and -Mask Filter affect the offscreen draw. +Mask Filter affect Layer draw. const SkImageFilter* fBackdrop -fBackdrop applies Image Filter to the prior layer when copying to the layer -offscreen; may be nullptr. Use kInitWithPrevious SaveLayerFlag to copy the -prior layer without an Image Filter. +fBackdrop applies Image Filter to the prior Layer when copying to the Layer; +may be nullptr. Use kInitWithPrevious SaveLayerFlag to copy the +prior Layer without an Image Filter. const SkImage* fClipMask -restore clips the layer offscreen by the alpha channel of fClipMask when -the offscreen is copied to Device. fClipMask may be nullptr. . +restore clips Layer by the Color Alpha channel of fClipMask when +Layer is copied to Device. fClipMask may be nullptr. . const SkMatrix* fClipMatrix -fClipMatrix transforms fClipMask before it clips the layer offscreen. If +fClipMatrix transforms fClipMask before it clips Layer. If fClipMask describes a translucent gradient, it may be scaled and rotated without introducing artifacts. fClipMatrix may be nullptr. SaveLayerFlags fSaveLayerFlags -fSaveLayerFlags are used to create layer offscreen without transparency, -create layer offscreen for LCD text, and to create layer offscreen with the -contents of the previous layer. +fSaveLayerFlags are used to create Layer without transparency, +create Layer for LCD text, and to create Layer with the +contents of the previous Layer. ### Example -
Canvas 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 +
Canvas Layer captures a red Anti-aliased circle and a blue Aliased circle scaled +up by four. After drawing another red circle without scaling on top, the Layer is transferred to the main canvas.
@@ -1601,11 +1680,11 @@ Sets fBounds, bounds -offscreen dimensions; may be nullptr +Layer dimensions; may be nullptr paint -applied to offscreen when overlaying prior layer; may be nullptr +applied to Layer when overlaying prior Layer; may be nullptr saveLayerFlags -SaveLayerRec options to modify offscreen +SaveLayerRec options to modify Layer @@ -1637,15 +1716,14 @@ Sets fBounds, bounds -offscreen dimensions; may be nullptr +Layer dimensions; may be nullptr paint -applied to offscreen when overlaying prior layer; +applied to Layer when overlaying prior Layer; may be nullptr backdrop -prior layer copied to offscreen with Image Filter; -may be nullptr +prior Layer copied with Image Filter; may be nullptr saveLayerFlags -SaveLayerRec options to modify offscreen +SaveLayerRec options to modify Layer @@ -1674,28 +1752,28 @@ SaveLayerRec(const SkRect* bounds, const SkPaint* paint, Not ready for general use.Sets fBounds, fPaint, fBackdrop, fClipMask, fClipMatrix, and fSaveLayerFlags. -clipMatrix uses alpha channel of image, transformed by clipMatrix, to clip layer -when drawn to Canvas. +clipMatrix uses Color Alpha channel of image, transformed by clipMatrix, to clip +Layer when drawn to Canvas. Implementation is incomplete; has no effect if Device is GPU-backed. ### Parameters +Layer dimensions; may be nullptr +graphics state applied to Layer when overlaying prior +Layer; may be nullptr +clip applied to Layer; may be nullptr +SaveLayerRec options to modify Layer
bounds -offscreen dimensions; may be nullptr
paint -graphics state applied to offscreen when overlaying prior -layer; may be nullptr
backdrop -prior layer copied to offscreen with Image Filter; +prior Layer copied with Image Filter; may be nullptr
clipMask -clip applied to layer; may be nullptr
clipMatrix matrix applied to clipMask; may be nullptr to use identity matrix
saveLayerFlags -SaveLayerRec options to modify offscreen
@@ -1710,23 +1788,23 @@ int saveLayer(const SaveLayerRec& layerRec) Saves Matrix, Clip, and Draw Filter (Draw Filter deprecated on most platforms), -and allocates an offscreen bitmap for subsequent drawing. +and allocates Bitmap for subsequent drawing. Calling restore discards changes to Matrix, Clip, and Draw Filter, -and blends the offscreen bitmap with alpha opacity onto the prior layer. +and blends Bitmap with Color Alpha opacity onto the prior Layer. Matrix may be changed by translate, scale, rotate, skew, concat, setMatrix, and resetMatrix. Clip may be changed by clipRect, clipRRect, clipPath, clipRegion. -SaveLayerRec contains the state used to create the layer offscreen. +SaveLayerRec contains the state used to create the Layer. Call restoreToCount with returned value to restore this and subsequent saves. ### Parameters +Layer state
layerRec -offscreen state
@@ -1736,98 +1814,13 @@ depth of save state stack ### Example -
The example draws an image, and saves it into a layer with kInitWithPrevious SaveLayerFlag. -Next it punches a hole in the layer and restore with SkBlendMode::kPlus. -Where the layer was cleared, the original image will draw unchanged. +
The example draws an image, and saves it into a Layer with kInitWithPrevious SaveLayerFlag. +Next it punches a hole in Layer and restore with SkBlendMode::kPlus. +Where Layer was cleared, the original image will draw unchanged. Outside of the circle the mandrill is brightened.
--- - -## restore - -
-void restore()
-
- -Removes changes to Matrix, Clip, and Draw Filter since Canvas state was -last saved. The state is removed from the stack. - -Does nothing if the stack is empty. - -### Example - -
- ---- - - -## getSaveCount - -
-int getSaveCount() const
-
- -Returns the number of saved states, each containing: Matrix, Clip, and Draw Filter. -Equals the number of save calls less the number of restore calls plus one. -The save count of a new canvas is one. - -### Return Value - -depth of save state stack - -### Example - -
- -#### Example Output - -~~~~ -depth = 1 -depth = 2 -depth = 1 -~~~~ - -
- ---- - - -## restoreToCount - -
-void restoreToCount(int saveCount)
-
- -Restores state to Matrix, Clip, and Draw Filter values when save, saveLayer, -saveLayerPreserveLCDTextRequests, or saveLayerAlpha returned saveCount. - -Does nothing if saveCount is greater than state stack count. -Restores state to initial values if saveCount is less than or equal to one. - -### Parameters - - - -
saveCount -depth of state stack to restore
- -### Example - -
- -#### Example Output - -~~~~ -depth = 1 -depth = 3 -depth = 1 -~~~~ - -
- ---- - # Matrix @@ -1840,7 +1833,7 @@ void translate(SkScalar dx, SkScalar dy) Translate Matrix by dx along the x-axis and dy along the y-axis. Mathematically, replace Matrix with a translation matrix -pre-multiplied with Matrix. +Premultiplied with Matrix. This has the effect of moving the drawing by (dx, dy) before transforming the result with Matrix. @@ -1876,7 +1869,7 @@ void scale(SkScalar sx, SkScalar sy) Scale Matrix by sx on the x-axis and sy on the y-axis. Mathematically, replace Matrix with a scale matrix -pre-multiplied with Matrix. +Premultiplied with Matrix. This has the effect of scaling the drawing by (sx, sy) before transforming the result with Matrix. @@ -1906,7 +1899,7 @@ void rotate(SkScalar degrees) Rotate Matrix by degrees. Positive degrees rotates clockwise. Mathematically, replace Matrix with a rotation matrix -pre-multiplied with Matrix. +Premultiplied with Matrix. This has the effect of rotating the drawing by degrees before transforming the result with Matrix. @@ -1932,9 +1925,9 @@ void rotate(SkScalar degrees, SkScalar px, SkScalar py) Rotate Matrix by degrees about a point at (px, py). Positive degrees rotates clockwise. -Mathematically, construct a rotation matrix. Pre-multiply the rotation matrix by +Mathematically, construct a rotation matrix. Premultiply the rotation matrix by a translation matrix, then replace Matrix with the resulting matrix -pre-multiplied with Matrix. +Premultiplied with Matrix. This has the effect of rotating the drawing about a given point before transforming the result with Matrix. @@ -1967,7 +1960,7 @@ Skew Matrix by sx on the x skews the drawing right as y increases; a positive value of sy skews the drawing down as x increases. -Mathematically, replace Matrix with a skew matrix pre-multiplied with Matrix. +Mathematically, replace Matrix with a skew matrix Premultiplied with Matrix. This has the effect of skewing the drawing by (sx, sy) before transforming the result with Matrix. @@ -1985,9 +1978,9 @@ amount to skew in y
Black text mimics an oblique text style by using a negative skew in x that shifts the geometry to the right as the y values decrease. -Red text uses a positive skew in y to shift the geometry down as the x values +Red text uses a positive skew in y to shift the geometry down as the x values increase. -Blue text combines x and y skew to rotate and scale.
+Blue text combines x and y skew to rotate and scale.
--- @@ -1998,7 +1991,7 @@ Blue text combines x and y skew to Matrix with matrix pre-multiplied with existing Matrix. +Replace Matrix with matrix Premultiplied with existing Matrix. This has the effect of transforming the drawn geometry by matrix, before transforming the result with existing Matrix. @@ -2006,7 +1999,7 @@ transforming the result with existing Matrix. ### Parameters +matrix to Premultiply with existing Matrix
matrix -matrix to pre-multiply with existing Matrix
@@ -2096,14 +2089,14 @@ prior Clip to form the replacement Clip. to subtract Path from Clip; use SkClipOp::kIntersect to intersect Path with Clip. -A clipping Path may be anti-aliased; if Path, after transformation, is +A clipping Path may be Anti-aliased; if Path, after transformation, is composed of horizontal and vertical lines, clearing Anti-alias 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 Aliased, +rectangular clip. If clipping Path has Anti-alias 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 Anti-aliased clip looks smoother but draws slower. Clip can combine with Rect and Round Rect primitives; like Path, these are transformed by Matrix before they are combined with Clip. @@ -2113,10 +2106,10 @@ and is unaffected by Matrix. ### Example -
Draw a red circle with an aliased clip and an anti-aliased clip. +
Draw a red circle with an Aliased clip and an Anti-aliased 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.
+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.
## clipRect @@ -2126,7 +2119,7 @@ void clipRect(const SkRect& rect, SkClipOp op, bool doAntiAlias) Replace Clip with the intersection or difference of Clip and rect, -with an aliased or anti-aliased clip edge. rect is transformed by Matrix +with an Aliased or Anti-aliased clip edge. rect is transformed by Matrix before it is combined with Clip. ### Parameters @@ -2136,7 +2129,7 @@ before it is combined with Clip. op Clip Op to apply to Clip doAntiAlias -true if Clip is to be anti-aliased +true if Clip is to be Anti-aliased @@ -2151,7 +2144,7 @@ void clipRect(const SkRect& rect, SkClipOp op) Replace Clip with the intersection or difference of Clip and rect. -Resulting Clip is aliased; pixels are fully contained by the clip. +Resulting Clip is Aliased; pixels are fully contained by the clip. rect is transformed by Matrix before it is combined with Clip. ### Parameters @@ -2174,7 +2167,7 @@ void clipRect(const SkRect& rect, bool doAntiAlias = false) Replace Clip with the intersection of Clip and rect. -Resulting Clip is aliased; pixels are fully contained by the clip. +Resulting Clip is Aliased; pixels are fully contained by the clip. rect is transformed by Matrix before it is combined with Clip. @@ -2183,14 +2176,14 @@ before it is combined with Clip. +true if Clip is to be Anti-aliased
rect Rect to combine with Clip
doAntiAlias -true if Clip is to be anti-aliased
### Example -
A circle drawn in pieces looks uniform when drawn aliased. -The same circle pieces blend with pixels more than once when anti-aliased, +
A circle drawn in pieces looks uniform when drawn Aliased. +The same circle pieces blend with pixels more than once when Anti-aliased, visible as a thin pair of lines through the right circle.
--- @@ -2202,12 +2195,12 @@ visible as a thin pair of lines through the right circle.
-Sets the max clip rectangle, which can be set by clipRect, clipRRect and +Sets the maximum clip rectangle, which can be set by clipRect, clipRRect and clipPath and intersect the current clip with the specified rect. -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 rect to disable max clip. +Pass an empty rect to disable maximum clip. ### Parameters @@ -2228,7 +2221,7 @@ void clipRRect(const SkRRect& rrect, SkClipOp op, bool doAntiAlias) Replace Clip with the intersection or difference of Clip and rrect, -with an aliased or anti-aliased clip edge. +with an Aliased or Anti-aliased clip edge. rrect is transformed by Matrix before it is combined with Clip. @@ -2239,7 +2232,7 @@ before it is combined with Clip. op Clip Op to apply to Clip doAntiAlias -true if Clip is to be antialiased +true if Clip is to be Anti-aliased @@ -2254,7 +2247,7 @@ void clipRRect(const SkRRect& rrect, SkClipOp op) Replace Clip with the intersection or difference of Clip and rrect. -Resulting Clip is aliased; pixels are fully contained by the clip. +Resulting Clip is Aliased; pixels are fully contained by the clip. rrect is transformed by Matrix before it is combined with Clip. ### Parameters @@ -2277,7 +2270,7 @@ void clipRRect(const SkRRect& rrect, bool doAntiAlias = false) Replace Clip with the intersection of Clip and rrect, -with an aliased or anti-aliased clip edge. +with an Aliased or Anti-aliased clip edge. rrect is transformed by Matrix before it is combined with Clip. ### Parameters @@ -2285,7 +2278,7 @@ with an aliased or anti-aliased clip edge. +true if Clip is to be Anti-aliased
rrect Round Rect to combine with Clip
doAntiAlias -true if Clip is to be antialiased
@@ -2303,7 +2296,7 @@ void clipPath(const SkPath& path, SkClipOp op, bool doAntiAlias) Replace Clip with the intersection or difference of Clip and path, -with an aliased or anti-aliased clip edge. Path Fill Type determines if path +with an Aliased or Anti-aliased clip edge. Path Fill Type determines if path describes the area inside or outside its contours; and if Path Contour overlaps itself or another Path Contour, whether the overlaps form part of the area. path is transformed by Matrix before it is combined with Clip. @@ -2315,7 +2308,7 @@ itself or another Path Contour, whether the overlaps form op Clip Op to apply to Clip doAntiAlias -true if Clip is to be antialiased +true if Clip is to be Anti-aliased @@ -2334,7 +2327,7 @@ void clipPath(const SkPath& path, SkClipOp op) Replace Clip with the intersection or difference of Clip and path. -Resulting Clip is aliased; pixels are fully contained by the clip. +Resulting Clip is Aliased; pixels are fully contained by the clip. Path Fill Type determines if path describes the area inside or outside its contours; and if Path Contour overlaps itself or another Path Contour, whether the overlaps form part of the area. @@ -2363,7 +2356,7 @@ void clipPath(const SkPath& path, bool doAntiAlias = false) Replace Clip with the intersection of Clip and path. -Resulting Clip is aliased; pixels are fully contained by the clip. +Resulting Clip is Aliased; pixels are fully contained by the clip. Path Fill Type determines if path describes the area inside or outside its contours; and if Path Contour overlaps itself or another Path Contour, whether the overlaps form part of the area. @@ -2374,7 +2367,7 @@ itself or another Path Contour, whether the overlaps form +true if Clip is to be Anti-aliased
path Path to combine with Clip
doAntiAlias -true if Clip is to be antialiased
@@ -2393,7 +2386,7 @@ is set to SkPath::kWinding FillType, the void setAllowSimplifyClip(bool allow) -Only used for testing.Set to simplify clip stack using path ops. +Only used for testing.Set to simplify clip stack using PathOps. --- @@ -2405,7 +2398,7 @@ void clipRegion(const SkRegion& deviceRgn, SkClipOp op = SkClipOp::kIntersect) Replace Clip with the intersection or difference of Clip and Region deviceRgn. -Resulting Clip is aliased; pixels are fully contained by the clip. +Resulting Clip is Aliased; pixels are fully contained by the clip. deviceRgn is unaffected by Matrix. ### Parameters @@ -2419,8 +2412,8 @@ Resulting Clip is aliased; pixels are fully contained by the ### Example -
region is unaffected by canvas rotation; rect is affected by canvas rotation. -Both clips are aliased; this is unnoticable on Region clip because it +
region is unaffected by canvas rotation; iRect is affected by canvas rotation. +Both clips are Aliased; this is not noticeable on Region clip because it aligns to pixel boundaries.
--- @@ -2509,7 +2502,7 @@ Return bounds of Clip, transformed by inverse of SkRect::MakeEmpty, where all Rect sides equal zero. Rect returned is outset by one to account for partial pixel coverage if Clip -is anti-aliased. +is Anti-aliased. ### Return Value @@ -2541,7 +2534,7 @@ Return bounds of bounds to SkRect::MakeEmpty, where all Rect sides equal zero. bounds is outset by one to account for partial pixel coverage if Clip -is anti-aliased. +is Anti-aliased. ### Parameters @@ -2651,7 +2644,7 @@ Fill Clip with Color color -Unpremultiplied Color ARGB +Unpremultiplied Color ARGB mode SkBlendMode used to combine source color and destination @@ -2676,7 +2669,7 @@ This has the effect of replacing all pixels contained by Clip color -Unpremultiplied Color ARGB +Unpremultiplied Color ARGB @@ -3099,7 +3092,7 @@ void drawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint Draw Round Rect outer and inner using Clip, Matrix, and Paint paint. outer must contain inner or the drawing is undefined. -In paint: Paint Style determines if rrect is stroked or filled; +In paint: Paint Style determines if Round Rect is stroked or filled; if stroked, Paint Stroke Width describes the line thickness. If stroked and Round Rect corner has zero length radii, Paint Stroke Join can draw corners rounded or square. @@ -3166,7 +3159,7 @@ half the diameter of Circle void drawCircle(SkPoint center, SkScalar radius, const SkPaint& paint) -Draw Circle at (cx, cy) with radius using Clip, Matrix, and Paint paint. +Draw Circle at center with radius using Clip, Matrix, and Paint paint. If radius is zero or less, nothing is drawn. In paint: Paint Style determines if Circle is stroked or filled; if stroked, Paint Stroke Width describes the line thickness. @@ -3258,9 +3251,9 @@ If rx and rect Rect bounds of Round Rect to draw rx -semiaxis length in x of oval describing rounded corners +axis length in x of oval describing rounded corners ry -semiaxis length in y of oval describing rounded corners +axis length in y of oval describing rounded corners paint stroke, blend, color, and so on, used to draw @@ -3396,23 +3389,23 @@ enum SrcRectConstraint { kFast SrcRectConstraint, }; -SrcRectConstraint controls the behavior at the edge of the Rect src, provided to -drawImageRect, trading off speed for precision. +SrcRectConstraint controls the behavior at the edge of source Rect, +provided to drawImageRect, trading off speed for precision. -Image Filter in Paint may sample multiple pixels in the image. Rect src +Image Filter in Paint may sample multiple pixels in the image. Source Rect restricts the bounds of pixels that may be read. Image Filter may slow down if -it cannot read outside the bounds, when sampling near the edge of Rect src. +it cannot read outside the bounds, when sampling near the edge of source Rect. SrcRectConstraint specifies whether an Image Filter is allowed to read pixels -outside Rect src. +outside source Rect. ### Constants - + -
SkCanvas::kStrict_SrcRectConstraint Requires Image_Filter to respect Rect src,sampling only inside of its bounds, possibly with a performance penalty. SkCanvas::kStrict_SrcRectConstraint Requires Image_Filter to respect source Rect,sampling only inside of its bounds, possibly with a performance penalty.
SkCanvas::kFast_SrcRectConstraint Permits Image_Filter to sample outside of Rect srcby half the width of Image Filter, permitting it to run faster but with + SkCanvas::kFast_SrcRectConstraint Permits Image_Filter to sample outside of source Rectby half the width of Image Filter, permitting it to run faster but with error at the image edges.
@@ -3421,7 +3414,7 @@ error at the image edges.
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 kStrict SrcRectConstraint shows only a blur of black and white. Drawing the checkerboard with kFast SrcRectConstraint allows red to bleed in the corners.
@@ -3497,7 +3490,7 @@ as Shader made from image's edge color when it samples outside of its bounds. constraint set to kStrict SrcRectConstraint limits Paint Filter Quality to -sample within src; set to kFast SrcRectConstraint allows sampling outside to +sample within isrc; set to kFast SrcRectConstraint allows sampling outside to improve performance. ### Parameters @@ -3512,7 +3505,7 @@ destination Rect of Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint -filter strictly within src or draw faster +filter strictly within isrc or draw faster @@ -3539,7 +3532,7 @@ as Shader made from image's edge color when it samples outside of its bounds. constraint set to kStrict SrcRectConstraint limits Paint Filter Quality to -sample within src; set to kFast SrcRectConstraint allows sampling outside to +sample within image; set to kFast SrcRectConstraint allows sampling outside to improve performance. ### Parameters @@ -3552,7 +3545,7 @@ destination Rect of Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint -filter strictly within src or draw faster +filter strictly within image or draw faster @@ -3625,7 +3618,7 @@ as Shader made from image's edge color when it samples outside of its bounds. constraint set to kStrict SrcRectConstraint limits Paint Filter Quality to -sample within src; set to kFast SrcRectConstraint allows sampling outside to +sample within image; set to kFast SrcRectConstraint allows sampling outside to improve performance. ### Parameters @@ -3640,7 +3633,7 @@ destination Rect of Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint -filter strictly within src or draw faster +filter strictly within image or draw faster @@ -3668,7 +3661,7 @@ as Shader made from image's edge color when it samples outside of its bounds. constraint set to kStrict SrcRectConstraint limits Paint Filter Quality to -sample within src; set to kFast SrcRectConstraint allows sampling outside to +sample within image; set to kFast SrcRectConstraint allows sampling outside to improve performance. ### Parameters @@ -3681,7 +3674,7 @@ destination Rect of Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint -filter strictly within src or draw faster +filter strictly within image or draw faster @@ -3701,7 +3694,7 @@ void drawImageNine(const SkImage* image, const SkIRect& center, Draw Image image stretched differentially to fit into Rect dst. IRect center divides the image into nine sections: four sides, four corners, and -the center. Corners are unscaled or scaled down proportionately if their sides +the center. Corners are unmodified or scaled down proportionately if their sides are larger than dst; center and four sides are scaled to fit remaining space, if any. Additionally transform draw using Clip, Matrix, and optional Paint paint. @@ -3731,9 +3724,9 @@ and so on; or nullptr ### Example
The leftmost image is smaller than center; only corners are drawn, all scaled to fit. -The second image equals the size of center; only corners are drawn, unscaled. -The remaining images are larger than center. All corners draw unscaled. The sides -and center are scaled if needed to take up the remaining space.
+The second image 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 and center are scaled if needed to take up the remaining space.
--- @@ -3744,7 +3737,7 @@ void drawImageNine(const sk_sp& image, const SkIRect& center, Draw Image image stretched differentially to fit into Rect dst. IRect center divides the image into nine sections: four sides, four corners, and -the center. Corners are unscaled or scaled down proportionately if their sides +the center. Corners are not scaled, or scaled down proportionately if their sides are larger than dst; center and four sides are scaled to fit remaining space, if any. Additionally transform draw using Clip, Matrix, and optional Paint paint. @@ -3775,7 +3768,7 @@ and so on; or nullptr
The two leftmost images has four corners and sides to the left and right of center. The leftmost image scales the width of corners proportionately to fit. -The third and fourth image corners are unscaled; the sides and center are scaled to +The third and fourth image corners are not scaled; the sides and center are scaled to fill the remaining space. The rightmost image has four corners scaled vertically to fit, and uses sides above and below center to fill the remaining space.
@@ -3889,7 +3882,7 @@ just as Shader made from constraint set to kStrict SrcRectConstraint limits Paint Filter Quality to -sample within src; set to kFast SrcRectConstraint allows sampling outside to +sample within isrc; set to kFast SrcRectConstraint allows sampling outside to improve performance. ### Parameters @@ -3904,7 +3897,7 @@ destination Rect of image to draw to Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint -sample strictly within src, or draw faster +sample strictly within isrc, or draw faster @@ -3921,7 +3914,7 @@ void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, Draw Bitmap bitmap, scaled and translated to fill Rect dst. -isrc is on integer pixel boundaries; dst may include fractional boundaries. +bitmap bounds is on integer pixel boundaries; dst may include fractional boundaries. Additionally transform draw using Clip, Matrix, and optional Paint paint. If Paint paint is supplied, apply Color Filter, Color Alpha, Image Filter, @@ -3934,7 +3927,7 @@ just as Shader made from constraint set to kStrict SrcRectConstraint limits Paint Filter Quality to -sample within src; set to kFast SrcRectConstraint allows sampling outside to +sample within bitmap; set to kFast SrcRectConstraint allows sampling outside to improve performance. ### Parameters @@ -3947,7 +3940,7 @@ destination Rect of image to draw to Paint containing Blend Mode, Color Filter, Image Filter, and so on; or nullptr constraint -filter strictly within src or draw faster +filter strictly within bitmap or draw faster @@ -3967,7 +3960,7 @@ void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, Draw Bitmap bitmap stretched differentially to fit into Rect dst. IRect center divides the bitmap into nine sections: four sides, four corners, -and the center. Corners are unscaled or scaled down proportionately if their +and the center. Corners are not scaled, or scaled down proportionately if their sides are larger than dst; center and four sides are scaled to fit remaining space, if any. @@ -4000,7 +3993,7 @@ and so on; or nullptr
The two leftmost bitmap draws has four corners and sides to the left and right of center. The leftmost bitmap draw scales the width of corners proportionately to fit. -The third and fourth draw corners are unscaled; the sides and center are scaled to +The third and fourth draw corners are not scaled; the sides and center are scaled to fill the remaining space. The rightmost bitmap draw has four corners scaled vertically to fit, and uses sides above and below center to fill the remaining space.
@@ -4129,7 +4122,7 @@ and so on; or nullptr
The two leftmost bitmap draws has four corners and sides to the left and right of center. The leftmost bitmap 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 bitmap draw has four corners scaled vertically to fit, and uses sides above and below center to fill the remaining space.
@@ -4180,8 +4173,8 @@ and so on; or nullptr ### Example
The leftmost image is smaller than center; only corners are drawn, all scaled to fit. -The second image 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 image 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.
--- @@ -4205,12 +4198,12 @@ and its baseline at y. paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. ### Parameters +character code points or Glyphs drawn
text -character code points or glyphs drawn
byteLength byte length of text array
x @@ -4249,12 +4242,12 @@ and its baseline at y. paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. ### Parameters @@ -4293,12 +4286,12 @@ and its baseline at y. paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. ### Parameters
string -character code points or glyphs drawn, +character code points or Glyphs drawn, ending with a char value of zero
x start of string on x-axis
@@ -4328,7 +4321,7 @@ void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], Draw each glyph in text with the origin in pos array, using Clip, Matrix, and -Paintpaint. The number of entries in pos array must match the number of glyphs +Paintpaint. The number of entries in pos array must match the number of Glyphs described by byteLength of text. text's meaning depends on Paint Text Encoding; by default, text encoding is @@ -4339,7 +4332,7 @@ baseline is positioned at y. Text size is affect All elements of paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. Layout engines such as Harfbuzz 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
string -character code points or glyphs drawn, +character code points or Glyphs drawn, ending with a char value of zero
x start of string on x-axis
+character code points or Glyphs drawn
text -character code points or glyphs drawn
byteLength byte length of text array
pos @@ -4373,26 +4366,26 @@ void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], Draw each glyph in text with its (x, y) origin composed from xpos array and constY, using Clip, Matrix, and Paint paint. The number of entries in xpos array -must match the number of glyphs described by byteLength of text. +must match the number of Glyphs described by byteLength of text. text's meaning depends on Paint Text Encoding; by default, text encoding is -UTF-8. pos elements' meaning depends on Paint Text Align and Paint Vertical Text; +UTF-8. xpos elements' meaning depends on Paint Text Align and Paint Vertical Text; by default each glyph's left side bearing is positioned at an xpos element and its baseline is positioned at constY. Text size is affected by Matrix and Paint Text Size. All elements of paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. Layout engines such as Harfbuzz 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 Glyphs share the same baseline. ### Parameters +character code points or Glyphs drawn
text -character code points or glyphs drawn
byteLength byte length of text array
xpos @@ -4433,12 +4426,12 @@ baseline at origin y. Text size is affected by < All elements of paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. ### Parameters +character code points or Glyphs drawn
text -character code points or glyphs drawn
byteLength byte length of text array
path @@ -4481,18 +4474,18 @@ baseline at origin y. Text size is affected by < All elements of paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. ### Parameters +character code points or Glyphs drawn @@ -4521,16 +4514,16 @@ using Clip, Matrix, and RectcullRect is a conservative bounds of text, taking into account -RSXform and paint. If cullrect is outside of Clip, canvas can skip drawing. +RSXform and paint. If cullRect is outside of Clip, canvas can skip drawing. All elements of paint: Path Effect, Rasterizer, Mask Filter, Shader, Color Filter, Image Filter, and Draw Looper; apply to text. By default, draws -filled 12 point black glyphs. +filled 12 point black Glyphs. ### Parameters
text -character code points or glyphs drawn
byteLength byte length of text array
path Path providing text baseline
matrix -transform of glyphs before mapping to path; may be nullptr +transform of Glyphs before mapping to path; may be nullptr to use identity Matrix
paint text size, blend, color, and so on, used to draw
+character code points or Glyphs drawn +Glyphs, positions, and their paints' text size, typeface, and so on +Glyphs, positions, and their paints' text size, typeface, and so on # # With FreeType, this is equivalent in spirit to the FT LOAD TARGET LIGHT value supplied to FT Load Glyph. It chooses a lighter hinting algorithm for non-monochrome modes. -Generated glyphs may be fuzzy but better resemble their original shape. +Generated Glyphs may be fuzzy but better resemble their original shape. # Vertical Text Text may be drawn by positioning each glyph, or by positioning the first glyph and -using Font Advance to position subsequent glyphs. By default, each successive glyph -is positioned to the right of the preceeding glyph. Vertical Text sets successive -glyphs to position below the preceeding glyph. +using Font Advance to position subsequent Glyphs. By default, each successive glyph +is positioned to the right of the preceding glyph. Vertical Text sets successive +Glyphs to position below the preceding glyph. -Skia can translate text character codes as a series of glyphs, but does not implement +Skia can translate text character codes as a series of Glyphs, 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 Kerning pairs. Use +a text shaping engine likeHarfBuzzto translate text runs into glyph series. Vertical Text 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 -If true, glyphs are drawn top to bottom instead of left to right. +If true, Glyphs are drawn top to bottom instead of left to right. Equivalent to getFlags masked with kVerticalText Flag. @@ -1605,8 +1606,8 @@ bold font face using the platform's Font Man Use Text Skew X to approximate an italic font style when the italic font face is not available. -A FreeType-based port may define SK USE FREETYPE EMBOLDEN at compile time to direct -the font engine to create the bold glyphs. Otherwise, the extra bold is computed +A FreeType based port may define SK USE FREETYPE EMBOLDEN at compile time to direct +the font engine to create the bold Glyphs. Otherwise, the extra bold is computed by increasing the stroke width and setting the Style to kStrokeAndFill Style as needed. Fake Bold is disabled by default. @@ -1653,7 +1654,7 @@ paint.isFakeBoldText() == !!(paint.getFlags() & SkPaint::kFakeBoldText_Flag) void setFakeBoldText(bool fakeBoldText) -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 kFakeBoldText Flag if fakeBoldText is true. Clears kFakeBoldText Flag if fakeBoldText is false. @@ -1680,13 +1681,13 @@ paint1 == paint2 --- # Full Hinting Spacing -Full Hinting Spacing adjusts the character spacing by the difference of the -hinted and unhinted left and right side bearings, -if Hinting is set to kFull Hinting. Full Hinting Spacing only -applies to platforms that use FreeType as their Font Engine. +if Hinting is set to kFull Hinting, Full Hinting Spacing adjusts the character +spacing by the difference of the hinted and UnhintedLeft Side Bearing and +Right Side Bearing. Full Hinting Spacing only applies to platforms that use +FreeType as their Font Engine. -Full Hinting Spacing 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. +Full Hinting Spacing 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. ## isDevKernText @@ -1746,8 +1747,8 @@ paint1 == paint2 Filter Quality trades speed for image filtering when the image is scaled. A lower Filter Quality draws faster, but has less fidelity. A higher Filter Quality draws slower, but looks better. -If the image is unscaled, the Filter Quality choice will not result in a noticable -difference. +If the image is drawn without scaling, the Filter Quality choice will not result +in a noticeable difference. Filter Quality is used in Paint 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. -Color is not premultiplied; +Color is not Premultiplied; Color Alpha sets the transparency independent of Color RGB: Color RGB Red, Color RGB Blue, and Color RGB Green. The bit positions of Color Alpha and Color RGB 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 -Retrieves Color Alpha and Color RGB, unpremultiplied, packed into 32 bits. +Retrieves Alpha and Color RGB, Unpremultiplied, packed into 32 bits. Use helpers SkColorGetA, SkColorGetR, SkColorGetG, and SkColorGetB to extract a color component. ### Return Value -UnpremultipliedColor ARGB +UnpremultipliedColor ARGB ### Example @@ -1892,13 +1893,13 @@ Yellow is 100% red, 100% green, and 0% blue. void setColor(SkColor color) -Sets Color Alpha and Color RGB used when stroking and filling. The color is a 32-bit value, -unpremutiplied, packing 8-bit components for Color Alpha, Color RGB Red, Color RGB Blue, and Color RGB Green. +Sets Alpha and Color RGB used when stroking and filling. The color is a 32-bit value, +Unpremultiplied, packing 8-bit components for Alpha, Red, Blue, and Green. ### Parameters
text -character code points or glyphs drawn
byteLength byte length of text array
xform @@ -4558,7 +4551,7 @@ void drawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, Draw Text Blob blob at (x, y), using Clip, Matrix, and Paint paint. -blob contains glyphs, their positions, and paint attributes specific to text: +blob contains Glyphs, their positions, and paint attributes specific to text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, Paint Text Align, Paint Hinting, Anti-alias, Paint Fake Bold, Font Embedded Bitmaps, Full Hinting Spacing, LCD Text, Linear Text, @@ -4570,7 +4563,7 @@ Elements of paint: blob -glyphs, positions, and their paints' text size, typeface, and so on
x horizontal offset applied to blob
y @@ -4593,7 +4586,7 @@ void drawTextBlob(const sk_sp& blob, SkScalar x, SkScalar y, Draw Text Blob blob at (x, y), using Clip, Matrix, and Paint paint. -blob contains glyphs, their positions, and paint attributes specific to text: +blob contains Glyphs, their positions, and paint attributes specific to text: Typeface, Paint Text Size, Paint Text Scale X, Paint Text Skew X, Paint Text Align, Paint Hinting, Anti-alias, Paint Fake Bold, Font Embedded Bitmaps, Full Hinting Spacing, LCD Text, Linear Text, @@ -4605,7 +4598,7 @@ Elements of paint: blob -glyphs, positions, and their paints' text size, typeface, and so on
x horizontal offset applied to blob
y @@ -4793,7 +4786,7 @@ void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPaint& paint) -Draw a cubic Coons patch: the interpolation of four cubics with shared corners, +Draws a Coons patch: the interpolation of four cubics with shared corners, associating a color, and optionally a texture coordinate, with each corner. The Coons patch uses Clip and Matrix, Paint paint's Shader, Color Filter, @@ -4801,8 +4794,8 @@ The Coons patch uses Clip a as the Coons patch texture; Blend Mode mode combines Color colors and Shader if both are provided. -Point array cubics specifies four cubics starting at the top left corner, -in clockwise order, sharing every fourth point. The last cubic ends at the +Point array cubics specifies four Cubics starting at the top left corner, +in clockwise order, sharing every fourth point. The last Cubic ends at the first point. Color array color associates colors with corners in top left, top right, @@ -4818,7 +4811,7 @@ corners in top left, top right, bottom right, bottom left order.
colors Color array, one for each corner
texCoords -Point array of texure coordinates, mapping Shader to corners; +Point array of texture coordinates, mapping Shader to corners; may be nullptr
mode @@ -4839,7 +4832,7 @@ void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], const SkPaint& paint) -Draw a cubic Coons patch: the interpolation of four cubics with shared corners, +Draws Cubic Coons patch: the interpolation of four cubics with shared corners, associating a color, and optionally a texture coordinate, with each corner. The Coons patch uses Clip and Matrix, Paint paint's Shader, Color Filter, @@ -4847,8 +4840,8 @@ The Coons patch uses Clip a as the Coons patch texture; Blend Mode mode combines Color colors and Shader if both are provided. -Point array cubics specifies four cubics starting at the top left corner, -in clockwise order, sharing every fourth point. The last cubic ends at the +Point array cubics specifies four Cubics starting at the top left corner, +in clockwise order, sharing every fourth point. The last Cubic ends at the first point. Color array color associates colors with corners in top left, top right, @@ -4864,7 +4857,7 @@ corners in top left, top right, bottom right, bottom left order.
colors Color array, one for each corner
texCoords -Point array of texure coordinates, mapping Shader to corners; +Point array of texture coordinates, mapping Shader to corners; may be nullptr
paint @@ -4899,7 +4892,7 @@ to draw, if present. For each entry in the array, Re xform, text, and colors if present, must contain count entries. Optional colors are applied for each sprite using Blend Mode. Optional cullRect is a conservative bounds of all transformed sprites. -If cullrect is outside of Clip, canvas can skip drawing. +If cullRect is outside of Clip, canvas can skip drawing. ### Parameters @@ -4942,7 +4935,7 @@ to draw, if present. For each entry in the array, Re xform, text, and colors if present, must contain count entries. Optional colors is applied for each sprite using Blend Mode. Optional cullRect is a conservative bounds of all transformed sprites. -If cullrect is outside of Clip, canvas can skip drawing. +If cullRect is outside of Clip, canvas can skip drawing. ### Parameters @@ -4983,7 +4976,7 @@ to draw, if present. For each entry in the array, Re xform and text must contain count entries. Optional cullRect is a conservative bounds of all transformed sprites. -If cullrect is outside of Clip, canvas can skip drawing. +If cullRect is outside of Clip, canvas can skip drawing. ### Parameters @@ -5021,7 +5014,7 @@ to draw, if present. For each entry in the array, Re xform and text must contain count entries. Optional cullRect is a conservative bounds of all transformed sprites. -If cullrect is outside of Clip, canvas can skip drawing. +If cullRect is outside of Clip, 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 Paint are opaque, and cannot be edited outside of the Paint to affect it. The implementation is free to defer computations associated with the Paint, or ignore them altogether. For instance, some GPU implementations draw all -Path geometries with anti-aliasing, regardless of how SkPaint::kAntiAlias Flag +Path geometries with Anti-aliasing, regardless of how SkPaint::kAntiAlias Flag is set in Paint. Paint 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 | | --- | --- | | Initializers | Constructors and initialization. | -| Destructor | Paint termination. | +| Destructor | Paint termination. | | Management | Paint copying, moving, comparing. | | Hinting | Glyph outline adjustment. | | Flags | Attributes represented by single bits. | | Anti-alias | Approximating coverage with transparency. | | Dither | Distributing color error. | | Device Text | Increase precision of glyph position. | -| Font Embedded Bitmaps | Custom-sized bitmap glyphs. | +| Font Embedded Bitmaps | Custom sized bitmap Glyphs. | | Automatic Hinting | Always adjust glyph paths. | | Vertical Text | Orient text from top to bottom. | | Fake Bold | Approximate font styles. | @@ -70,12 +70,12 @@ Multiple colors are drawn either by using multiple paints or with objects like | Text Size | Overall height in points. | | Text Scale X | Text horizontal scale. | | Text Skew X | Text horizontal slant. | -| Text Encoding | Text encoded as characters or glyphs. | +| Text Encoding | Text encoded as characters or Glyphs. | | Font Metrics | Common glyph dimensions. | | Measure Text | Width, height, bounds of text. | -| Text Path | Geometry of glyphs. | +| Text Path | Geometry of Glyphs. | | Text Intercepts | Advanced underline, strike through. | -| Fast Bounds | Appproxiate area required by Paint. | +| Fast Bounds | Approximate area required by Paint. | ## Constants @@ -122,12 +122,12 @@ Multiple colors are drawn either by using multiple paints or with objects like | canComputeFastBounds | Returns true if settings allow for fast bounds computation. | | computeFastBounds | Returns fill bounds for quick reject tests. | | computeFastStrokeBounds | Returns stroke bounds for quick reject tests. | -| containsText | Returns if all text corresponds to glyphs. | -| countText | Returns number of glyphs in text. | +| containsText | Returns if all text corresponds to Glyphs. | +| countText | Returns number of Glyphs in text. | | doComputeFastBounds | Returns bounds for quick reject tests. | | flatten | Serializes into a buffer. | | getAlpha | Returns Color Alpha, color opacity. | -| getBlendMode | Returns Blend Mode, how colors combine with dest. | +| getBlendMode | Returns Blend Mode, how colors combine with Device. | | getColor | Returns Color Alpha and Color RGB, one drawing color. | | getColorFilter | Returns Color Filter, how colors are altered. | | getDrawLooper | Returns Draw Looper, multiple layers. | @@ -162,9 +162,9 @@ Multiple colors are drawn either by using multiple paints or with objects like | getTextSize | Returns text size in points. | | getTextWidths | Returns advance and bounds for each glyph in text. | | getTypeface | Returns Typeface, font description. | -| glyphsToUnichars | Converts glyphs into text. | +| glyphsToUnichars | Converts Glyphs into text. | | isAntiAlias | Returns true if Anti-alias is set. | -| isAutohinted | Returns true if glyphs are always hinted. | +| isAutohinted | Returns true if Glyphs are always hinted. | | isDevKernText | Returns true if Full Hinting Spacing is set. | | isDither | Returns true if Dither is set. | | isEmbeddedBitmapText | Returns true if Font Embedded Bitmaps is set. | @@ -187,7 +187,7 @@ Multiple colors are drawn either by using multiple paints or with objects like | setAlpha | Sets Color Alpha, color opacity. | | setAntiAlias | Sets or clears Anti-alias. | | setARGB | Sets color by component. | -| setAutohinted | Sets glyphs to always be hinted. | +| setAutohinted | Sets Glyphs to always be hinted. | | setBlendMode | Sets Blend Mode, how colors combine with destination. | | setColor | Sets Color Alpha and Color RGB, one drawing color. | | setColorFilter | Sets Color Filter, alters color. | @@ -219,7 +219,7 @@ Multiple colors are drawn either by using multiple paints or with objects like | setTypeface | Sets Typeface, font description. | | setVerticalText | Sets or clears Vertical Text. | | textToGlyphs | Converts text into glyph indices. | -| toString | Converts Paint to machine parsable form (Developer Mode) | +| toString | Converts Paint to machine readable form. | | unflatten | Populates from a serialized stream. | # Initializers @@ -270,7 +270,7 @@ Constructs Paint with default values. | Vertical Text | 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 SkUserConfig.h or predefined by the +paint default values. The overrides may be included in "SkUserConfig.h" or predefined by the build system. ### Return Value @@ -643,7 +643,7 @@ by the client. ### Parameters +serialized data describing Paint content
buffer -serialized data to unflatten
@@ -683,7 +683,7 @@ to 26.6 fractional pixels.
SkPaint::kNormal_Hinting 2Modifies glyph outlines to improve constrast. This is the default. @@ -747,9 +747,9 @@ Does not check for valid values of hi | Hinting | value | effect on generated glyph outlines | | --- | --- | --- | | kNo Hinting | 0 | leaves glyph outlines unchanged from their native representation | -| kSlight Hinting | 1 | modifies glyph outlines minimally to improve constrast | -| kNormal Hinting | 2 | modifies glyph outlines to improve constrast | -| kFull Hinting | 3 | modifies glyph outlines for maxiumum constrast | +| kSlight Hinting | 1 | modifies glyph outlines minimally to improve contrast | +| kNormal Hinting | 2 | modifies glyph outlines to improve contrast | +| kFull Hinting | 3 | modifies glyph outlines for maximum contrast | ### Parameters @@ -929,17 +929,17 @@ paint.isDither() If kAntiAlias Flag is clear, pixel centers contained by the shape edge are drawn opaque. If kAntiAlias Flag is set, pixels are drawn with Color Alpha equal to their coverage. -The rule for aliased pixels is inconsistent across platforms. A shape edge +The rule for Aliased pixels is inconsistent across platforms. A shape edge passing through the pixel center may, but is not required to, draw the pixel. -Raster Engine draws aliased pixels whose centers are on or to the right of the start of an +Raster Engine draws Aliased pixels whose centers are on or to the right of the start of an active Path edge, and whose center is to the left of the end of the active Path edge. -A platform may only support anti-aliased drawing. Some GPU-backed platforms use -supersampling to anti-alias all drawing, and have no mechanism to selectively -alias. +A platform may only support Anti-aliased drawing. Some GPU-backed platforms use +Supersampling to Anti-alias all drawing, and have no mechanism to selectively +Alias. -The amount of coverage computed for anti-aliased pixels also varies across platforms. +The amount of coverage computed for Anti-aliased pixels also varies across platforms. Anti-alias is disabled by default. Anti-alias can be enabled by default by setting SkPaintDefaults Flags to kAntiAlias Flag @@ -949,8 +949,8 @@ at compile time.
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.
+The lines are drawn into Bitmap, then drawn magnified to make the +Aliasing easier to see. ## isAntiAlias @@ -1017,7 +1017,7 @@ paint1 == paint2 --- # Dither -Dither increases fidelity by adjusting the color of adjcent pixels. +Dither 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 kRGB 565 SkColorType and kRGBA 8888 SkColorType gradients, @@ -1120,7 +1120,7 @@ Gradient Color RGB-565 When set, Flags kLCDRenderText Flag takes advantage of the organization of Color RGB 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. LCD Text can be enabled on devices that orient stripes horizontally or vertically, and that order the color components as Color RGB or Color RBG. @@ -1136,8 +1136,8 @@ Either or both techniques can be enabled. ### Example
Four commas are drawn normally and with combinations of LCD Text and Subpixel Text. -When Subpixel Text is disabled, the comma glyphs are indentical, but not evenly spaced. -When Subpixel Text is enabled, the comma glyphs are unique, but appear evenly spaced.
+When Subpixel Text is disabled, the comma Glyphs are identical, but not evenly spaced. +When Subpixel Text is enabled, the comma Glyphs are unique, but appear evenly spaced. ## Linear Text @@ -1213,7 +1213,7 @@ of the color increases, the edge of the glyph appears to move towards the outsid bool isSubpixelText() const -If true, glyphs at different sub-pixel positions may differ on pixel edge coverage. +If true, Glyphs at different sub-pixel positions may differ on pixel edge coverage. Equivalent to getFlags masked with kSubpixelText Flag. @@ -1243,7 +1243,7 @@ paint.isSubpixelText() == !!(paint.getFlags() & SkPaint::kSubpixelText_Flag) void setSubpixelText(bool subpixelText) -Requests, but does not require, that glyphs respect sub-pixel positioning. +Requests, but does not require, that Glyphs respect sub-pixel positioning. Sets kSubpixelText Flag if subpixelText is true. Clears kSubpixelText Flag if subpixelText is false. @@ -1273,7 +1273,7 @@ paint1 == paint2 When set, Flags kLCDRenderText Flag takes advantage of the organization of Color RGB 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. LCD Text can be enabled on devices that orient stripes horizontally or vertically, and that order the color components as Color RGB or Color RBG. @@ -1284,7 +1284,7 @@ the color components as Color RGB or Color RBG bool isLCDRenderText() const -If true, glyphs may use LCD striping to improve glyph edges. +If true, Glyphs may use LCD striping to improve glyph edges. Returns true if Flags kLCDRenderText Flag is set. @@ -1314,7 +1314,7 @@ paint.isLCDRenderText() == !!(paint.getFlags() & SkPaint::kLCDRenderText_Flag) void setLCDRenderText(bool lcdText) -Requests, but does not require, that glyphs use LCD striping for glyph edges. +Requests, but does not require, that Glyphs use LCD striping for glyph edges. Sets kLCDRenderText Flag if lcdText is true. Clears kLCDRenderText Flag if lcdText is false. @@ -1341,7 +1341,7 @@ paint1 == paint2 --- # Font Embedded Bitmaps -Font Embedded Bitmaps allows selecting custom-sized bitmap glyphs. +Font Embedded Bitmaps allows selecting custom sized bitmap Glyphs. Flags kEmbeddedBitmapText Flag 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 kEmbeddedBitmap ### Example
-!fiddle
The hintgasp TrueType font in the Skia resources/fonts directory includes an embedded -bitmap glyph at odd font sizes. This example works on platforms that use FreeType -as their Font Engine. -Windows may, but is not required to, return a bitmap glyph if kEmbeddedBitmapText Flag is set.
SkBitmap bitmap; +
The "" TrueType font in the Skia resources/fonts directory +includes an embedded bitmap Glyph at odd font sizes. This example works +on platforms that use FreeType as their Font Engine. +Windows may, but is not required to, return a bitmap glyph if +kEmbeddedBitmapText Flag is set.
SkBitmap bitmap; bitmap.allocN32Pixels(30, 15); bitmap.eraseColor(0); SkCanvas offscreen(bitmap); @@ -1374,7 +1375,7 @@ paint.
bool isEmbeddedBitmapText() const -If true, Font Engine may return glyphs from font bitmaps instead of from outlines. +If true, Font Engine may return Glyphs from font bitmaps instead of from outlines. Equivalent to getFlags masked with kEmbeddedBitmapText Flag. @@ -1432,7 +1433,7 @@ paint1 == paint2 # Automatic Hinting If Hinting is set to kNormal Hinting or kFull Hinting, Automatic Hinting -instructs the Font Manager to always hint glyphs. +instructs the Font Manager to always hint Glyphs. Automatic Hinting has no effect if Hinting is set to kNo Hinting or kSlight Hinting. @@ -1447,7 +1448,7 @@ bool isAutohinted() const If true, and if Hinting is set to kNormal Hinting or kFull Hinting, and if platform uses FreeType as the Font Manager, instruct the Font Manager to always hint -glyphs. +Glyphs. Equivalent to getFlags masked with kAutoHinting Flag. @@ -1482,7 +1483,7 @@ void setAutohinted(bool useAutohinter) If Hinting is set to kNormal Hinting or kFull Hinting and useAutohinter is set, -instruct the Font Manager to always hint glyphs. +instruct the Font Manager to always hint Glyphs. Automatic Hinting has no effect if Hinting is set to kNo Hinting or kSlight Hinting. @@ -1510,14 +1511,14 @@ setting for kAutoHinting Flag
+UnpremultipliedColor ARGB
color -Unpremultiplied Color ARGB
@@ -1931,11 +1932,11 @@ green1 == green2 uint8_t getAlpha() const -Retrieves Color Alpha from the Color used when stroking and filling. +Retrieves Alpha from the Color used when stroking and filling. ### Return Value -Color Alpha ranging from zero, fully transparent, to 255, fully opaque +Alpha ranging from zero, fully transparent, to 255, fully opaque ### Example @@ -1958,7 +1959,7 @@ Retrieves Color Alpha from the -Replaces Color Alpha, leaving Color RGB +Replaces Alpha, leaving Color RGB unchanged. An out of range value triggers an assert in the debug build. a is a value from zero to 255. a set to zero makes Color fully transparent; a set to 255 makes Color @@ -1967,7 +1968,7 @@ fully opaque. ### Parameters +Alpha component of Color
a -Color Alpha component of Color
@@ -1993,8 +1994,7 @@ void setARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b) Sets Color used when drawing solid fills. The color components range from 0 to 255. -The color is unpremultiplied; -Color Alpha sets the transparency independent of Color RGB. +The color is Unpremultiplied; Alpha sets the transparency independent of Color RGB. ### Parameters @@ -2085,8 +2085,8 @@ a fill draw. @@ -2204,7 +2203,7 @@ The default width for the paint is zero. ### Example -
raster gpu
The pixels hit to represent thin lines vary with the angle of the +
The pixels hit to represent thin lines vary with the angle of the line and the platform's implementation.
@@ -2282,7 +2281,7 @@ is replaced with kBevel Join. miter limit = 1 / sin ( angle / 2 )Miter Limit default value is 4. The default may be changed at compile time by setting SkPaintDefaults MiterLimit -in SkUserConfig.h or as a define supplied by the build environment. +in "SkUserConfig.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 Style Fill, or false if it ### Example -
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. +
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. At the highest precision, the filled path has high fidelity compared to the original stroke.
--- @@ -3134,7 +3133,7 @@ replace Path with a modification when drawn< --- # Mask Filter Methods -Mask Filter uses Color Alpha of the shape drawn to create Mask Alpha. +Mask Filter uses coverage of the shape drawn to create Mask Alpha. Mask Filter operates at a lower level than Rasterizer; Mask Filter takes a Mask, and returns a Mask. Mask Filter may change the geometry and transparency of the shape, such as creating a blur effect. @@ -3327,7 +3326,7 @@ and returns a Mask. Rasterizer may change the geometry and transparency of the shape, such as creating a shadow effect. Rasterizer forms the base of Rasterizer Layer, which creates effects like embossing and outlining. -Rasterizer applies to Rect, Region, Round Rect, Arc, Circle, Oval, +Rasterizer applies to Rect, Region, Round Rect, Arcs, Circles, Ovals, Path, and Text. ### Example @@ -3423,7 +3422,7 @@ how geometry is converted to Mask AlphaBlend Mode set to SkBlendMode::kSrcOver. Image Filter creates a new bitmap, which is drawn to the device using the set Blend Mode. Image Filter is higher level than Mask Filter; for instance, an Image Filter -can operate on all channels of Color, while Mask Filter generates Color Alpha only. +can operate on all channels of Color, while Mask Filter generates Alpha only. Image Filter operates independently of and can be used in combination with Mask Filter and Rasterizer. @@ -3660,11 +3659,11 @@ enum Align { }; Align adjusts the text relative to the text position. -Align affects glyphs drawn with: SkCanvas::drawText, SkCanvas::drawPosText, +Align affects Glyphs drawn with: SkCanvas::drawText, SkCanvas::drawPosText, SkCanvas::drawPosTextH, SkCanvas::drawTextOnPath, SkCanvas::drawTextOnPathHV, SkCanvas::drawTextRSXform, SkCanvas::drawTextBlob, and SkCanvas::drawString; -as well as calls that place text glyphs like getTextWidths and getTextPath. +as well as calls that place text Glyphs like getTextWidths and getTextPath. 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 TextEncoding { }; TextEncoding determines whether text specifies character codes and their encoded size, -or glyph indices. Character codes use the encoding specified by theUnicode standardhttp://unicode.org/standard/standard.html. +or glyph indices. Character codes use the encoding specified by theUnicode standard. Character codes encoded size are specified by UTF-8, UTF-16, or UTF-32. All character encoding are able to represent all of Unicode, differing only in the total storage required. -UTF-8 (RFC 3629)https://tools.ietf.org/html/rfc3629is made up of 8-bit bytes, +UTF-8 (RFC 3629)is made up of 8-bit bytes, and is a superset of ASCII. -UTF-16 (RFC 2781)https://tools.ietf.org/html/rfc2781is made up of 16-bit words, +UTF-16 (RFC 2781)is made up of 16-bit words, and is a superset of Unicode ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF. -UTF-32http://www.unicode.org/versions/Unicode5.0.0/ch03.pdfis +UTF-32is made up of 32-bit words, and is a superset of Unicode. Font Manager uses font data to convert character code points into glyph indices. @@ -4050,7 +4049,7 @@ one of: kUTF8 TextEncoding, Font Metrics -Font Metrics describe dimensions common to the glyphs in Typeface. +Font Metrics describe dimensions common to the Glyphs in Typeface. The dimensions are computed by Font Manager from font data and do not take Paint settings other than Text Size into account. @@ -4099,7 +4098,7 @@ bool hasStrikeoutPosition(Sk FontMetrics is filled out by getFontMetrics. FontMetrics contents reflect the values computed by Font Manager using Typeface. Values are set to zero if they are -not availble. +not available. fUnderlineThickness and fUnderlinePosition have a bit set in fFlags if their values are valid, since their value may be zero. @@ -4178,12 +4177,12 @@ Maximum character width. SkScalar fXMin -Minimum bounding box x value for all glyphs. +Minimum bounding box x value for all Glyphs. Typically less than zero. SkScalar fXMax -Maximum bounding box x value for all glyphs. +Maximum bounding box x value for all Glyphs. Typically greater than zero. SkScalar fXHeight @@ -4236,8 +4235,8 @@ bool hasUnderlineThickness(SkScalar* thickness) const If Font Metrics has a valid underline thickness, return true, and set -thickness to that value. If it doesn't, return false, and ignore -thickness. +thickness to that value. If the underline thickness is not valid, +return false, and ignore thickness. ### Parameters @@ -4260,8 +4259,8 @@ bool hasUnderlinePosition(SkScalar* position) const If Font Metrics has a valid underline position, return true, and set -position to that value. If it doesn't, return false, and ignore -position. +position to that value. If the underline position is not valid, +return false, and ignore position. ### Parameters @@ -4284,8 +4283,8 @@ bool hasStrikeoutThickness(SkScalar* thickness) const If Font Metrics has a valid strikeout thickness, return true, and set -thickness to that value. If it doesn't, return false, and ignore -thickness. +thickness to that value. If the underline thickness is not valid, +return false, and ignore thickness. ### Parameters @@ -4308,8 +4307,8 @@ bool hasStrikeoutPosition(SkScalar* position) const If Font Metrics has a valid strikeout position, return true, and set -position to that value. If it doesn't, return false, and ignore -position. +position to that value. If the underline position is not valid, +return false, and ignore position. ### Parameters @@ -4405,7 +4404,7 @@ textSize: 32 fontSpacing: 37.25 SkRect getFontBounds() const -Returns the union of bounds of all glyphs. +Returns the union of bounds of all Glyphs. Returned dimensions are computed by Font Manager from font data, ignoring Hinting. Includes Text Size, Text Scale X, and Text Skew X, but not Fake Bold or Path Effect. @@ -4416,7 +4415,7 @@ returns the same bounds as Font Metrics { Glyphs ### Example @@ -4457,7 +4456,7 @@ If Text Encoding is text
+character storage encoded with Text Encoding +geometry of the Glyphs
SkPaint::kFill_Style 0Set to fill geometry. -Applies to Rect, Region, Round Rect, Circle, Oval, Path, and Text. -Bitmap, Image, Patch, Region, Sprite, and Vertices are painted as if +Applies to Rect, Region, Round Rect, Circles, Ovals, Path, and Text. +Bitmap, Image, Patches, Region, Sprites, and Vertices are painted as if kFill Style is set, and ignore the set Style. The Path Fill Type 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.
SkPaint::kStroke_Style 1Set to stroke geometry. -Applies to Rect, Region, Round Rect, Arc, Circle, Oval, -Path, and Text. -Arc, Line, Point, and Point Array are always drawn as if kStroke Style is set, +Applies to Rect, Region, Round Rect, Arcs, Circles, Ovals, Path, and Text. +Arcs, Lines, and Points, are always drawn as if kStroke Style is set, and ignore the set Style. The stroke construction is unaffected by the Path Fill Type.
SkPaint::kStrokeAndFill_Style 2Set to stroke and fill geometry. -Applies to Rect, Region, Round Rect, Circle, Oval, Path, and Text. +Applies to Rect, Region, Round Rect, Circles, Ovals, Path, and Text. Path is treated as if it is set to SkPath::kWinding FillType, and the set Path Fill Type is ignored.
-character stroage encoded with Text Encoding
byteLength length of character storage in bytes
glyphs @@ -4482,14 +4481,14 @@ number of glyphs represented by -Returns the number of glyphs in text. -Uses Text Encoding to count the glyphs. +Returns the number of Glyphs in text. +Uses Text Encoding to count the Glyphs. Returns the same result as textToGlyphs. ### Parameters +character storage encoded with Text Encoding @@ -4497,7 +4496,7 @@ length of character storage in bytes ### Return Value -number of glyphs represented by text of length byteLength +number of Glyphs represented by text of length byteLength ### Example @@ -4528,12 +4527,12 @@ If Text Encoding is text are non-zero; does not check to see if text contains valid glyph indices for Typeface. -Returns true if bytelength is zero. +Returns true if byteLength is zero. ### Parameters
text -character stroage encoded with Text Encoding
byteLength length of character storage in bytes
+array of characters or Glyphs @@ -4769,13 +4768,13 @@ glyph count in text ### Example -
Bounds of glyphs increase for stroked text, but text advance remains the same. +
Bounds of Glyphs increase for stroked text, but text advance remains the same. The underlines show the text advance, spaced to keep them distinct.
--- # Text Path -Text Path describes the geometry of glyphs used to draw text. +Text Path describes the geometry of Glyphs used to draw text. ## getTextPath @@ -4802,7 +4801,7 @@ x-coordinate of the origin of the text
+geometry of the Glyphs
text -array of characters or glyphs
byteLength number of bytes in text array
y y-coordinate of the origin of the text
path -geometry of the glyphs
@@ -4837,20 +4836,20 @@ number of bytes of text
pos positions of each glyph
path -geometry of the glyphs
### Example -
Simplifies three glyphs to eliminate overlaps, and strokes the result.
+
Simplifies three Glyphs to eliminate overlaps, and strokes the result.
--- # Text Intercepts -Text Intercepts describe the intersection of drawn text glyphs with a pair +Text Intercepts describe the intersection of drawn text Glyphs with a pair of lines parallel to the text advance. Text Intercepts permits creating a -underline that skips descenders. +underline that skips Descenders. ## getTextIntercepts @@ -4862,7 +4861,7 @@ int getTextIntercepts(const void* text, size_t length, SkScalar x, SkScalar y, Returns the number of intervals that intersect bounds. bounds 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 Glyphs in the string. Uses Text Encoding to decode text, Typeface to get the glyph paths, and Text Size, Fake Bold, and Path Effect to scale and modify the glyph paths. @@ -4893,7 +4892,7 @@ number of intersections; may be zero ### Example -
Underline uses intercepts to draw on either side of the glyph descender.
+
Underline uses intercepts to draw on either side of the glyph Descender.
--- @@ -4907,7 +4906,7 @@ int getPosTextIntercepts(const void* text, size_t length, const SkPoint pos[], Returns the number of intervals that intersect bounds. bounds 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 Glyphs in the string. Uses Text Encoding to decode text, Typeface to get the glyph paths, and Text Size, Fake Bold, and Path Effect to scale and modify the glyph paths. @@ -4936,7 +4935,7 @@ number of intersections; may be zero ### Example -
Text intercepts draw on either side of, but not inside, glyphs in a run.
+
Text intercepts draw on either side of, but not inside, Glyphs in a run.
--- @@ -4951,7 +4950,7 @@ int getPosTextHIntercepts(const void* text, size_t length, const SkScalar xpos[] Returns the number of intervals that intersect bounds. bounds 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 Glyphs in the string. Uses Text Encoding to decode text, Typeface to get the glyph paths, and Text Size, Fake Bold, and Path Effect to scale and modify the glyph paths. @@ -4996,18 +4995,18 @@ int getTextBlobIntercepts(const SkTextBlob* blob, const SkScalar bounds[2], Returns the number of intervals that intersect bounds. bounds 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 Glyphs in the string. Uses Text Encoding to decode text, Typeface to get the glyph paths, and Text Size, Fake Bold, and Path Effect to scale and modify the glyph paths. -Uses pos array and Text Align to position intervals. +Uses run array and Text Align to position intervals. Pass nullptr for intervals to determine the size of the interval array. intervals are cached to improve performance for multiple calls. ### Parameters +Glyphs, positions, and text paint attributes ### Example
Conics and arcs use identical representations. As the arc sweep increases -the conic weight also increases, but remains smaller than one.
+the Conic Weight also increases, but remains smaller than one. ### See Also @@ -2440,7 +2440,7 @@ In all cases appends Points control and end to Last Point plus Vector (dx1, dy1). end is Last Point plus Vector (dx2, dy2). -Function name stands for relative conic to. +Function name stands for "relative conic to". ### Parameters @@ -2468,7 +2468,7 @@ weight of added Conic --- # Cubic -Cubic describes a cubic Bezier, a third-order curve. +Cubic describes a Bezier curve segment described by a third-order polynomial. Cubic begins at a start Point, curving towards the first control Point; and curves from the end Point towards the second control Point. @@ -2570,7 +2570,7 @@ if needed; then appends kCubic Verb to Cubic end to Point Array. Cubic control is Last Point plus Vector (dx1, dy1). Cubic end is Last Point plus Vector (dx2, dy2). -Function name stands for relative cubic to. +Function name stands for "relative cubic to". ### Parameters @@ -2717,7 +2717,7 @@ The length of Vector from (arcTo appends Line from last PathPoint to (x1, y1). arcTo appends at most one Line and one Conic. -arcTo implements the functionality of PostScript arct and HTML Canvas arcTo. +arcTo implements the functionality of PostScript Arct and HTML Canvas ArcTo. ### Parameters @@ -2770,7 +2770,7 @@ The length of Vector from arcTo appends Line from last PathPoint to p1. arcTo appends at most one Line and one Conic. -arcTo implements the functionality of PostScript arct and HTML Canvas arcTo. +arcTo implements the functionality of PostScript Arct and HTML Canvas ArcTo. ### Parameters @@ -2840,7 +2840,7 @@ void arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y) -Append Arc to Path. Arc is implemented by one or more Conic weighted to describe part of Oval +Append Arc to Path. Arc is implemented by one or more Conics weighted to describe part of Oval with radii (rx, ry) rotated by xAxisRotate degrees. Arc curves from last PathPoint to (x, y), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger. @@ -2849,8 +2849,8 @@ or if last PathPoint equal (x, y) if both are greater than zero but too small. arcTo appends up to four Conic curves. -arcTo implements the functionatlity of SVG Arc, although SVG sweep-flag value is -opposite the integer value of sweep; SVG sweep-flag uses 1 for clockwise, while kCW Direction +arcTo implements the functionality of SVG Arc, although SVG "" value is +opposite the integer value of sweep; SVG "" uses 1 for clockwise, while kCW Direction cast to int is zero. ### Parameters @@ -2860,7 +2860,7 @@ radius in x before x-axis rotation +x-axis rotation in degrees; positive values are clockwise
blob -glyphs, positions, and text paint attributes
bounds lower and upper line parallel to the advance
intervals @@ -5035,8 +5034,8 @@ bool nothingToDraw() const Returns true if Paint prevents all drawing; otherwise, the Paint may or may not allow drawing. -Returns true if Blend Mode and Color Alpha are enabled, -and computed Color Alpha is zero. +Returns true if, for example, Blend Mode combined with Color Alpha computes a +new Alpha of zero. ### Return Value @@ -5090,13 +5089,13 @@ const SkRect& computeFastBounds(const SkRect& orig, SkRect* storage) const Only call this if canComputeFastBounds 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 storage -rect parameter. It returns the adjusted bounds that can then be used +parameter. It returns the adjusted bounds that can then be used for SkCanvas::quickReject tests. -The returned rect will either be orig or storage, thus the caller +The returned Rect will either be orig or storage, thus the caller should not rely on storage being set to the result, but should always -use the retured value. It is legal for orig and storage to be the same -rect. +use the returned value. It is legal for orig and storage to be the same +Rect. ### Parameters @@ -5143,8 +5142,9 @@ const SkRect& doComputeFastBounds(const SkRect& orig, SkRect* storage, Style style) const -Take the style 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 Paint Style. This can be used to +account for additional width required by stroking orig, without +altering Style set to fill. ### Parameters @@ -5170,12 +5170,14 @@ fast computed bounds void toString(SkString* str) const; -Converts Paint to machine parsable form in developer mode. +Creates string representation of Paint. The representation is read by +internal debugging tools. The interface and implementation may be +suppressed by defining SK IGNORE TO STRING. ### Parameters +storage for string representation of Paint
str -storage for string containing parsable Paint
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 Line an Path components Arc, Rect, Round Rect, Circle, and Oval are composed of Lines and Curves with as many Verbs and Points required for an exact description. Once added to Path, these components may lose their -identity; although Path can be inspected to determine if it decribes a single +identity; although Path can be inspected to determine if it describes a single Rect, Oval, Round Rect, and so on. ### Example @@ -51,7 +51,7 @@ are required to satisfy Verb Array. First
Each SkPath::moveTo starts a new Contour, and content after SkPath::close() -also starts a new Contour. Since SkPath::conicTo wasn't preceded by +also starts a new Contour. Since SkPath::conicTo is not preceded by SkPath::moveTo, the first Point of the third Contour starts at the last Point of the second Contour.
@@ -82,10 +82,10 @@ makes them visible. outline a figure. Path always starts with a move verb to a Cartesian coordinate, and may be followed by additional verbs that add lines or curves. Adding a close verb makes the geometry into a continuous loop, a closed contour. -Paths may contain any number of contours, each beginnning with a move verb. +Paths may contain any number of contours, each beginning with a move verb. Path contours may contain only a move verb, or may also contain lines, -quadratic Beziers, conics, and cubic Beziers. Path contours may be open or +Quadratic Beziers, Conics, and Cubic Beziers. Path contours may be open or closed. When used to draw a filled area, Path describes whether the fill is inside or @@ -102,12 +102,11 @@ Internally, Path lazily computes metrics likes bounds and co | constants | description | | --- | --- | | AddPathMode | Sets addPath options. | -| ArcSize | Sets arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y) options. | +| ArcSize | Used by arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep, SkScalar x, SkScalar y). | | Convexity | Returns if Path is convex or concave. | | Direction | Sets Contour clockwise or counterclockwise. | | FillType | Sets winding rule and inverse fill. | -| SegmentMask | -Verb| Controls how Path Points are interpreted. | +| SegmentMask | Verb | Controls how Path Points are interpreted. | ## Classes and Structs @@ -159,8 +158,8 @@ Internally, Path lazily computes metrics likes bounds and co | countPoints | Returns Point Array length. | | countVerbs | Returns Verb Array length. | | cubicTo | Appends Cubic. | -| dump | Sends text representation using floats to stdout. | -| dumpHex | Sends text representation using hexadecimal to stdout. | +| dump | Sends text representation using floats to standard output. | +| dumpHex | Sends text representation using hexadecimal to standard output. | | getBounds | Returns maximum and minimum of Point Array. | | getConvexity | Returns geometry convexity, computing if necessary. | | getConvexityOrUnknown | Returns geometry convexity if known. | @@ -430,7 +429,7 @@ Releases ownership of any shared data and deletes data if Path
delete calls Path destructor, but copy of original in path2 is unaffected.
+
delete calls Path Destructor, but copy of original in path2 is unaffected.
### See Also @@ -456,7 +455,7 @@ pointers are not exposed. ### Parameters +Verb Array, Point Array, Weights, and Fill Type to copy
path -Verb Array, Point Array, Weights, amd Fill Type to copy
@@ -575,7 +574,7 @@ Return true if Paths contain equal Verbs If Paths contain one or more Conics, the Weights must match. conicTo may add different Verbs depending on Conic Weight, so it is not -trival to interpolate a pair of Paths containing Conics with different +trivial to interpolate a pair of Paths containing Conics with different Conic Weight values. ### Parameters @@ -1064,7 +1063,7 @@ bool isRRect(SkRRect* rrect, Direction* dir = nullptr, unsigned* start = nullptr Returns true if constructed by addRoundRect, addRRect; and if construction -is not empty, not Rect, and not Oval. Path constructed with other other calls +is not empty, not Rect, and not Oval. Path constructed with other calls will not return true though Path draws Round Rect. rrect receives bounds of Round Rect. @@ -1089,11 +1088,12 @@ storage for start of Round Rect Path constructed by addRoundRect or addRRect +true if Path contains only Round Rect ### Example -
+
Draw rounded rectangle and its bounds. Draw an arc indicating where the rounded +rectangle starts and its direction.
### See Also @@ -1108,7 +1108,7 @@ true for Round Rect Path -Sets Path to its intial state. +Sets Path to its initial state. Removes Verb Array, Point Array, and Weights, and sets FillType to kWinding FillType. Internal storage associated with Path is released. @@ -1129,7 +1129,7 @@ Internal storage associated with Path is released. void rewind() -Sets Path to its intial state, preserving internal storage. +Sets Path to its initial state, preserving internal storage. Removes Verb Array, Point Array, and Weights, and sets FillType to kWinding FillType. Internal storage associated with Path is retained. @@ -1303,7 +1303,7 @@ Mark temporary paths, discarded or modified after use, as volatile to inform Device that the path need not be cached. Mark animating Path volatile to improve performance. -Mark unchanging Path non-volative to improve repeated rendering. +Mark unchanging Path non-volatile to improve repeated rendering. Raster Surface Path draws are affected by volatile for some shadows. GPU Surface Path draws are affected by volatile for some shadows and concave geometries. @@ -1356,8 +1356,8 @@ true if Line is degenerate; its length is effect ### Example -
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 +
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.
#### Example Output @@ -1392,11 +1392,11 @@ treated as a point. ### Parameters +Quad start point +Quad control point +Quad end point @@ -1409,9 +1409,9 @@ true if Quad is degenerate; its length is effectively zero ### Example -
As single precision floats: 100, 100.00001f, and 100.00002f have different bit representations +
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.
+the fractional portion of the number can not be represented by the float and is lost.
#### Example Output @@ -1445,13 +1445,13 @@ treated as a point. ### Parameters
p1 -quad start point
p2 -quad control point
p3 -quad end point
exact if true, returns true only if p1, p2, and p3 are equal; if false, returns true if p1, p2, and p3 are equal or nearly equal
+Cubic start point +Cubic control point 1 +Cubic control point 2 +Cubic end point @@ -1522,7 +1522,7 @@ second move is not line Point ArraycontainsPoints satisfying the allocated Points for each Verb in Verb Array. For instance, Path containing one Contour with Line -and Quad is described by Verb Array: move to, line to, quad to; and +and Quad is described by Verb Array: Verb::kMoveTo, Verb::kLineTo, Verb::kQuadTo; and one Point for move, one Point for Line, two Points for Quad; totaling four Points. Point Array may be read directly from Path with getPoints, or inspected with @@ -1749,7 +1749,7 @@ Cached state is also exchanged. swap internally excha it is lightweight and does not allocate memory. swap usage has largely been replaced by operator=(const SkPath& path). -Paths do not copy their content on assignment util they are written to, +Paths do not copy their content on assignment until they are written to, making assignment as efficient as swap. ### Parameters @@ -1946,7 +1946,7 @@ reducing the number and size of allocations when creating Path +number of additional Points to allocate
p1 -cubic start point
p2 -cubic control point 1
p3 -cubic control point 2
p4 -cubic end point
exact if true, returns true only if p1, p2, p3, and p4 are equal; if false, returns true if p1, p2, p3, and p4 are equal or nearly equal
extraPtCount -number of additional Points to preallocate
@@ -2021,7 +2021,7 @@ void rMoveTo(SkScalar dx, SkScalar dy) Adds beginning of Contour relative to Last Point. If Path is empty, starts Contour at (dx, dy). Otherwise, start Contour at Last Point offset by (dx, dy). -Function name stands for relative move to. +Function name stands for "relative move to". ### Parameters @@ -2114,7 +2114,7 @@ Adds Line from Last Point< Appends kMove Verb to Verb Array and (0, 0) to Point Array, if needed; then appends kLine Verb to Verb Array and Line end to Point Array. Line end is Last Point plus Vector (dx, dy). -Function name stands for relative line to. +Function name stands for "relative line to". ### Parameters @@ -2239,7 +2239,7 @@ if needed; then appends kQuad Verb to Quad end to Point Array. Quad control is Last Point plus Vector (dx1, dy1). Quad end is Last Point plus Vector (dx2, dy2). -Function name stands for relative quad to. +Function name stands for "relative quad to". ### Parameters @@ -2309,7 +2309,7 @@ done
-If weight is greater than one, Conic is a hyperbolic segment. As w gets large, +If weight is greater than one, Conic is a hyperbolic segment. As weight gets large, a hyperbolic segment can be approximated by straight lines connecting the control Point with the end Points. @@ -2410,7 +2410,7 @@ weight of added Conic
ry radius in y before x-axis rotation
xAxisRotate -x-axis rotation in degrees; positve values are clockwise
largeArc chooses smaller or larger Arc
sweep @@ -2894,19 +2894,19 @@ and smaller or larger. Arc sweep is always less than 360 degrees. arcTo appends Line to xy if either radii are zero, or if last Path Point equals (x, y). arcTo scales radii r to fit last Path Point and -xy if both are greater than zero but too small. +xy if both are greater than zero but too small to describe an arc. arcTo appends up to four Conic curves. -arcTo implements the functionatlity of SVG Arc, although SVG sweep-flag value is -opposite the integer value of sweep; SVG sweep-flag uses 1 for clockwise, while kCW Direction -cast to int is zero. +arcTo implements the functionality of SVG Arc, although SVG "" value is +opposite the integer value of sweep; SVG "" uses 1 for clockwise, while +kCW Direction cast to int is zero. ### Parameters +x-axis rotation in degrees; positive values are clockwise +x-axis rotation in degrees; positive values are clockwise void addPoly(const SkPoint pts[], int count, bool close) -Add Contour created from Line array, addingcount - 1Line segments. Contour added starts at pt[0], then adds a line +Add Contour created from Line array, addingcount - 1Line segments. Contour added starts at pts[0], then adds a line for every additional Point in pts array. If close is true, appends kClose Verb to Path, connecting pts[count - 1] and pts[0]. @@ -4223,7 +4224,7 @@ void dump(SkWStream* stream, bool forceClose, bool dumpAsHex) const Writes text representation of Path to stream. If stream is nullptr, dump writes to -stdout. Set forceClose to true to get +standard output. Set forceClose to true to get edges used to fill Path. Set dumpAsHex true to get exact binary representations of floating point numbers used in Point Array and Conic Weights. @@ -4234,7 +4235,7 @@ writable Stream receiving Path +true if SkScalar values are written as hexadecimal
r radii in x and y before x-axis rotation
xAxisRotate -x-axis rotation in degrees; positve values are clockwise
largeArc chooses smaller or larger Arc
sweep @@ -2935,19 +2935,20 @@ void rArcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Append Arc to Path, relative to last Path Point. Arc is implemented by one or -more Conic, weighted to describe part of Oval with radii (r.fX, r.fY) rotated by -xAxisRotate degrees. Arc curves from last Path Point (x0, y0) to(x0 + dx, y0 + dy), +more Conic, weighted to describe part of Oval with radii (rx, ry) rotated by +xAxisRotate degrees. Arc curves from last Path Point (x0, y0) to end Point(x0 + dx, y0 + dy), choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger. If Path is empty, the start Arc Point is (0, 0). -Arc sweep is always less than 360 degrees. arcTo appends Line to xy if either -radii are zero, or if last Path Point equals (x, y). arcTo scales radii r to fit -last Path Point and xy if both are greater than zero but too small. +Arc sweep is always less than 360 degrees. arcTo appends Line to end Point +if either radii are zero, or if last Path Point equals end Point. +arcTo scales radii (rx, ry) to fit last Path Point and end Point if both are +greater than zero but too small to describe an arc. arcTo appends up to four Conic curves. -arcTo implements the functionatlity of SVG Arc, although SVG sweep-flag value is -opposite the integer value of sweep; SVG sweep-flag uses 1 for clockwise, while +arcTo implements the functionality of SVG Arc, although SVG "" value is +opposite the integer value of sweep; SVG "" uses 1 for clockwise, while kCW Direction cast to int is zero. ### Parameters @@ -2957,7 +2958,7 @@ radius in x before x-axis rotation
ry radius in y before x-axis rotation
xAxisRotate -x-axis rotation in degrees; positve values are clockwise
largeArc chooses smaller or larger Arc
sweep @@ -2987,7 +2988,7 @@ void close() Append kClose Verb to Path. A closed Contour connects the first and last Point -with Line, forming a continous loop. Open and closed Contour draw the same +with Line, forming a continuous loop. Open and closed Contour draw the same with SkPaint::kFill Style. With SkPaint::kStroke Style, open Contour draws Paint Stroke Cap at Contour start and end; closed Contour draws Paint Stroke Join at Contour start and end. @@ -3167,7 +3168,7 @@ bool isRect(SkRect* rect, bool* isClosed = nullptr, Direction* direction = nullptr) const -Returns true if Path is eqivalent to Rect when filled. +Returns true if Path is equivalent to Rect when filled. If false: rect, isClosed, and direction are unchanged. If true: rect, isClosed, and direction are written to if not nullptr. @@ -3692,7 +3693,7 @@ index of initial point of Round Rect
forceClose true if missing kClose Verb is output
dumpAsHex -true if SkScalar values are written as hexidecimal
@@ -4275,7 +4276,7 @@ path.close(); void dump() const -Writes text representation of Path to stdout. The representation may be +Writes text representation of Path to standard output. The representation may be directly compiled as C++ code. Floating point values are written with limited precision; it may not be possible to reconstruct original Path from output. @@ -4308,12 +4309,12 @@ path is not equal to copy void dumpHex() const -Writes text representation of Path to stdout. The representation may be +Writes text representation of Path to standard output. The representation may be directly compiled as C++ code. Floating point values are written in hexadecimal to preserve their exact bit pattern. The output reconstructs the original Path. -Use instead of dump when submittingbug reports against Skiahttp://bug.skia.org. +Use instead of dump when submittingbug reports against Skia. Slight value changes in Point Array 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 # Class SkDumpCanvas +# Alias + +# Anti-alias + # BBH Factory # Class SkBBHFactory @@ -229,12 +233,18 @@ int SkColorSetARGB(a, r, g, b) # Color Space +# Core Graphics + +# Core Text + # Data # Draw Filter # Class SkDrawFilter +# Draw Layer + # Draw Looper # Class SkDrawLooper @@ -306,6 +316,10 @@ static std::unique_ptr # GPU Surface +# HTML Canvas + +## ArcTo + # Image ## Alpha Type @@ -403,6 +417,8 @@ sk_sp makeShader(SkShader::TileMode, SkShader::TileMode, # Struct SkIRect +# Left Side Bearing + # Mask # Mask Alpha @@ -436,6 +452,8 @@ sk_sp makeShader(SkShader::TileMode, SkShader::TileMode,
+# OS X + # Paint Defaults ### Constants @@ -507,6 +525,14 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL, # Class SkPixmap +# PostScript + +## Arct + +# Premultiply + +# Raster Engine + # Raster Surface # Rasterizer @@ -519,6 +545,8 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL, # Class sk_sp +# Right Side Bearing + # Round Rect # Class SkRRect @@ -583,6 +611,8 @@ static sk_sp MakeBitmapShader(const SkBitmap& src, TileMode tmx, # Class SkString +# Supersampling + # Surface # Class SkSurface @@ -627,6 +657,8 @@ static sk_sp MakeRasterDirect(const SkImageInfo&, void* pixels, # Class SkTextBlob +# Unpremultiply + # Vertices ## 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 # Bookmaker How to use the Bookmaker utility. -InstallGohttps://golang.org/doc/installif needed. +InstallGoif 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/ ## Bugs -Bookmaker bugs are trackedherebug.skia.org/6898. +Bookmaker bugs are trackedhere. -- cgit v1.2.3