starting next gaggle of docs
starting next gaggle of docs Docs-Preview: https://skia.org/?cl=50264 Bug: skia:6898 Change-Id: I639795b55c0c96b2efccac13cb67592f055a75a2 Reviewed-on: https://skia-review.googlesource.com/50264 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
This commit is contained in:
parent
0078e91271
commit
bc5697d3b1
3631
docs/SkBitmap_Reference.bmh
Normal file
3631
docs/SkBitmap_Reference.bmh
Normal file
File diff suppressed because it is too large
Load Diff
@ -261,7 +261,7 @@ width times bytes required for Image_Color_Type.
|
||||
Pixel buffer size should be height times rowBytes.
|
||||
|
||||
#Param width pixel column count on Raster_Surface created; must be zero or greater ##
|
||||
#Param height pixel row count on Raster_Surface created.; must be zero or greater ##
|
||||
#Param height pixel row count on Raster_Surface created; must be zero or greater ##
|
||||
#Param pixels pointer to destination pixels buffer; buffer size should be height
|
||||
times rowBytes
|
||||
##
|
||||
@ -284,7 +284,7 @@ void draw(SkCanvas* ) {
|
||||
std::unique_ptr<SkCanvas> canvas = SkCanvas::MakeRasterDirectN32(
|
||||
width,
|
||||
height,
|
||||
pixels[0], // top left of the bitmap
|
||||
pixels[0], // top-left of the bitmap
|
||||
sizeof(pixels[0])); // byte width of the each row
|
||||
// write a premultiplied value for white into all pixels in the bitmap
|
||||
canvas->clear(SK_ColorWHITE);
|
||||
@ -453,7 +453,7 @@ The actual output depends on the installed fonts.
|
||||
if (!canvas.peekPixels(&pixmap)) {
|
||||
SkDebugf("peekPixels should never fail.\n");
|
||||
}
|
||||
const SkPMColor* pixels = pixmap.addr32(); // points to top left of bitmap
|
||||
const SkPMColor* pixels = pixmap.addr32(); // points to top-left of bitmap
|
||||
SkPMColor pmWhite = pixels[0]; // the Premultiplied format may vary
|
||||
SkPaint paint; // by default, draws black, 12 point text
|
||||
canvas.drawString("!", 1, 10, paint); // 1 char at baseline (1, 10)
|
||||
@ -545,7 +545,7 @@ The actual output depends on the installed fonts.
|
||||
if (!canvas.peekPixels(&pixmap)) {
|
||||
SkDebugf("peekPixels should never fail.\n");
|
||||
}
|
||||
const SkPMColor* pixels = pixmap.addr32(); // points to top left of bitmap
|
||||
const SkPMColor* pixels = pixmap.addr32(); // points to top-left of bitmap
|
||||
SkPMColor pmWhite = pixels[0]; // the Premultiplied format may vary
|
||||
SkPaint paint; // by default, draws black, 12 point text
|
||||
canvas.drawString("!", 1, 10, paint); // 1 char at baseline (1, 10)
|
||||
@ -814,7 +814,7 @@ If pixels are inaccessible, info, rowBytes, and origin are unchanged.
|
||||
|
||||
#Param info storage for writable pixels' Image_Info; may be nullptr ##
|
||||
#Param rowBytes storage for writable pixels' row bytes; may be nullptr ##
|
||||
#Param origin storage for Canvas top Layer origin, its top left corner;
|
||||
#Param origin storage for Canvas top Layer origin, its top-left corner;
|
||||
may be nullptr
|
||||
##
|
||||
|
||||
@ -888,7 +888,7 @@ void draw(SkCanvas* canvas) {
|
||||
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. The custom context returned is generated by
|
||||
by the host platform user interface. The custom context returned is generated by
|
||||
SkRasterHandleAllocator::MakeCanvas, which creates a custom canvas with raster storage for
|
||||
the drawing destination.
|
||||
|
||||
@ -954,9 +954,7 @@ like SkDumpCanvas.
|
||||
pixmap is valid only while Canvas is in scope and unchanged. Any
|
||||
Canvas or Surface call may invalidate the pixmap values.
|
||||
|
||||
#Param pixmap storage for Canvas pixel state if Canvas pixels are readable;
|
||||
otherwise, ignored
|
||||
##
|
||||
#Param pixmap storage for pixel state if pixels are readable; otherwise, ignored ##
|
||||
|
||||
#Return true if Canvas has direct access to pixels ##
|
||||
|
||||
@ -2651,7 +2649,7 @@ before it is combined with Clip.
|
||||
|
||||
#Example
|
||||
#Description
|
||||
Overlapping Rects form a clip. When clip's Path_Fill_Type is set to
|
||||
Overlapping Rects form a clip. When clip Path_Fill_Type is set to
|
||||
SkPath::kWinding_FillType, the overlap is included. Set to
|
||||
SkPath::kEvenOdd_FillType, the overlap is excluded and forms a hole.
|
||||
##
|
||||
@ -2692,7 +2690,7 @@ path is transformed by Matrix before it is combined with Clip.
|
||||
#Example
|
||||
#Height 212
|
||||
#Description
|
||||
Clip loops over itself covering its center twice. When clip's Path_Fill_Type
|
||||
Clip loops over itself covering its center twice. When clip Path_Fill_Type
|
||||
is set to SkPath::kWinding_FillType, the overlap is included. Set to
|
||||
SkPath::kEvenOdd_FillType, the overlap is excluded and forms a hole.
|
||||
##
|
||||
@ -3367,7 +3365,7 @@ In paint: Paint_Style determines if rectangle is stroked or filled;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness, and
|
||||
Paint_Stroke_Join draws the corners rounded or square.
|
||||
|
||||
#Param rect rectangle to be drawn ##
|
||||
#Param rect rectangle to draw ##
|
||||
#Param paint stroke or fill, blend, color, and so on, used to draw ##
|
||||
|
||||
#Example
|
||||
@ -3403,7 +3401,7 @@ In paint: Paint_Style determines if rectangle is stroked or filled;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness, and
|
||||
Paint_Stroke_Join draws the corners rounded or square.
|
||||
|
||||
#Param rect rectangle to be drawn ##
|
||||
#Param rect rectangle to draw ##
|
||||
#Param paint stroke or fill, blend, color, and so on, used to draw ##
|
||||
|
||||
#Example
|
||||
@ -3433,7 +3431,7 @@ In paint: Paint_Style determines if rectangle is stroked or filled;
|
||||
if stroked, Paint_Stroke_Width describes the line thickness, and
|
||||
Paint_Stroke_Join draws the corners rounded or square.
|
||||
|
||||
#Param region region to be drawn ##
|
||||
#Param region region to draw ##
|
||||
#Param paint Paint stroke or fill, blend, color, and so on, used to draw ##
|
||||
|
||||
#Example
|
||||
@ -3825,7 +3823,7 @@ and Draw_Looper. If image is kAlpha_8_SkColorType, apply Shader.
|
||||
If paint contains Mask_Filter, generate mask from image bounds. If generated
|
||||
mask extends beyond image bounds, replicate image edge colors, just as Shader
|
||||
made from SkImage::makeShader with SkShader::kClamp_TileMode set replicates the
|
||||
image's edge color when it samples outside of its bounds.
|
||||
image edge color when it samples outside of its bounds.
|
||||
|
||||
#Param image uncompressed rectangular map of pixels ##
|
||||
#Param left left side of image ##
|
||||
@ -3865,7 +3863,7 @@ Blend_Mode, and Draw_Looper. If image is kAlpha_8_SkColorType, apply Shader.
|
||||
If paint contains Mask_Filter, generate mask from image bounds. If generated
|
||||
mask extends beyond image bounds, replicate image edge colors, just as Shader
|
||||
made from SkImage::makeShader with SkShader::kClamp_TileMode set replicates the
|
||||
image's edge color when it samples outside of its bounds.
|
||||
image edge color when it samples outside of its bounds.
|
||||
|
||||
#Param image uncompressed rectangular map of pixels ##
|
||||
#Param left left side of image ##
|
||||
@ -3974,7 +3972,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image 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
|
||||
@ -3992,7 +3990,7 @@ improve performance.
|
||||
#Height 64
|
||||
#Description
|
||||
The left bitmap draws with Paint default kNone_SkFilterQuality, and stays within
|
||||
its bounds; there's no bleeding with kFast_SrcRectConstraint.
|
||||
its bounds; there is no bleeding with kFast_SrcRectConstraint.
|
||||
the middle and right bitmaps draw with kLow_SkFilterQuality; with
|
||||
kStrict_SrcRectConstraint, the filter remains within the checkerboard, and
|
||||
with kFast_SrcRectConstraint red bleeds on the edges.
|
||||
@ -4040,7 +4038,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image edge color when it samples outside of its bounds.
|
||||
|
||||
constraint set to kStrict_SrcRectConstraint limits Paint Filter_Quality to
|
||||
sample within isrc; set to kFast_SrcRectConstraint allows sampling outside to
|
||||
@ -4083,7 +4081,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image edge color when it samples outside of its bounds.
|
||||
|
||||
constraint set to kStrict_SrcRectConstraint limits Paint Filter_Quality to
|
||||
sample within image; set to kFast_SrcRectConstraint allows sampling outside to
|
||||
@ -4125,7 +4123,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image 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
|
||||
@ -4181,7 +4179,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image edge color when it samples outside of its bounds.
|
||||
|
||||
constraint set to kStrict_SrcRectConstraint limits Paint Filter_Quality to
|
||||
sample within image; set to kFast_SrcRectConstraint allows sampling outside to
|
||||
@ -4231,7 +4229,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image edge color when it samples outside of its bounds.
|
||||
|
||||
constraint set to kStrict_SrcRectConstraint limits Paint Filter_Quality to
|
||||
sample within image; set to kFast_SrcRectConstraint allows sampling outside to
|
||||
@ -4285,7 +4283,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image edge color when it samples outside of its bounds.
|
||||
|
||||
#Param image Image containing pixels, dimensions, and format ##
|
||||
#Param center IRect edge of image corners and sides ##
|
||||
@ -4351,7 +4349,7 @@ If paint contains Mask_Filter, generate mask from image bounds.
|
||||
|
||||
If generated mask extends beyond image bounds, replicate image edge colors, just
|
||||
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
|
||||
replicates the image's edge color when it samples outside of its bounds.
|
||||
replicates the image edge color when it samples outside of its bounds.
|
||||
|
||||
#Param image Image containing pixels, dimensions, and format ##
|
||||
#Param center IRect edge of image corners and sides ##
|
||||
@ -4414,7 +4412,7 @@ If paint contains Mask_Filter, generate mask from bitmap bounds.
|
||||
|
||||
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
|
||||
just as Shader made from SkShader::MakeBitmapShader with
|
||||
SkShader::kClamp_TileMode set replicates the bitmap's edge color when it samples
|
||||
SkShader::kClamp_TileMode set replicates the bitmap edge color when it samples
|
||||
outside of its bounds.
|
||||
|
||||
#Param bitmap Bitmap containing pixels, dimensions, and format ##
|
||||
@ -4466,7 +4464,7 @@ If paint contains Mask_Filter, generate mask from bitmap bounds.
|
||||
|
||||
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
|
||||
just as Shader made from SkShader::MakeBitmapShader with
|
||||
SkShader::kClamp_TileMode set replicates the bitmap's edge color when it samples
|
||||
SkShader::kClamp_TileMode set replicates the bitmap edge color when it samples
|
||||
outside of its bounds.
|
||||
|
||||
constraint set to kStrict_SrcRectConstraint limits Paint Filter_Quality to
|
||||
@ -4524,7 +4522,7 @@ If paint contains Mask_Filter, generate mask from bitmap bounds.
|
||||
|
||||
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
|
||||
just as Shader made from SkShader::MakeBitmapShader with
|
||||
SkShader::kClamp_TileMode set replicates the bitmap's edge color when it samples
|
||||
SkShader::kClamp_TileMode set replicates the bitmap edge color when it samples
|
||||
outside of its bounds.
|
||||
|
||||
constraint set to kStrict_SrcRectConstraint limits Paint Filter_Quality to
|
||||
@ -4582,7 +4580,7 @@ If paint contains Mask_Filter, generate mask from bitmap bounds.
|
||||
|
||||
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
|
||||
just as Shader made from SkShader::MakeBitmapShader with
|
||||
SkShader::kClamp_TileMode set replicates the bitmap's edge color when it samples
|
||||
SkShader::kClamp_TileMode set replicates the bitmap edge color when it samples
|
||||
outside of its bounds.
|
||||
|
||||
constraint set to kStrict_SrcRectConstraint limits Paint Filter_Quality to
|
||||
@ -4637,7 +4635,7 @@ If paint contains Mask_Filter, generate mask from bitmap bounds.
|
||||
|
||||
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
|
||||
just as Shader made from SkShader::MakeBitmapShader with
|
||||
SkShader::kClamp_TileMode set replicates the bitmap's edge color when it samples
|
||||
SkShader::kClamp_TileMode set replicates the bitmap edge color when it samples
|
||||
outside of its bounds.
|
||||
|
||||
#Param bitmap Bitmap containing pixels, dimensions, and format ##
|
||||
@ -4777,7 +4775,7 @@ Draw Bitmap bitmap stretched proportionally to fit into Rect dst.
|
||||
Lattice lattice divides bitmap into a rectangular grid.
|
||||
Each intersection of an even-numbered row and column is fixed; like the corners
|
||||
of drawBitmapNine, fixed lattice elements never scale larger than their initial
|
||||
size and shrink proportionately when all fixed elements exceed the bitmap's
|
||||
size and shrink proportionately when all fixed elements exceed the bitmap
|
||||
dimension. All other grid elements scale to fill the available space, if any.
|
||||
|
||||
Additionally transform draw using Clip, Matrix, and optional Paint paint.
|
||||
@ -4788,7 +4786,7 @@ If paint contains Mask_Filter, generate mask from bitmap bounds.
|
||||
|
||||
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
|
||||
just as Shader made from SkShader::MakeBitmapShader with
|
||||
SkShader::kClamp_TileMode set replicates the bitmap's edge color when it samples
|
||||
SkShader::kClamp_TileMode set replicates the bitmap edge color when it samples
|
||||
outside of its bounds.
|
||||
|
||||
#Param bitmap Bitmap containing pixels, dimensions, and format ##
|
||||
@ -4854,7 +4852,7 @@ Draw Image image stretched proportionally to fit into Rect dst.
|
||||
Lattice lattice divides image into a rectangular grid.
|
||||
Each intersection of an even-numbered row and column is fixed; like the corners
|
||||
of drawBitmapNine, fixed lattice elements never scale larger than their initial
|
||||
size and shrink proportionately when all fixed elements exceed the bitmap's
|
||||
size and shrink proportionately when all fixed elements exceed the bitmap
|
||||
dimension. All other grid elements scale to fill the available space, if any.
|
||||
|
||||
Additionally transform draw using Clip, Matrix, and optional Paint paint.
|
||||
@ -4865,7 +4863,7 @@ If paint contains Mask_Filter, generate mask from bitmap bounds.
|
||||
|
||||
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
|
||||
just as Shader made from SkShader::MakeBitmapShader with
|
||||
SkShader::kClamp_TileMode set replicates the bitmap's edge color when it samples
|
||||
SkShader::kClamp_TileMode set replicates the bitmap edge color when it samples
|
||||
outside of its bounds.
|
||||
|
||||
#Param image Image containing pixels, dimensions, and format ##
|
||||
@ -4930,11 +4928,11 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
Draw text, with origin at (x, y), using Clip, Matrix, and Paint paint.
|
||||
|
||||
text's meaning depends on Paint_Text_Encoding; by default, text encoding is
|
||||
text meaning depends on Paint_Text_Encoding; by default, text is encoded as
|
||||
UTF-8.
|
||||
|
||||
x and y meaning depends on Paint_Text_Align and Paint_Vertical_Text; by default
|
||||
text draws left to right, positioning the first glyph's left side bearing at x
|
||||
text draws left to right, positioning the first glyph left side bearing at x
|
||||
and its baseline at y. Text size is affected by Matrix and Paint_Text_Size.
|
||||
|
||||
All elements of paint: Path_Effect, Rasterizer, Mask_Filter, Shader,
|
||||
@ -4985,12 +4983,12 @@ void draw(SkCanvas* canvas) {
|
||||
Draw null terminated string, with origin at (x, y), using Clip, Matrix, and
|
||||
Paint paint.
|
||||
|
||||
string's meaning depends on Paint_Text_Encoding; by default, string encoding is
|
||||
UTF-8. Other values of Paint_Text_Encoding are unlikely to produce the desired
|
||||
string meaning depends on Paint_Text_Encoding; by default, strings are encoded
|
||||
as UTF-8. Other values of Paint_Text_Encoding are unlikely to produce the desired
|
||||
results, since zero bytes may be embedded in the string.
|
||||
|
||||
x and y meaning depends on Paint_Text_Align and Paint_Vertical_Text; by default
|
||||
string draws left to right, positioning the first glyph's left side bearing at x
|
||||
string draws left to right, positioning the first glyph left side bearing at x
|
||||
and its baseline at y. Text size is affected by Matrix and Paint_Text_Size.
|
||||
|
||||
All elements of paint: Path_Effect, Rasterizer, Mask_Filter, Shader,
|
||||
@ -5018,12 +5016,12 @@ filled 12 point black Glyphs.
|
||||
Draw null terminated string, with origin at (x, y), using Clip, Matrix, and
|
||||
Paint paint.
|
||||
|
||||
string's meaning depends on Paint_Text_Encoding; by default, string encoding is
|
||||
UTF-8. Other values of Paint_Text_Encoding are unlikely to produce the desired
|
||||
string meaning depends on Paint_Text_Encoding; by default, strings are encoded
|
||||
as UTF-8. Other values of Paint_Text_Encoding are unlikely to produce the desired
|
||||
results, since zero bytes may be embedded in the string.
|
||||
|
||||
x and y meaning depends on Paint_Text_Align and Paint_Vertical_Text; by default
|
||||
string draws left to right, positioning the first glyph's left side bearing at x
|
||||
string draws left to right, positioning the first glyph left side bearing at x
|
||||
and its baseline at y. Text size is affected by Matrix and Paint_Text_Size.
|
||||
|
||||
All elements of paint: Path_Effect, Rasterizer, Mask_Filter, Shader,
|
||||
@ -5056,9 +5054,9 @@ Draw each glyph in text with the origin in pos array, using Clip, Matrix, and
|
||||
Paint paint. The number of entries in pos array must match the number of Glyphs
|
||||
described by byteLength of text.
|
||||
|
||||
text's meaning depends on Paint_Text_Encoding; by default, text encoding is
|
||||
text meaning depends on Paint_Text_Encoding; by default, text is encoded as
|
||||
UTF-8. pos elements' meaning depends on Paint_Text_Align and Paint_Vertical_Text;
|
||||
by default each glyph's left side bearing is positioned at x and its
|
||||
by default each glyph left side bearing is positioned at x and its
|
||||
baseline is positioned at y. Text size is affected by Matrix and
|
||||
Paint_Text_Size.
|
||||
|
||||
@ -5067,7 +5065,7 @@ Color_Filter, Image_Filter, and Draw_Looper; apply to text. By default, draws
|
||||
filled 12 point black Glyphs.
|
||||
|
||||
Layout engines such as Harfbuzz typically position each glyph
|
||||
rather than using the font's advance widths.
|
||||
rather than using the font advance widths.
|
||||
|
||||
#Param text character code points or Glyphs drawn ##
|
||||
#Param byteLength byte length of text array ##
|
||||
@ -5099,9 +5097,9 @@ 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.
|
||||
|
||||
text's meaning depends on Paint_Text_Encoding; by default, text encoding is
|
||||
text meaning depends on Paint_Text_Encoding; by default, text is encoded as
|
||||
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
|
||||
by default each glyph 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.
|
||||
|
||||
@ -5110,7 +5108,7 @@ Color_Filter, Image_Filter, and Draw_Looper; apply to text. By default, draws
|
||||
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 advance widths if all Glyphs share the same
|
||||
baseline.
|
||||
|
||||
#Param text character code points or Glyphs drawn ##
|
||||
@ -5142,12 +5140,12 @@ Draw text on Path path, using Clip, Matrix, and Paint paint.
|
||||
Origin of text is at distance hOffset along the path, offset by a perpendicular
|
||||
vector of length vOffset. If the path section corresponding the glyph advance is
|
||||
curved, the glyph is drawn curved to match; control points in the glyph are
|
||||
mapped to projected points parallel to the path. If the text's advance is larger
|
||||
mapped to projected points parallel to the path. If the text advance is larger
|
||||
than the path length, the excess text is clipped.
|
||||
|
||||
text's meaning depends on Paint_Text_Encoding; by default, text encoding is
|
||||
text meaning depends on Paint_Text_Encoding; by default, text is encoded as
|
||||
UTF-8. Origin meaning depends on Paint_Text_Align and Paint_Vertical_Text; by
|
||||
default text positions the first glyph's left side bearing at origin x and its
|
||||
default text positions the first glyph left side bearing at origin x and its
|
||||
baseline at origin y. Text size is affected by Matrix and Paint_Text_Size.
|
||||
|
||||
All elements of paint: Path_Effect, Rasterizer, Mask_Filter, Shader,
|
||||
@ -5190,12 +5188,12 @@ Draw text on Path path, using Clip, Matrix, and Paint paint.
|
||||
Origin of text is at beginning of path offset by matrix, if provided, before it
|
||||
is mapped to path. If the path section corresponding the glyph advance is
|
||||
curved, the glyph is drawn curved to match; control points in the glyph are
|
||||
mapped to projected points parallel to the path. If the text's advance is larger
|
||||
mapped to projected points parallel to the path. If the text advance is larger
|
||||
than the path length, the excess text is clipped.
|
||||
|
||||
text's meaning depends on Paint_Text_Encoding; by default, text encoding is
|
||||
text meaning depends on Paint_Text_Encoding; by default, text is encoded as
|
||||
UTF-8. Origin meaning depends on Paint_Text_Align and Paint_Vertical_Text; by
|
||||
default text positions the first glyph's left side bearing at origin x and its
|
||||
default text positions the first glyph left side bearing at origin x and its
|
||||
baseline at origin y. Text size is affected by Matrix and Paint_Text_Size.
|
||||
|
||||
All elements of paint: Path_Effect, Rasterizer, Mask_Filter, Shader,
|
||||
@ -5598,20 +5596,20 @@ void draw(SkCanvas* canvas) {
|
||||
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,
|
||||
The Coons patch uses Clip and Matrix, paint Shader, Color_Filter,
|
||||
Color_Alpha, Image_Filter, and Blend_Mode. If Shader is provided it is treated
|
||||
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,
|
||||
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,
|
||||
bottom right, bottom left order.
|
||||
Color array color associates colors with corners in top-left, top-right,
|
||||
bottom-right, bottom-left order.
|
||||
|
||||
If paint contains Shader, Point array texCoords maps Shader as texture to
|
||||
corners in top left, top right, bottom right, bottom left order.
|
||||
corners in top-left, top-right, bottom-right, bottom-left order.
|
||||
|
||||
#Param cubics Path_Cubic array, sharing common points ##
|
||||
#Param colors Color array, one for each corner ##
|
||||
@ -5656,20 +5654,20 @@ void draw(SkCanvas* canvas) {
|
||||
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,
|
||||
The Coons patch uses Clip and Matrix, paint Shader, Color_Filter,
|
||||
Color_Alpha, Image_Filter, and Blend_Mode. If Shader is provided it is treated
|
||||
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,
|
||||
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,
|
||||
bottom right, bottom left order.
|
||||
Color array color associates colors with corners in top-left, top-right,
|
||||
bottom-right, bottom-left order.
|
||||
|
||||
If paint contains Shader, Point array texCoords maps Shader as texture to
|
||||
corners in top left, top right, bottom right, bottom left order.
|
||||
corners in top-left, top-right, bottom-right, bottom-left order.
|
||||
|
||||
#Param cubics Path_Cubic array, sharing common points ##
|
||||
#Param colors Color array, one for each corner ##
|
||||
|
1043
docs/SkIRect_Reference.bmh
Normal file
1043
docs/SkIRect_Reference.bmh
Normal file
File diff suppressed because it is too large
Load Diff
2388
docs/SkMatrix_Reference.bmh
Normal file
2388
docs/SkMatrix_Reference.bmh
Normal file
File diff suppressed because it is too large
Load Diff
@ -93,7 +93,7 @@ Shader attached to Paint.
|
||||
# Hinting # Level of glyph outline adjustment. ##
|
||||
# Join # Corner geometry on stroked shapes. ##
|
||||
# Style # Stroke, fill, or both. ##
|
||||
# TextEncoding # Character or glyph encoding size. ##
|
||||
# TextEncoding # Character or glyph encoded size. ##
|
||||
#Table ##
|
||||
#Subtopic ##
|
||||
|
||||
@ -171,7 +171,7 @@ Shader attached to Paint.
|
||||
# getStyle # Returns Style: stroke, fill, or both. ##
|
||||
# getTextAlign # Returns Align: left, center, or right. ##
|
||||
# getTextBlobIntercepts # Returns where lines intersect Text_Blob; underlines. ##
|
||||
# getTextEncoding # Returns character or glyph encoding size. ##
|
||||
# getTextEncoding # Returns character or glyph encoded size. b ##
|
||||
# getTextIntercepts # Returns where lines intersect text; underlines. ##
|
||||
# getTextPath # Returns Path equivalent to text. ##
|
||||
# getTextScaleX # Returns the text horizontal scale; condensed text. ##
|
||||
@ -229,7 +229,7 @@ Shader attached to Paint.
|
||||
# setStyle # Sets Style: stroke, fill, or both. ##
|
||||
# setSubpixelText # Sets or clears Subpixel_Text. ##
|
||||
# setTextAlign # Sets Align: left, center, or right. ##
|
||||
# setTextEncoding # Sets character or glyph encoding size. ##
|
||||
# setTextEncoding # Sets character or glyph encoded size. ##
|
||||
# setTextScaleX # Sets the text horizontal scale; condensed text. ##
|
||||
# setTextSkewX # Sets the text horizontal skew; oblique text. ##
|
||||
# setTextSize # Sets text size in points. ##
|
||||
@ -375,8 +375,8 @@ This prevents objects with Reference_Count from being modified once Paint refers
|
||||
|
||||
#Method void reset()
|
||||
|
||||
Sets all paint's contents to their initial values. This is equivalent to replacing
|
||||
the paint with the result of SkPaint().
|
||||
Sets all Paint contents to their initial values. This is equivalent to replacing
|
||||
Paint with the result of SkPaint().
|
||||
|
||||
#Example
|
||||
SkPaint paint1, paint2;
|
||||
@ -1626,7 +1626,7 @@ void draw(SkCanvas* canvas) {
|
||||
|
||||
Fake_Bold approximates the bold font style accompanying a normal font when a bold font face
|
||||
is not available. Skia does not provide font substitution; it is up to the client to find the
|
||||
bold font face using the platform's Font_Manager.
|
||||
bold font face using the platform Font_Manager.
|
||||
|
||||
Use Text_Skew_X to approximate an italic font style when the italic font face
|
||||
is not available.
|
||||
@ -1713,7 +1713,7 @@ 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.
|
||||
a specific pair of characters is adjusted using data in the font Kerning tables.
|
||||
|
||||
#Method bool isDevKernText() const
|
||||
|
||||
@ -2019,10 +2019,10 @@ Set Style to kStroke_Style to stroke the shape.
|
||||
#Subtopic ##
|
||||
|
||||
#Subtopic Stroke
|
||||
The stroke covers the area described by following the shape's edge with a pen or brush of
|
||||
The stroke covers the area described by following the shape edge with a pen or brush of
|
||||
Stroke_Width. The area covered where the shape starts and stops is described by Stroke_Cap.
|
||||
The area covered where the shape turns a corner is described by Stroke_Join.
|
||||
The stroke is centered on the shape; it extends equally on either side of the shape's edge.
|
||||
The stroke is centered on the shape; it extends equally on either side of the shape edge.
|
||||
|
||||
As Stroke_Width gets smaller, the drawn path frame is thinner. Stroke_Width less than one
|
||||
may have gaps, and if kAntiAlias_Flag is set, Color_Alpha will increase to visually decrease coverage.
|
||||
@ -2170,14 +2170,14 @@ May be used to verify that Style is a legal value.
|
||||
#Topic Stroke_Width
|
||||
|
||||
Stroke_Width sets the width for stroking. The width is the thickness
|
||||
of the stroke perpendicular to the path's direction when the paint's style is
|
||||
of the stroke perpendicular to the path direction when the paint style is
|
||||
set to kStroke_Style or kStrokeAndFill_Style.
|
||||
|
||||
When width is greater than zero, the stroke encompasses as many pixels partially
|
||||
or fully as needed. When the width equals zero, the paint enables hairlines;
|
||||
the stroke is always one pixel wide.
|
||||
|
||||
The stroke's dimensions are scaled by the canvas matrix, but Hairline stroke
|
||||
The stroke dimensions are scaled by the canvas matrix, but Hairline stroke
|
||||
remains one pixel wide regardless of scaling.
|
||||
|
||||
The default width for the paint is zero.
|
||||
@ -2187,7 +2187,7 @@ The default width for the paint is zero.
|
||||
#Platform raster gpu
|
||||
#Description
|
||||
The pixels hit to represent thin lines vary with the angle of the
|
||||
line and the platform's implementation.
|
||||
line and the platform implementation.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPaint paint;
|
||||
@ -2415,7 +2415,7 @@ Stroke_Cap draws at the beginning and end of an open Path_Contour.
|
||||
#Enum ##
|
||||
|
||||
Stroke describes the area covered by a pen of Stroke_Width as it
|
||||
follows the Path_Contour, moving parallel to the contours's direction.
|
||||
follows the Path_Contour, moving parallel to the contour direction.
|
||||
|
||||
If the Path_Contour is not terminated by SkPath::kClose_Verb, the contour has a
|
||||
visible beginning and end.
|
||||
@ -2495,7 +2495,7 @@ Stroke_Cap is kButt_Cap by default.
|
||||
Stroke_Join draws at the sharp corners of an open or closed Path_Contour.
|
||||
|
||||
Stroke describes the area covered by a pen of Stroke_Width as it
|
||||
follows the Path_Contour, moving parallel to the contours's direction.
|
||||
follows the Path_Contour, moving parallel to the contour direction.
|
||||
|
||||
If the contour direction changes abruptly, because the tangent direction leading
|
||||
to the end of a curve within the contour does not match the tangent direction of
|
||||
@ -4007,12 +4007,12 @@ Text_Skew_X defaults to 0.
|
||||
##
|
||||
|
||||
TextEncoding determines whether text specifies character codes and their encoded
|
||||
size, or glyph indices. Character codes use the encoding specified by the
|
||||
size, or glyph indices. Characters are encoded as specified by the
|
||||
#A Unicode standard # http://unicode.org/standard/standard.html ##
|
||||
.
|
||||
|
||||
Character codes encoded size are specified by UTF-8, UTF-16, or UTF-32.
|
||||
All character encodings are able to represent all of Unicode, differing only
|
||||
All character code formats are able to represent all of Unicode, differing only
|
||||
in the total storage required.
|
||||
|
||||
#A UTF-8 (RFC 3629) # https://tools.ietf.org/html/rfc3629 ##
|
||||
@ -4047,9 +4047,9 @@ Uses two byte words to represent glyph indices.
|
||||
#Example
|
||||
#Height 128
|
||||
#Description
|
||||
First line has UTF-8 encoding.
|
||||
Second line has UTF-16 encoding.
|
||||
Third line has UTF-32 encoding.
|
||||
First line is encoded in UTF-8.
|
||||
Second line is encoded in UTF-16.
|
||||
Third line is encoded in UTF-32.
|
||||
Fourth line has 16 bit glyph indices.
|
||||
##
|
||||
void draw(SkCanvas* canvas) {
|
||||
@ -4504,8 +4504,7 @@ Returns the number of glyph indices represented by text.
|
||||
Text_Encoding specifies how text represents characters or glyphs.
|
||||
glyphs may be nullptr, to compute the glyph count.
|
||||
|
||||
Does not check text for valid character encoding or valid
|
||||
glyph indices.
|
||||
Does not check text for valid character codes or valid glyph indices.
|
||||
|
||||
If byteLength equals zero, returns zero.
|
||||
If byteLength includes a partial character, the partial character is ignored.
|
||||
|
@ -11,8 +11,8 @@ a direct drawing destination.
|
||||
Use Bitmap to draw pixels referenced by Pixmap; use Surface to draw into
|
||||
pixels referenced by Pixmap.
|
||||
|
||||
Pixmap does not try to manage the lifetime of the pixel memory. Use PixelRef
|
||||
to manage pixel memory; PixelRef is safe across threads.
|
||||
Pixmap does not try to manage the lifetime of the pixel memory. Use Pixel_Ref
|
||||
to manage pixel memory; Pixel_Ref is safe across threads.
|
||||
|
||||
#Topic Overview
|
||||
|
||||
@ -401,7 +401,8 @@ width() * info().bytesPerPixel()
|
||||
##
|
||||
.
|
||||
|
||||
It is up to the Pixmap creator to ensure that row bytes is a useful value.
|
||||
Returns zero if colorType is kUnknown_SkColorType.
|
||||
It is up to the Bitmap creator to ensure that row bytes is a useful value.
|
||||
|
||||
#Return byte length of pixel row ##
|
||||
|
||||
@ -461,7 +462,7 @@ inset address: 0x7f2a440fb210
|
||||
|
||||
Returns pixel count in each pixel row. Should be equal or less than:
|
||||
#Formula
|
||||
rowBytes() / info.bytesPerPixel()
|
||||
rowBytes() / info().bytesPerPixel()
|
||||
##
|
||||
.
|
||||
|
||||
@ -476,7 +477,7 @@ pixmap width: 16 info width: 16
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso height()
|
||||
#SeeAlso height() SkImageInfo::width()
|
||||
|
||||
##
|
||||
|
||||
@ -489,15 +490,14 @@ Returns pixel row count.
|
||||
#Return pixel height in Image_Info ##
|
||||
|
||||
#Example
|
||||
SkImageInfo info = SkImageInfo::MakeA8(16, 32);
|
||||
SkPixmap pixmap(info, nullptr, 64);
|
||||
SkDebugf("pixmap height: %d info height: %d\n", pixmap.height(), info.height());
|
||||
SkPixmap pixmap(SkImageInfo::MakeA8(16, 32), nullptr, 64);
|
||||
SkDebugf("pixmap height: %d info height: %d\n", pixmap.height(), pixmap.info().height());
|
||||
#StdOut
|
||||
pixmap height: 32 info height: 32
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso width()
|
||||
#SeeAlso width() ImageInfo::height()
|
||||
|
||||
##
|
||||
|
||||
@ -521,7 +521,7 @@ color type: kAlpha_SkColorType
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso alphaType()
|
||||
#SeeAlso alphaType() SkImageInfo::colorType
|
||||
|
||||
##
|
||||
|
||||
@ -543,7 +543,7 @@ alpha type: kPremul_SkAlphaType
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso colorType()
|
||||
#SeeAlso colorType() SkImageInfo::alphaType
|
||||
|
||||
##
|
||||
|
||||
@ -551,9 +551,11 @@ alpha type: kPremul_SkAlphaType
|
||||
|
||||
#Method SkColorSpace* colorSpace() const
|
||||
|
||||
Returns Color_Space associated with Image_Info.
|
||||
Returns Color_Space associated with Image_Info. The
|
||||
reference count of Color_Space is unchanged. The returned Color_Space is
|
||||
immutable.
|
||||
|
||||
#Return Color_Space in Image_Info ##
|
||||
#Return Color_Space, the range of colors, in Image_Info ##
|
||||
|
||||
#Example
|
||||
#Description
|
||||
@ -572,7 +574,7 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso Color_Space
|
||||
#SeeAlso Color_Space SkImageInfo::colorSpace
|
||||
|
||||
##
|
||||
|
||||
@ -581,7 +583,8 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
|
||||
#Method bool isOpaque() const
|
||||
|
||||
Returns true if Alpha_Type is kOpaque_SkAlphaType.
|
||||
Does not check if Color_Type allows Alpha, or Alpha in pixel values.
|
||||
Does not check if Color_Type allows Alpha, or if any pixel value has
|
||||
transparency.
|
||||
|
||||
#Return true if Image_Info has opaque Alpha_Type ##
|
||||
|
||||
@ -717,31 +720,15 @@ color: kRGBA_F16_SkColorType bytesPerPixel: 8 shiftPerPixel: 3
|
||||
|
||||
#Method uint64_t getSize64() const
|
||||
|
||||
#Deprecated
|
||||
##
|
||||
|
||||
Returns conservative memory required for pixel storage.
|
||||
Includes unused memory on last row when rowBytesAsPixels exceeds width().
|
||||
|
||||
#Return conservative pixel storage size ##
|
||||
|
||||
#Example
|
||||
SkPixmap pixmap;
|
||||
for (int width : { 1, 1000, 1000000 } ) {
|
||||
for (int height: { 1, 1000, 1000000 } ) {
|
||||
SkImageInfo imageInfo = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType);
|
||||
pixmap.reset(imageInfo , nullptr, width * 5);
|
||||
SkDebugf("width: %7d height: %7d getSize64: %13lld\n", width, height, pixmap.getSize64());
|
||||
}
|
||||
}
|
||||
#StdOut
|
||||
width: 1 height: 1 getSize64: 5
|
||||
width: 1 height: 1000 getSize64: 5000
|
||||
width: 1 height: 1000000 getSize64: 5000000
|
||||
width: 1000 height: 1 getSize64: 5000
|
||||
width: 1000 height: 1000 getSize64: 5000000
|
||||
width: 1000 height: 1000000 getSize64: 5000000000
|
||||
width: 1000000 height: 1 getSize64: 5000000
|
||||
width: 1000000 height: 1000 getSize64: 5000000000
|
||||
width: 1000000 height: 1000000 getSize64: 5000000000000
|
||||
##
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso getSafeSize64 getSafeSize height() rowBytes width() SkImageInfo::bytesPerPixel
|
||||
@ -752,32 +739,15 @@ width: 1000000 height: 1000000 getSize64: 5000000000000
|
||||
|
||||
#Method uint64_t getSafeSize64() const
|
||||
|
||||
#Deprecated
|
||||
##
|
||||
|
||||
Returns minimum memory required for pixel storage.
|
||||
Does not include unused memory on last row when rowBytesAsPixels exceeds width().
|
||||
|
||||
#Return exact pixel storage size ##
|
||||
|
||||
#Example
|
||||
SkPixmap pixmap;
|
||||
for (int width : { 1, 1000, 1000000 } ) {
|
||||
for (int height: { 1, 1000, 1000000 } ) {
|
||||
SkImageInfo imageInfo = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType);
|
||||
pixmap.reset(imageInfo , nullptr, width * 5);
|
||||
SkDebugf("width: %7d height: %7d getSafeSize64: %13lld\n", width, height,
|
||||
pixmap.getSafeSize64());
|
||||
}
|
||||
}
|
||||
#StdOut
|
||||
width: 1 height: 1 getSafeSize64: 4
|
||||
width: 1 height: 1000 getSafeSize64: 4999
|
||||
width: 1 height: 1000000 getSafeSize64: 4999999
|
||||
width: 1000 height: 1 getSafeSize64: 4000
|
||||
width: 1000 height: 1000 getSafeSize64: 4999000
|
||||
width: 1000 height: 1000000 getSafeSize64: 4999999000
|
||||
width: 1000000 height: 1 getSafeSize64: 4000000
|
||||
width: 1000000 height: 1000 getSafeSize64: 4999000000
|
||||
width: 1000000 height: 1000000 getSafeSize64: 4999999000000
|
||||
##
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso getSize64 getSafeSize height() rowBytes width() SkImageInfo::bytesPerPixel
|
||||
@ -788,6 +758,9 @@ width: 1000000 height: 1000000 getSafeSize64: 4999999000000
|
||||
|
||||
#Method size_t getSafeSize() const
|
||||
|
||||
#Deprecated
|
||||
##
|
||||
|
||||
Returns minimum memory required for pixel storage.
|
||||
Does not include unused memory on last row when rowBytesAsPixels exceeds width().
|
||||
Returns zero if value is does not fit in a signed 32-bit integer.
|
||||
@ -795,31 +768,50 @@ The largest value than can be returned is 2,147,483,647.
|
||||
|
||||
#Return exact pixel storage size if size fits in signed 32 bits ##
|
||||
|
||||
#NoExample
|
||||
##
|
||||
|
||||
#SeeAlso getSize64 getSafeSize64 height() rowBytes width() SkImageInfo::bytesPerPixel sk_64_isS32
|
||||
|
||||
##
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#Method size_t computeByteSize() const
|
||||
|
||||
Returns minimum memory required for pixel storage.
|
||||
Does not include unused memory on last row when rowBytesAsPixels exceeds width().
|
||||
Returns zero if result does not fit in size_t.
|
||||
Returns zero if height() or width() is 0.
|
||||
Returns height() times rowBytes if colorType is kUnknown_SkColorType.
|
||||
|
||||
#Return size in bytes of image buffer ##
|
||||
|
||||
#Example
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkPixmap pixmap;
|
||||
for (int width : { 1, 1000, 1000000 } ) {
|
||||
for (int height: { 1, 1000, 1000000 } ) {
|
||||
SkImageInfo imageInfo = SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType);
|
||||
pixmap.reset(imageInfo , nullptr, width * 5);
|
||||
SkDebugf("width: %7d height: %7d getSafeSize: %7d\n", width, height, pixmap.getSafeSize());
|
||||
pixmap.reset(imageInfo, nullptr, width * 5);
|
||||
SkDebugf("width: %7d height: %7d computeByteSize: %13lld\n", width, height,
|
||||
pixmap.computeByteSize());
|
||||
}
|
||||
}
|
||||
}
|
||||
#StdOut
|
||||
width: 1 height: 1 getSafeSize: 4
|
||||
width: 1 height: 1000 getSafeSize: 4999
|
||||
width: 1 height: 1000000 getSafeSize: 4999999
|
||||
width: 1000 height: 1 getSafeSize: 4000
|
||||
width: 1000 height: 1000 getSafeSize: 4999000
|
||||
width: 1000 height: 1000000 getSafeSize: 0
|
||||
width: 1000000 height: 1 getSafeSize: 4000000
|
||||
width: 1000000 height: 1000 getSafeSize: 0
|
||||
width: 1000000 height: 1000000 getSafeSize: 0
|
||||
width: 1 height: 1 computeByteSize: 4
|
||||
width: 1 height: 1000 computeByteSize: 4999
|
||||
width: 1 height: 1000000 computeByteSize: 4999999
|
||||
width: 1000 height: 1 computeByteSize: 4000
|
||||
width: 1000 height: 1000 computeByteSize: 4999000
|
||||
width: 1000 height: 1000000 computeByteSize: 4999999000
|
||||
width: 1000000 height: 1 computeByteSize: 4000000
|
||||
width: 1000000 height: 1000 computeByteSize: 4999000000
|
||||
width: 1000000 height: 1000000 computeByteSize: 4999999000000
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso getSize64 getSafeSize64 height() rowBytes width() SkImageInfo::bytesPerPixel sk_64_isS32
|
||||
#SeeAlso SkImageInfo::computeByteSize
|
||||
|
||||
##
|
||||
|
||||
@ -845,7 +837,7 @@ greater.
|
||||
|
||||
Returns false for kUnknown_SkColorType.
|
||||
|
||||
#Return true all pixels have opaque values or Color_Type is opaque ##
|
||||
#Return true if all pixels have opaque values or Color_Type is opaque ##
|
||||
|
||||
#Example
|
||||
std::vector<uint32_t> pixels;
|
||||
@ -943,10 +935,13 @@ Unpremultiplied:
|
||||
|
||||
#Method const void* addr(int x, int y) const
|
||||
|
||||
Returns readable pixel address at (x, y).
|
||||
Returns readable pixel address at (x, y). Returns nullptr if Pixel_Ref is nullptr.
|
||||
|
||||
Input is not validated: out of bounds values of x or y trigger an assert() if
|
||||
built with SK_DEBUG defined. Returns zero if Color_Type is kUnknown_SkColorType.
|
||||
built with SK_DEBUG defined. Returns nullptr if Color_Type is kUnknown_SkColorType.
|
||||
|
||||
Performs a lookup of pixel size; for better performance, call
|
||||
one of: addr8, addr16, addr32, addr64, or addrF16.
|
||||
|
||||
#Param x column index, zero or greater, and less than width() ##
|
||||
#Param y row index, zero or greater, and less than height() ##
|
||||
@ -966,7 +961,7 @@ pixmap.addr(1, 2) == &storage[1 + 2 * w]
|
||||
##
|
||||
##
|
||||
|
||||
#SeeAlso addr8 addr16 addr32 addr64 addrF16 getColor writable_addr
|
||||
#SeeAlso addr8 addr16 addr32 addr64 addrF16 getColor writable_addr SkBitmap::getAddr
|
||||
|
||||
##
|
||||
|
||||
@ -1611,7 +1606,7 @@ abs(srcY) >= this->height()
|
||||
If behavior is SkTransferFunctionBehavior::kRespect: converts source
|
||||
pixels to a linear space before converting to dstInfo.
|
||||
If behavior is SkTransferFunctionBehavior::kIgnore: source
|
||||
pixels are treated as if they are linear, regardless of their encoding.
|
||||
pixels are treated as if they are linear, regardless of how they are encoded.
|
||||
|
||||
#Param dstInfo destination width, height, Color_Type, Alpha_Type, Color_Space ##
|
||||
#Param dstPixels destination pixel storage ##
|
||||
@ -1625,6 +1620,7 @@ pixels are treated as if they are linear, regardless of their encoding.
|
||||
#Return true if pixels are copied to dstPixels ##
|
||||
|
||||
#Example
|
||||
#ToDo example doesn't do anything interesting since info colorSpace is nullptr ##
|
||||
#Image 3
|
||||
void draw(SkCanvas* canvas) {
|
||||
SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height(),
|
||||
|
1320
docs/SkRect_Reference.bmh
Normal file
1320
docs/SkRect_Reference.bmh
Normal file
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,9 @@
|
||||
API
|
||||
CPU
|
||||
GPU GPU-backed OpenGL Vulkan
|
||||
PDF XPS
|
||||
RFC
|
||||
NaN NaNs
|
||||
Bezier Coons Cartesian
|
||||
C C++ Destructor Subclasses
|
||||
SaveLayerFlags # not external; need to add typedef support
|
||||
@ -16,6 +18,8 @@
|
||||
SkXXX.h # ditto
|
||||
SkXXX_Reference # ditto
|
||||
Skia # ditto
|
||||
SK_ABORT # ditto
|
||||
SK_API # ditto
|
||||
SK_DEBUG # ditto
|
||||
SK_RELEASE # ditto
|
||||
SK_USE_FREETYPE_EMBOLDEN # ditto
|
||||
@ -52,20 +56,6 @@ FT_Load_Glyph
|
||||
##
|
||||
##
|
||||
|
||||
#Topic Bitmap
|
||||
#Class SkBitmap
|
||||
#Subtopic Row_Bytes
|
||||
##
|
||||
#Method void erase(SkColor c, const SkIRect& area) const
|
||||
##
|
||||
#Method bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes)
|
||||
##
|
||||
#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
|
||||
int srcX, int srcY, SkTransferFunctionBehavior behavior) const
|
||||
##
|
||||
#Class ##
|
||||
##
|
||||
|
||||
#Topic Blend_Mode
|
||||
#EnumClass SkBlendMode
|
||||
#Const kSrc 1
|
||||
@ -325,6 +315,22 @@ FT_Load_Glyph
|
||||
##
|
||||
#Method int bytesPerPixel() const
|
||||
##
|
||||
#Method int height() const
|
||||
##
|
||||
#Method int width() const
|
||||
##
|
||||
#Method SkColorType colorType() const
|
||||
##
|
||||
#Method SkAlphaType alphaType() const
|
||||
##
|
||||
#Method SkColorSpace* colorSpace() const
|
||||
##
|
||||
#Method bool isOpaque() const
|
||||
##
|
||||
#Method size_t minRowBytes() const
|
||||
##
|
||||
#Method size_t computeByteSize(size_t rowBytes) const
|
||||
##
|
||||
##
|
||||
#Subtopic ##
|
||||
#Class SkImage
|
||||
@ -351,13 +357,6 @@ FT_Load_Glyph
|
||||
#Topic Image_Scaling
|
||||
##
|
||||
|
||||
#Topic IRect
|
||||
#Struct SkIRect
|
||||
#Method bool intersect(const SkIRect& r)
|
||||
##
|
||||
##
|
||||
##
|
||||
|
||||
#Topic Left_Side_Bearing
|
||||
##
|
||||
|
||||
@ -365,6 +364,15 @@ FT_Load_Glyph
|
||||
#Alias Lines
|
||||
#Topic ##
|
||||
|
||||
#Topic Malloc_Pixel_Ref
|
||||
#Class SkMallocPixelRef
|
||||
#Method static sk_sp<SkPixelRef> MakeZeroed(const SkImageInfo&, size_t rowBytes)
|
||||
##
|
||||
#Method static sk_sp<SkPixelRef> MakeAllocate(const SkImageInfo&, size_t rowBytes)
|
||||
##
|
||||
##
|
||||
##
|
||||
|
||||
#Topic Mask
|
||||
#Class SkMask
|
||||
#Enum Format
|
||||
@ -387,18 +395,31 @@ FT_Load_Glyph
|
||||
|
||||
#Topic Mask_Filter
|
||||
#Class SkMaskFilter
|
||||
#Method virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
|
||||
SkIPoint* margin) const
|
||||
##
|
||||
#Class ##
|
||||
#Topic ##
|
||||
|
||||
#Topic Math
|
||||
#Method static inline bool sk_64_isS32(int64_t value)
|
||||
##
|
||||
#Method SkIntToScalar(x)
|
||||
##
|
||||
#Method SkScalarRoundToInt(x)
|
||||
##
|
||||
#Method SkScalarFloorToInt(x)
|
||||
##
|
||||
#Method SkScalarCeilToInt(x)
|
||||
##
|
||||
#Method SkScalarFloorToScalar(x)
|
||||
##
|
||||
#Method SkScalarCeilToScalar(x)
|
||||
##
|
||||
##
|
||||
|
||||
#Topic Matrix
|
||||
#Struct SkMatrix
|
||||
#Struct ##
|
||||
#Topic ##
|
||||
#Topic Mip_Map
|
||||
##
|
||||
|
||||
#Topic Nine_Patch
|
||||
##
|
||||
@ -482,8 +503,16 @@ FT_Load_Glyph
|
||||
##
|
||||
##
|
||||
|
||||
#Topic PixelRef
|
||||
#Topic Pixel_Ref
|
||||
#Class SkPixelRef
|
||||
#Method int width() const
|
||||
##
|
||||
#Method int height() const
|
||||
##
|
||||
#Method bool isImmutable() const
|
||||
##
|
||||
#Method void setImmutable()
|
||||
##
|
||||
##
|
||||
##
|
||||
|
||||
@ -534,20 +563,10 @@ FT_Load_Glyph
|
||||
#Subtopic ##
|
||||
#Topic ##
|
||||
|
||||
#Topic Rect
|
||||
#Alias Rects
|
||||
#Struct SkRect
|
||||
#Method static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty()
|
||||
##
|
||||
#Method void dump() const
|
||||
##
|
||||
#Method void dumpHex() const
|
||||
##
|
||||
#Struct ##
|
||||
#Topic ##
|
||||
|
||||
#Topic Reference_Count
|
||||
#Substitute SkRefCnt
|
||||
#Class SkRefCnt
|
||||
#Class ##
|
||||
#Class sk_sp
|
||||
#Class ##
|
||||
#Topic ##
|
||||
@ -588,6 +607,10 @@ FT_Load_Glyph
|
||||
#Subtopic ##
|
||||
#Topic ##
|
||||
|
||||
#Topic Size
|
||||
#Alias ISize
|
||||
##
|
||||
|
||||
#Topic Sprite
|
||||
#Alias Sprites
|
||||
#Topic ##
|
||||
|
3632
site/user/api/SkBitmap_Reference.md
Normal file
3632
site/user/api/SkBitmap_Reference.md
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -88,7 +88,7 @@ Multiple colors are drawn either by using multiple paints or with objects like
|
||||
| <a href="#SkPaint_Hinting">Hinting</a> | Level of glyph outline adjustment. |
|
||||
| <a href="#SkPaint_Join">Join</a> | Corner geometry on stroked shapes. |
|
||||
| <a href="#SkPaint_Style">Style</a> | Stroke, fill, or both. |
|
||||
| <a href="#SkPaint_TextEncoding">TextEncoding</a> | Character or glyph encoding size. |
|
||||
| <a href="#SkPaint_TextEncoding">TextEncoding</a> | Character or glyph encoded size. |
|
||||
|
||||
## <a name="Structs"></a> Structs
|
||||
|
||||
@ -154,7 +154,7 @@ Multiple colors are drawn either by using multiple paints or with objects like
|
||||
| <a href="#SkPaint_getStyle">getStyle</a> | Returns <a href="#SkPaint_Style">Style</a>: stroke, fill, or both. |
|
||||
| <a href="#SkPaint_getTextAlign">getTextAlign</a> | Returns <a href="#SkPaint_Align">Align</a>: left, center, or right. |
|
||||
| <a href="#SkPaint_getTextBlobIntercepts">getTextBlobIntercepts</a> | Returns where lines intersect <a href="undocumented#Text_Blob">Text Blob</a>; underlines. |
|
||||
| <a href="#SkPaint_getTextEncoding">getTextEncoding</a> | Returns character or glyph encoding size. |
|
||||
| <a href="#SkPaint_getTextEncoding">getTextEncoding</a> | Returns character or glyph encoded size. b |
|
||||
| <a href="#SkPaint_getTextIntercepts">getTextIntercepts</a> | Returns where lines intersect text; underlines. |
|
||||
| <a href="#SkPaint_getTextPath">getTextPath</a> | Returns <a href="SkPath_Reference#Path">Path</a> equivalent to text. |
|
||||
| <a href="#SkPaint_getTextScaleX">getTextScaleX</a> | Returns the text horizontal scale; condensed text. |
|
||||
@ -212,7 +212,7 @@ Multiple colors are drawn either by using multiple paints or with objects like
|
||||
| <a href="#SkPaint_setStyle">setStyle</a> | Sets <a href="#SkPaint_Style">Style</a>: stroke, fill, or both. |
|
||||
| <a href="#SkPaint_setSubpixelText">setSubpixelText</a> | Sets or clears <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a>. |
|
||||
| <a href="#SkPaint_setTextAlign">setTextAlign</a> | Sets <a href="#SkPaint_Align">Align</a>: left, center, or right. |
|
||||
| <a href="#SkPaint_setTextEncoding">setTextEncoding</a> | Sets character or glyph encoding size. |
|
||||
| <a href="#SkPaint_setTextEncoding">setTextEncoding</a> | Sets character or glyph encoded size. |
|
||||
| <a href="#SkPaint_setTextScaleX">setTextScaleX</a> | Sets the text horizontal scale; condensed text. |
|
||||
| <a href="#SkPaint_setTextSkewX">setTextSkewX</a> | Sets the text horizontal skew; oblique text. |
|
||||
| <a href="#SkPaint_setTextSize">setTextSize</a> | Sets text size in points. |
|
||||
@ -369,8 +369,8 @@ path effect unique: true
|
||||
void reset()
|
||||
</pre>
|
||||
|
||||
Sets all paint's contents to their initial values. This is equivalent to replacing
|
||||
the paint with the result of <a href="#SkPaint_empty_constructor">SkPaint()</a>.
|
||||
Sets all <a href="#Paint">Paint</a> contents to their initial values. This is equivalent to replacing
|
||||
<a href="#Paint">Paint</a> with the result of <a href="#SkPaint_empty_constructor">SkPaint()</a>.
|
||||
|
||||
### Example
|
||||
|
||||
@ -949,7 +949,7 @@ at compile time.
|
||||
|
||||
<div><fiddle-embed name="a6575a49467ce8d28bb01cc7638fa04d"><div>A red line is drawn with transparency on the edges to make it look smoother.
|
||||
A blue line draws only where the pixel centers are contained.
|
||||
The lines are drawn into <a href="undocumented#Bitmap">Bitmap</a>, then drawn magnified to make the
|
||||
The lines are drawn into <a href="SkBitmap_Reference#Bitmap">Bitmap</a>, then drawn magnified to make the
|
||||
<a href="#Alias">Aliasing</a> easier to see.</div></fiddle-embed></div>
|
||||
|
||||
<a name="SkPaint_isAntiAlias"></a>
|
||||
@ -1361,7 +1361,7 @@ the outline glyph if <a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmap
|
||||
includes an embedded bitmap <a href="undocumented#Glyph">Glyph</a> at odd font sizes. This example works
|
||||
on platforms that use <a href="undocumented#FreeType">FreeType</a> as their <a href="#Engine">Font Engine</a>.
|
||||
<a href="undocumented#Windows">Windows</a> may, but is not required to, return a bitmap glyph if
|
||||
<a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is set.</div><a href="undocumented#SkBitmap">SkBitmap</a> bitmap;
|
||||
<a href="#SkPaint_kEmbeddedBitmapText_Flag">kEmbeddedBitmapText Flag</a> is set.</div><a href="SkBitmap_Reference#SkBitmap">SkBitmap</a> bitmap;
|
||||
bitmap.allocN32Pixels(30, 15);
|
||||
bitmap.eraseColor(0);
|
||||
<a href="SkCanvas_Reference#SkCanvas">SkCanvas</a> offscreen(bitmap);
|
||||
@ -1601,7 +1601,7 @@ paint1 == paint2
|
||||
# <a name="Fake_Bold"></a> Fake Bold
|
||||
<a href="#Fake_Bold">Fake Bold</a> approximates the bold font style accompanying a normal font when a bold font face
|
||||
is not available. <a href="undocumented#Skia">Skia</a> does not provide font substitution; it is up to the client to find the
|
||||
bold font face using the platform's <a href="undocumented#Font_Manager">Font Manager</a>.
|
||||
bold font face using the platform <a href="undocumented#Font_Manager">Font Manager</a>.
|
||||
|
||||
Use <a href="#Text_Skew_X">Text Skew X</a> to approximate an italic font style when the italic font face
|
||||
is not available.
|
||||
@ -1687,7 +1687,7 @@ spacing by the difference of the hinted and <a href="undocumented#Unhinted">Unhi
|
||||
<a href="undocumented#FreeType">FreeType</a> as their <a href="#Engine">Font Engine</a>.
|
||||
|
||||
<a href="SkPaint_Reference#Full_Hinting_Spacing">Full Hinting Spacing</a> is not related to text <a href="undocumented#Kerning">Kerning</a>, where the space between
|
||||
a specific pair of characters is adjusted using data in the font's <a href="undocumented#Kerning">Kerning</a> tables.
|
||||
a specific pair of characters is adjusted using data in the font <a href="undocumented#Kerning">Kerning</a> tables.
|
||||
|
||||
<a name="SkPaint_isDevKernText"></a>
|
||||
## isDevKernText
|
||||
@ -1759,7 +1759,7 @@ in a noticeable difference.
|
||||
<td><a href="#SkCanvas_drawImageRect">SkCanvas::drawImageRect</a></td> </tr>
|
||||
</table>
|
||||
|
||||
and when <a href="#Paint">Paint</a> has a <a href="undocumented#Shader">Shader</a> specialization that uses <a href="undocumented#Image">Image</a> or <a href="undocumented#Bitmap">Bitmap</a>.
|
||||
and when <a href="#Paint">Paint</a> has a <a href="undocumented#Shader">Shader</a> specialization that uses <a href="undocumented#Image">Image</a> or <a href="SkBitmap_Reference#Bitmap">Bitmap</a>.
|
||||
|
||||
<a href="undocumented#Filter_Quality">Filter Quality</a> is <a href="undocumented#SkFilterQuality">kNone SkFilterQuality</a> by default.
|
||||
|
||||
@ -2044,10 +2044,10 @@ Set <a href="#Style">Style</a> to <a href="#SkPaint_kStroke_Style">kStroke Style
|
||||
|
||||
## <a name="Stroke"></a> Stroke
|
||||
|
||||
The stroke covers the area described by following the shape's edge with a pen or brush of
|
||||
The stroke covers the area described by following the shape edge with a pen or brush of
|
||||
<a href="#Stroke_Width">Stroke Width</a>. The area covered where the shape starts and stops is described by <a href="#Stroke_Cap">Stroke Cap</a>.
|
||||
The area covered where the shape turns a corner is described by <a href="#Stroke_Join">Stroke Join</a>.
|
||||
The stroke is centered on the shape; it extends equally on either side of the shape's edge.
|
||||
The stroke is centered on the shape; it extends equally on either side of the shape edge.
|
||||
|
||||
As <a href="#Stroke_Width">Stroke Width</a> gets smaller, the drawn path frame is thinner. <a href="#Stroke_Width">Stroke Width</a> less than one
|
||||
may have gaps, and if <a href="#SkPaint_kAntiAlias_Flag">kAntiAlias Flag</a> is set, <a href="#Alpha">Color Alpha</a> will increase to visually decrease coverage.
|
||||
@ -2085,8 +2085,8 @@ a fill draw.
|
||||
<table>
|
||||
<tr>
|
||||
<td><a name="SkPaint_kFill_Style"> <code><strong>SkPaint::kFill_Style </strong></code> </a></td><td>0</td><td>Set to fill geometry.
|
||||
Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>.
|
||||
<a href="undocumented#Bitmap">Bitmap</a>, <a href="undocumented#Image">Image</a>, <a href="#Patch">Patches</a>, <a href="undocumented#Region">Region</a>, <a href="#Sprite">Sprites</a>, and <a href="undocumented#Vertices">Vertices</a> are painted as if
|
||||
Applies to <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>.
|
||||
<a href="SkBitmap_Reference#Bitmap">Bitmap</a>, <a href="undocumented#Image">Image</a>, <a href="#Patch">Patches</a>, <a href="undocumented#Region">Region</a>, <a href="#Sprite">Sprites</a>, and <a href="undocumented#Vertices">Vertices</a> are painted as if
|
||||
<a href="#SkPaint_kFill_Style">kFill Style</a> is set, and ignore the set <a href="#SkPaint_Style">Style</a>.
|
||||
The <a href="#Fill_Type">Path Fill Type</a> specifies additional rules to fill the area outside the path edge,
|
||||
and to create an unfilled hole inside the shape.
|
||||
@ -2094,14 +2094,14 @@ and to create an unfilled hole inside the shape.
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="SkPaint_kStroke_Style"> <code><strong>SkPaint::kStroke_Style </strong></code> </a></td><td>1</td><td>Set to stroke geometry.
|
||||
Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Arc">Arcs</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>.
|
||||
Applies to <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Arc">Arcs</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>.
|
||||
<a href="#Arc">Arcs</a>, <a href="#Line">Lines</a>, and <a href="#Point">Points</a>, are always drawn as if <a href="#SkPaint_kStroke_Style">kStroke Style</a> is set,
|
||||
and ignore the set <a href="#SkPaint_Style">Style</a>.
|
||||
The stroke construction is unaffected by the <a href="#Fill_Type">Path Fill Type</a>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a name="SkPaint_kStrokeAndFill_Style"> <code><strong>SkPaint::kStrokeAndFill_Style </strong></code> </a></td><td>2</td><td>Set to stroke and fill geometry.
|
||||
Applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>.
|
||||
Applies to <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>, <a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>.
|
||||
<a href="SkPath_Reference#Path">Path</a> is treated as if it is set to <a href="#SkPath_kWinding_FillType">SkPath::kWinding FillType</a>,
|
||||
and the set <a href="#Fill_Type">Path Fill Type</a> is ignored.</td>
|
||||
</tr>
|
||||
@ -2189,14 +2189,14 @@ one of: <a href="#SkPaint_kFill_Style">kFill Style</a>, <a href="#SkPaint_kStrok
|
||||
|
||||
# <a name="Stroke_Width"></a> Stroke Width
|
||||
<a href="#Stroke_Width">Stroke Width</a> sets the width for stroking. The width is the thickness
|
||||
of the stroke perpendicular to the path's direction when the paint's style is
|
||||
of the stroke perpendicular to the path direction when the paint style is
|
||||
set to <a href="#SkPaint_kStroke_Style">kStroke Style</a> or <a href="#SkPaint_kStrokeAndFill_Style">kStrokeAndFill Style</a>.
|
||||
|
||||
When width is greater than zero, the stroke encompasses as many pixels partially
|
||||
or fully as needed. When the width equals zero, the paint enables hairlines;
|
||||
the stroke is always one pixel wide.
|
||||
|
||||
The stroke's dimensions are scaled by the canvas matrix, but <a href="#Hairline">Hairline</a> stroke
|
||||
The stroke dimensions are scaled by the canvas matrix, but <a href="#Hairline">Hairline</a> stroke
|
||||
remains one pixel wide regardless of scaling.
|
||||
|
||||
The default width for the paint is zero.
|
||||
@ -2204,7 +2204,7 @@ The default width for the paint is zero.
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="01e3e08a3022a351628ff54e84887756"><div>The pixels hit to represent thin lines vary with the angle of the
|
||||
line and the platform's implementation.</div></fiddle-embed></div>
|
||||
line and the platform implementation.</div></fiddle-embed></div>
|
||||
|
||||
<a name="SkPaint_getStrokeWidth"></a>
|
||||
## getStrokeWidth
|
||||
@ -2417,7 +2417,7 @@ May be used to verify that <a href="#Stroke_Cap">Stroke Cap</a> is a legal value
|
||||
</tr>
|
||||
|
||||
Stroke describes the area covered by a pen of <a href="#Stroke_Width">Stroke Width</a> as it
|
||||
follows the <a href="#Contour">Path Contour</a>, moving parallel to the contours's direction.
|
||||
follows the <a href="#Contour">Path Contour</a>, moving parallel to the contour direction.
|
||||
|
||||
If the <a href="#Contour">Path Contour</a> is not terminated by <a href="#SkPath_kClose_Verb">SkPath::kClose Verb</a>, the contour has a
|
||||
visible beginning and end.
|
||||
@ -2508,7 +2508,7 @@ kRound_Cap == paint.getStrokeCap()
|
||||
<a href="#Stroke_Join">Stroke Join</a> draws at the sharp corners of an open or closed <a href="#Contour">Path Contour</a>.
|
||||
|
||||
Stroke describes the area covered by a pen of <a href="#Stroke_Width">Stroke Width</a> as it
|
||||
follows the <a href="#Contour">Path Contour</a>, moving parallel to the contours's direction.
|
||||
follows the <a href="#Contour">Path Contour</a>, moving parallel to the contour direction.
|
||||
|
||||
If the contour direction changes abruptly, because the tangent direction leading
|
||||
to the end of a curve within the contour does not match the tangent direction of
|
||||
@ -2792,7 +2792,7 @@ nullptr != shader
|
||||
## refShader
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkShader> refShader() const
|
||||
sk_sp<SkShader> refShader() const
|
||||
</pre>
|
||||
|
||||
Optional colors used when filling a path, such as a gradient.
|
||||
@ -2822,7 +2822,7 @@ shader unique: false
|
||||
## setShader
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setShader(sk_sp<SkShader> shader)
|
||||
void setShader(sk_sp<SkShader> shader)
|
||||
</pre>
|
||||
|
||||
Optional colors used when filling a path, such as a gradient.
|
||||
@ -2887,7 +2887,7 @@ nullptr != color filter
|
||||
## refColorFilter
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkColorFilter> refColorFilter() const
|
||||
sk_sp<SkColorFilter> refColorFilter() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#Color_Filter">Color Filter</a> if set, or nullptr.
|
||||
@ -2916,7 +2916,7 @@ color filter unique: false
|
||||
## setColorFilter
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setColorFilter(sk_sp<SkColorFilter> colorFilter)
|
||||
void setColorFilter(sk_sp<SkColorFilter> colorFilter)
|
||||
</pre>
|
||||
|
||||
Sets <a href="undocumented#Color_Filter">Color Filter</a> to filter, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous
|
||||
@ -3085,7 +3085,7 @@ nullptr != path effect
|
||||
## refPathEffect
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkPathEffect> refPathEffect() const
|
||||
sk_sp<SkPathEffect> refPathEffect() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#Path_Effect">Path Effect</a> if set, or nullptr.
|
||||
@ -3114,7 +3114,7 @@ path effect unique: false
|
||||
## setPathEffect
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setPathEffect(sk_sp<SkPathEffect> pathEffect)
|
||||
void setPathEffect(sk_sp<SkPathEffect> pathEffect)
|
||||
</pre>
|
||||
|
||||
Sets <a href="undocumented#Path_Effect">Path Effect</a> to <a href="#SkPaint_setPathEffect_pathEffect">pathEffect</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous
|
||||
@ -3181,7 +3181,7 @@ nullptr != mask filter
|
||||
## refMaskFilter
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkMaskFilter> refMaskFilter() const
|
||||
sk_sp<SkMaskFilter> refMaskFilter() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#Mask_Filter">Mask Filter</a> if set, or nullptr.
|
||||
@ -3211,7 +3211,7 @@ mask filter unique: false
|
||||
## setMaskFilter
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setMaskFilter(sk_sp<SkMaskFilter> maskFilter)
|
||||
void setMaskFilter(sk_sp<SkMaskFilter> maskFilter)
|
||||
</pre>
|
||||
|
||||
Sets <a href="undocumented#Mask_Filter">Mask Filter</a> to <a href="#SkPaint_setMaskFilter_maskFilter">maskFilter</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous
|
||||
@ -3277,7 +3277,7 @@ nullptr != typeface
|
||||
## refTypeface
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkTypeface> refTypeface() const
|
||||
sk_sp<SkTypeface> refTypeface() const
|
||||
</pre>
|
||||
|
||||
Increases <a href="undocumented#Typeface">Typeface</a> <a href="undocumented#Reference_Count">Reference Count</a> by one.
|
||||
@ -3305,7 +3305,7 @@ typeface1 == typeface2
|
||||
## setTypeface
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setTypeface(sk_sp<SkTypeface> typeface)
|
||||
void setTypeface(sk_sp<SkTypeface> typeface)
|
||||
</pre>
|
||||
|
||||
Sets <a href="undocumented#Typeface">Typeface</a> to <a href="#SkPaint_setTypeface_typeface">typeface</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Typeface">Typeface</a>.
|
||||
@ -3334,7 +3334,7 @@ and returns a <a href="undocumented#Mask">Mask</a>.
|
||||
creating a shadow effect. <a href="undocumented#Rasterizer">Rasterizer</a> forms the base of <a href="#Layer">Rasterizer Layer</a>, which
|
||||
creates effects like embossing and outlining.
|
||||
|
||||
<a href="undocumented#Rasterizer">Rasterizer</a> applies to <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Arc">Arcs</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>,
|
||||
<a href="undocumented#Rasterizer">Rasterizer</a> applies to <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Region">Region</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="#Arc">Arcs</a>, <a href="#Circle">Circles</a>, <a href="#Oval">Ovals</a>,
|
||||
<a href="SkPath_Reference#Path">Path</a>, and <a href="undocumented#Text">Text</a>.
|
||||
|
||||
### Example
|
||||
@ -3374,7 +3374,7 @@ nullptr != rasterizer
|
||||
## refRasterizer
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkRasterizer> refRasterizer() const
|
||||
sk_sp<SkRasterizer> refRasterizer() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#Rasterizer">Rasterizer</a> if set, or nullptr.
|
||||
@ -3403,7 +3403,7 @@ rasterizer unique: false
|
||||
## setRasterizer
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setRasterizer(sk_sp<SkRasterizer> rasterizer)
|
||||
void setRasterizer(sk_sp<SkRasterizer> rasterizer)
|
||||
</pre>
|
||||
|
||||
Sets <a href="undocumented#Rasterizer">Rasterizer</a> to <a href="#SkPaint_setRasterizer_rasterizer">rasterizer</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous
|
||||
@ -3473,7 +3473,7 @@ nullptr != image filter
|
||||
## refImageFilter
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkImageFilter> refImageFilter() const
|
||||
sk_sp<SkImageFilter> refImageFilter() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#Image_Filter">Image Filter</a> if set, or nullptr.
|
||||
@ -3502,7 +3502,7 @@ image filter unique: false
|
||||
## setImageFilter
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setImageFilter(sk_sp<SkImageFilter> imageFilter)
|
||||
void setImageFilter(sk_sp<SkImageFilter> imageFilter)
|
||||
</pre>
|
||||
|
||||
Sets <a href="undocumented#Image_Filter">Image Filter</a> to <a href="#SkPaint_setImageFilter_imageFilter">imageFilter</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous
|
||||
@ -3570,7 +3570,7 @@ nullptr != draw looper
|
||||
## refDrawLooper
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkDrawLooper> refDrawLooper() const
|
||||
sk_sp<SkDrawLooper> refDrawLooper() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#Draw_Looper">Draw Looper</a> if set, or nullptr.
|
||||
@ -3616,7 +3616,7 @@ Deprecated.
|
||||
## setDrawLooper
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setDrawLooper(sk_sp<SkDrawLooper> drawLooper)
|
||||
void setDrawLooper(sk_sp<SkDrawLooper> drawLooper)
|
||||
</pre>
|
||||
|
||||
Sets <a href="undocumented#Draw_Looper">Draw Looper</a> to <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous
|
||||
@ -3642,7 +3642,7 @@ iterates through drawing one or more time, altering <a href="#Paint">Paint</a></
|
||||
## setLooper
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setLooper(sk_sp<SkDrawLooper> drawLooper)
|
||||
void setLooper(sk_sp<SkDrawLooper> drawLooper)
|
||||
</pre>
|
||||
|
||||
Deprecated.
|
||||
@ -3953,10 +3953,10 @@ enum <a href="#SkPaint_TextEncoding">TextEncoding</a> {
|
||||
};</pre>
|
||||
|
||||
<a href="#SkPaint_TextEncoding">TextEncoding</a> determines whether text specifies character codes and their encoded
|
||||
size, or glyph indices. Character codes use the encoding specified by the<a href="undocumented#Unicode">Unicode</a> standard.
|
||||
size, or glyph indices. Characters are encoded as specified by the<a href="undocumented#Unicode">Unicode</a> standard.
|
||||
|
||||
Character codes encoded size are specified by <a href="undocumented#UTF_8">UTF-8</a>, <a href="undocumented#UTF_16">UTF-16</a>, or <a href="undocumented#UTF_32">UTF-32</a>.
|
||||
All character encodings are able to represent all of <a href="undocumented#Unicode">Unicode</a>, differing only
|
||||
All character code formats are able to represent all of <a href="undocumented#Unicode">Unicode</a>, differing only
|
||||
in the total storage required.
|
||||
|
||||
<a href="undocumented#UTF_8">UTF-8</a> (<a href="undocumented#RFC">RFC</a> 3629)encodes each character as one or more 8-bit bytes.
|
||||
@ -3990,9 +3990,9 @@ A glyph index is a 16-bit word.
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="b29294e7f29d160a1b46abf2dcec9d2a"><div>First line has <a href="undocumented#UTF_8">UTF-8</a> encoding.
|
||||
Second line has <a href="undocumented#UTF_16">UTF-16</a> encoding.
|
||||
Third line has <a href="undocumented#UTF_32">UTF-32</a> encoding.
|
||||
<div><fiddle-embed name="b29294e7f29d160a1b46abf2dcec9d2a"><div>First line is encoded in <a href="undocumented#UTF_8">UTF-8</a>.
|
||||
Second line is encoded in <a href="undocumented#UTF_16">UTF-16</a>.
|
||||
Third line is encoded in <a href="undocumented#UTF_32">UTF-32</a>.
|
||||
Fourth line has 16 bit glyph indices.</div></fiddle-embed></div>
|
||||
|
||||
<a name="SkPaint_getTextEncoding"></a>
|
||||
@ -4455,8 +4455,7 @@ Returns the number of glyph indices represented by <a href="#SkPaint_textToGlyph
|
||||
<a href="#Text_Encoding">Text Encoding</a> specifies how <a href="#SkPaint_textToGlyphs_text">text</a> represents characters or <a href="#SkPaint_textToGlyphs_glyphs">glyphs</a>.
|
||||
<a href="#SkPaint_textToGlyphs_glyphs">glyphs</a> may be nullptr, to compute the glyph count.
|
||||
|
||||
Does not check <a href="#SkPaint_textToGlyphs_text">text</a> for valid character encoding or valid
|
||||
glyph indices.
|
||||
Does not check <a href="#SkPaint_textToGlyphs_text">text</a> for valid character codes or valid glyph indices.
|
||||
|
||||
If <a href="#SkPaint_textToGlyphs_byteLength">byteLength</a> equals zero, returns zero.
|
||||
If <a href="#SkPaint_textToGlyphs_byteLength">byteLength</a> includes a partial character, the partial character is ignored.
|
||||
@ -5103,10 +5102,10 @@ effects in the paint (e.g. stroking). If needed, it uses the <a href="#SkPaint_c
|
||||
parameter. It returns the adjusted bounds that can then be used
|
||||
for <a href="#SkCanvas_quickReject">SkCanvas::quickReject</a> tests.
|
||||
|
||||
The returned <a href="undocumented#Rect">Rect</a> will either be <a href="#SkPaint_computeFastBounds_orig">orig</a> or <a href="#SkPaint_computeFastBounds_storage">storage</a>, thus the caller
|
||||
The returned <a href="SkRect_Reference#Rect">Rect</a> will either be <a href="#SkPaint_computeFastBounds_orig">orig</a> or <a href="#SkPaint_computeFastBounds_storage">storage</a>, thus the caller
|
||||
should not rely on <a href="#SkPaint_computeFastBounds_storage">storage</a> being set to the result, but should always
|
||||
use the returned value. It is legal for <a href="#SkPaint_computeFastBounds_orig">orig</a> and <a href="#SkPaint_computeFastBounds_storage">storage</a> to be the same
|
||||
<a href="undocumented#Rect">Rect</a>.
|
||||
<a href="SkRect_Reference#Rect">Rect</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -13,11 +13,11 @@ containing two connected <a href="#Line">Lines</a> are described the <a href="#V
|
||||
with three entries, sharing
|
||||
the middle entry as the end of the first <a href="undocumented#Line">Line</a> and the start of the second <a href="undocumented#Line">Line</a>.
|
||||
|
||||
<a href="#Path">Path</a> components <a href="#Arc">Arc</a>, <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> are composed of
|
||||
<a href="#Path">Path</a> components <a href="#Arc">Arc</a>, <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> are composed of
|
||||
<a href="#Line">Lines</a> and <a href="#Curve">Curves</a> with as many <a href="#Verb">Verbs</a> and <a href="#Point">Points</a> required
|
||||
for an exact description. Once added to <a href="#Path">Path</a>, these components may lose their
|
||||
identity; although <a href="#Path">Path</a> can be inspected to determine if it describes a single
|
||||
<a href="undocumented#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, <a href="undocumented#Round_Rect">Round Rect</a>, and so on.
|
||||
<a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, <a href="undocumented#Round_Rect">Round Rect</a>, and so on.
|
||||
|
||||
### Example
|
||||
|
||||
@ -147,13 +147,13 @@ Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and co
|
||||
| <a href="#SkPath_addPath">addPath</a> | Adds contents of <a href="#Path">Path</a>. |
|
||||
| <a href="#SkPath_addPoly">addPoly</a> | Adds one <a href="#Contour">Contour</a> containing connected lines. |
|
||||
| <a href="#SkPath_addRRect">addRRect</a> | Adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a>. |
|
||||
| <a href="#SkPath_addRect">addRect</a> | Adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Rect">Rect</a>. |
|
||||
| <a href="#SkPath_addRect">addRect</a> | Adds one <a href="#Contour">Contour</a> containing <a href="SkRect_Reference#Rect">Rect</a>. |
|
||||
| <a href="#SkPath_addRoundRect">addRoundRect</a> | Adds one <a href="#Contour">Contour</a> containing <a href="undocumented#Round_Rect">Round Rect</a> with common corner radii. |
|
||||
| <a href="#SkPath_arcTo">arcTo</a> | Appends <a href="#Arc">Arc</a>. |
|
||||
| <a href="#SkPath_close">close</a> | Makes last <a href="#Contour">Contour</a> a loop. |
|
||||
| <a href="#SkPath_computeTightBounds">computeTightBounds</a> | Returns extent of geometry. |
|
||||
| <a href="#SkPath_conicTo">conicTo</a> | Appends <a href="#Conic">Conic</a>. |
|
||||
| <a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> | Returns true if <a href="undocumented#Rect">Rect</a> may be inside. |
|
||||
| <a href="#SkPath_conservativelyContainsRect">conservativelyContainsRect</a> | Returns true if <a href="SkRect_Reference#Rect">Rect</a> may be inside. |
|
||||
| <a href="#SkPath_contains">contains</a> | Returns if <a href="undocumented#Point">Point</a> is in fill area. |
|
||||
| <a href="#SkPath_countPoints">countPoints</a> | Returns <a href="#Point_Array">Point Array</a> length. |
|
||||
| <a href="#SkPath_countVerbs">countVerbs</a> | Returns <a href="#Verb_Array">Verb Array</a> length. |
|
||||
@ -179,10 +179,10 @@ Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and co
|
||||
| <a href="#SkPath_isInverseFillType">isInverseFillType</a> | Returns if <a href="#Fill_Type">Fill Type</a> fills outside geometry. |
|
||||
| <a href="#SkPath_isLastContourClosed">isLastContourClosed</a> | Returns if final <a href="#Contour">Contour</a> forms a loop. |
|
||||
| <a href="#SkPath_isLine">isLine</a> | Returns if describes <a href="undocumented#Line">Line</a>. |
|
||||
| <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> | Returns if describes <a href="undocumented#Rect">Rect</a> pair, one inside the other. |
|
||||
| <a href="#SkPath_isNestedFillRects">isNestedFillRects</a> | Returns if describes <a href="SkRect_Reference#Rect">Rect</a> pair, one inside the other. |
|
||||
| <a href="#SkPath_isOval">isOval</a> | Returns if describes <a href="undocumented#Oval">Oval</a>. |
|
||||
| <a href="#SkPath_isRRect">isRRect</a> | Returns if describes <a href="undocumented#Round_Rect">Round Rect</a>. |
|
||||
| <a href="#SkPath_isRect">isRect</a> | Returns if describes <a href="undocumented#Rect">Rect</a>. |
|
||||
| <a href="#SkPath_isRect">isRect</a> | Returns if describes <a href="SkRect_Reference#Rect">Rect</a>. |
|
||||
| <a href="#SkPath_isValid">isValid</a> | Returns if data is internally consistent. |
|
||||
| <a href="#SkPath_isVolatile">isVolatile</a> | Returns if <a href="undocumented#Device">Device</a> should not cache. |
|
||||
| <a href="#SkPath_lineTo">lineTo</a> | Appends <a href="undocumented#Line">Line</a>. |
|
||||
@ -207,7 +207,7 @@ Internally, <a href="#Path">Path</a> lazily computes metrics likes bounds and co
|
||||
| <a href="#SkPath_setLastPt">setLastPt</a> | Replaces <a href="#Last_Point">Last Point</a>. |
|
||||
| <a href="#SkPath_swap">swap</a> | Exchanges <a href="#Path">Path</a> pair. |
|
||||
| <a href="#SkPath_toggleInverseFillType">toggleInverseFillType</a> | Toggles <a href="#Fill_Type">Fill Type</a> between inside and outside geometry. |
|
||||
| <a href="#SkPath_transform">transform</a> | Applies <a href="undocumented#Matrix">Matrix</a> to <a href="#Point_Array">Point Array</a> and <a href="#Weight">Weights</a>. |
|
||||
| <a href="#SkPath_transform">transform</a> | Applies <a href="SkMatrix_Reference#Matrix">Matrix</a> to <a href="#Point_Array">Point Array</a> and <a href="#Weight">Weights</a>. |
|
||||
| <a href="#SkPath_unique">unique</a> | Returns if data has single owner. |
|
||||
| <a href="#SkPath_updateBoundsCache">updateBoundsCache</a> | Refreshes result of <a href="#SkPath_getBounds">getBounds</a>. |
|
||||
| <a href="#SkPath_writeToMemory">writeToMemory</a> | Copies data to buffer. |
|
||||
@ -312,7 +312,7 @@ When <a href="#Path">Path</a> <a href="#SkPath_contains">contains</a> multiple o
|
||||
measures along <a href="#Path">Path</a> to determine where to start and stop stroke; <a href="#Direction">Direction</a>
|
||||
will change dashed results as it steps clockwise or counterclockwise.
|
||||
|
||||
Closed <a href="#Contour">Contours</a> like <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> added with
|
||||
Closed <a href="#Contour">Contours</a> like <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Round_Rect">Round Rect</a>, <a href="undocumented#Circle">Circle</a>, and <a href="undocumented#Oval">Oval</a> added with
|
||||
<a href="#SkPath_kCW_Direction">kCW Direction</a> travel clockwise; the same added with <a href="#SkPath_kCCW_Direction">kCCW Direction</a>
|
||||
travel counterclockwise.
|
||||
|
||||
@ -1033,7 +1033,7 @@ Triggers performance optimizations on some <a href="undocumented#GPU_Surface">GP
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_isOval_rect"> <code><strong>rect </strong></code> </a></td> <td>
|
||||
storage for bounding <a href="undocumented#Rect">Rect</a> of <a href="undocumented#Oval">Oval</a>; may be nullptr</td>
|
||||
storage for bounding <a href="SkRect_Reference#Rect">Rect</a> of <a href="undocumented#Oval">Oval</a>; may be nullptr</td>
|
||||
</tr> <tr> <td><a name="SkPath_isOval_dir"> <code><strong>dir </strong></code> </a></td> <td>
|
||||
storage for <a href="#SkPath_Direction">Direction</a>; may be nullptr</td>
|
||||
</tr> <tr> <td><a name="SkPath_isOval_start"> <code><strong>start </strong></code> </a></td> <td>
|
||||
@ -1063,7 +1063,7 @@ bool isRRect(SkRRect* rrect, Direction* dir = nullptr, unsigned* start = nullptr
|
||||
</pre>
|
||||
|
||||
Returns true if constructed by <a href="#SkPath_addRoundRect">addRoundRect</a>, <a href="#SkPath_addRRect">addRRect</a>; and if construction
|
||||
is not empty, not <a href="undocumented#Rect">Rect</a>, and not <a href="undocumented#Oval">Oval</a>. <a href="#Path">Path</a> constructed with other calls
|
||||
is not empty, not <a href="SkRect_Reference#Rect">Rect</a>, and not <a href="undocumented#Oval">Oval</a>. <a href="#Path">Path</a> constructed with other calls
|
||||
will not return true though <a href="#Path">Path</a> draws <a href="undocumented#Round_Rect">Round Rect</a>.
|
||||
|
||||
<a href="#SkPath_isRRect_rrect">rrect</a> receives bounds of <a href="undocumented#Round_Rect">Round Rect</a>.
|
||||
@ -1078,7 +1078,7 @@ Triggers performance optimizations on some <a href="undocumented#GPU_Surface">GP
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_isRRect_rrect"> <code><strong>rrect </strong></code> </a></td> <td>
|
||||
storage for bounding <a href="undocumented#Rect">Rect</a> of <a href="undocumented#Round_Rect">Round Rect</a>; may be nullptr</td>
|
||||
storage for bounding <a href="SkRect_Reference#Rect">Rect</a> of <a href="undocumented#Round_Rect">Round Rect</a>; may be nullptr</td>
|
||||
</tr> <tr> <td><a name="SkPath_isRRect_dir"> <code><strong>dir </strong></code> </a></td> <td>
|
||||
storage for <a href="#SkPath_Direction">Direction</a>; may be nullptr</td>
|
||||
</tr> <tr> <td><a name="SkPath_isRRect_start"> <code><strong>start </strong></code> </a></td> <td>
|
||||
@ -1789,7 +1789,7 @@ Returns minimum and maximum x and y values of <a href="#Point_Array">Point Array
|
||||
Returns (0, 0, 0, 0) if <a href="#Path">Path</a> <a href="#SkPath_contains">contains</a> no points. Returned bounds width and height may
|
||||
be larger or smaller than area affected when <a href="#Path">Path</a> is drawn.
|
||||
|
||||
<a href="undocumented#Rect">Rect</a> returned includes all <a href="#Point">Points</a> added to <a href="#Path">Path</a>, including <a href="#Point">Points</a> associated with
|
||||
<a href="SkRect_Reference#Rect">Rect</a> returned includes all <a href="#Point">Points</a> added to <a href="#Path">Path</a>, including <a href="#Point">Points</a> associated with
|
||||
<a href="#SkPath_kMove_Verb">kMove Verb</a> that define empty <a href="#Contour">Contours</a>.
|
||||
|
||||
### Return Value
|
||||
@ -1914,7 +1914,7 @@ the <a href="undocumented#Point">Point</a> or <a href="undocumented#Line">Line</
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_conservativelyContainsRect_rect"> <code><strong>rect </strong></code> </a></td> <td>
|
||||
<a href="undocumented#Rect">Rect</a>, <a href="undocumented#Line">Line</a>, or <a href="undocumented#Point">Point</a> checked for containment</td>
|
||||
<a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Line">Line</a>, or <a href="undocumented#Point">Point</a> checked for containment</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -1924,11 +1924,11 @@ true if <a href="#SkPath_conservativelyContainsRect_rect">rect</a> is contained
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="41638d13e40fa449ece354dde5fb1941"><div><a href="undocumented#Rect">Rect</a> is drawn in blue if it is contained by red <a href="#Path">Path</a>.</div></fiddle-embed></div>
|
||||
<div><fiddle-embed name="41638d13e40fa449ece354dde5fb1941"><div><a href="SkRect_Reference#Rect">Rect</a> is drawn in blue if it is contained by red <a href="#Path">Path</a>.</div></fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPath_contains">contains</a> <a href="undocumented#Op">Op</a> <a href="undocumented#Rect">Rect</a> <a href="#SkPath_Convexity">Convexity</a>
|
||||
<a href="#SkPath_contains">contains</a> <a href="undocumented#Op">Op</a> <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_Convexity">Convexity</a>
|
||||
|
||||
---
|
||||
|
||||
@ -3168,7 +3168,7 @@ bool isRect(SkRect* rect, bool* isClosed = nullptr,
|
||||
Direction* direction = nullptr) const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href="#Path">Path</a> is equivalent to <a href="undocumented#Rect">Rect</a> when filled.
|
||||
Returns true if <a href="#Path">Path</a> is equivalent to <a href="SkRect_Reference#Rect">Rect</a> when filled.
|
||||
If false: <a href="#SkPath_isRect_rect">rect</a>, <a href="#SkPath_isRect_isClosed">isClosed</a>, and <a href="#SkPath_isRect_direction">direction</a> are unchanged.
|
||||
If true: <a href="#SkPath_isRect_rect">rect</a>, <a href="#SkPath_isRect_isClosed">isClosed</a>, and <a href="#SkPath_isRect_direction">direction</a> are written to if not nullptr.
|
||||
|
||||
@ -3178,17 +3178,17 @@ that do not alter the area drawn by the returned <a href="#SkPath_isRect_rect">r
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_isRect_rect"> <code><strong>rect </strong></code> </a></td> <td>
|
||||
storage for bounds of <a href="undocumented#Rect">Rect</a>; may be nullptr</td>
|
||||
storage for bounds of <a href="SkRect_Reference#Rect">Rect</a>; may be nullptr</td>
|
||||
</tr> <tr> <td><a name="SkPath_isRect_isClosed"> <code><strong>isClosed </strong></code> </a></td> <td>
|
||||
storage set to true if <a href="#Path">Path</a> is closed; may be nullptr</td>
|
||||
</tr> <tr> <td><a name="SkPath_isRect_direction"> <code><strong>direction </strong></code> </a></td> <td>
|
||||
storage set to <a href="undocumented#Rect">Rect</a> <a href="#SkPath_isRect_direction">direction</a>; may be nullptr</td>
|
||||
storage set to <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_isRect_direction">direction</a>; may be nullptr</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href="#Path">Path</a> <a href="#SkPath_contains">contains</a> <a href="undocumented#Rect">Rect</a>
|
||||
true if <a href="#Path">Path</a> <a href="#SkPath_contains">contains</a> <a href="SkRect_Reference#Rect">Rect</a>
|
||||
|
||||
### Example
|
||||
|
||||
@ -3221,17 +3221,17 @@ addPoly is rect (0, 0, 80, 80); is not closed; direction CCW
|
||||
bool isNestedFillRects(SkRect rect[2], Direction dirs[2] = nullptr) const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href="#Path">Path</a> is equivalent to nested <a href="undocumented#Rect">Rect</a> pair when filled.
|
||||
Returns true if <a href="#Path">Path</a> is equivalent to nested <a href="SkRect_Reference#Rect">Rect</a> pair when filled.
|
||||
If false, <a href="#SkPath_isNestedFillRects_rect">rect</a> and <a href="#SkPath_isNestedFillRects_dirs">dirs</a> are unchanged.
|
||||
If true, <a href="#SkPath_isNestedFillRects_rect">rect</a> and <a href="#SkPath_isNestedFillRects_dirs">dirs</a> are written to if not nullptr:
|
||||
setting <a href="#SkPath_isNestedFillRects_rect">rect</a>[0] to outer <a href="undocumented#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_rect">rect</a>[1] to inner <a href="undocumented#Rect">Rect</a>;
|
||||
setting <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[0] to <a href="#SkPath_Direction">Direction</a> of outer <a href="undocumented#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[1] to <a href="#SkPath_Direction">Direction</a> of inner
|
||||
<a href="undocumented#Rect">Rect</a>.
|
||||
setting <a href="#SkPath_isNestedFillRects_rect">rect</a>[0] to outer <a href="SkRect_Reference#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_rect">rect</a>[1] to inner <a href="SkRect_Reference#Rect">Rect</a>;
|
||||
setting <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[0] to <a href="#SkPath_Direction">Direction</a> of outer <a href="SkRect_Reference#Rect">Rect</a>, and <a href="#SkPath_isNestedFillRects_dirs">dirs</a>[1] to <a href="#SkPath_Direction">Direction</a> of inner
|
||||
<a href="SkRect_Reference#Rect">Rect</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_isNestedFillRects_rect"> <code><strong>rect </strong></code> </a></td> <td>
|
||||
storage for <a href="undocumented#Rect">Rect</a> pair; may be nullptr</td>
|
||||
storage for <a href="SkRect_Reference#Rect">Rect</a> pair; may be nullptr</td>
|
||||
</tr> <tr> <td><a name="SkPath_isNestedFillRects_dirs"> <code><strong>dirs </strong></code> </a></td> <td>
|
||||
storage for <a href="#SkPath_Direction">Direction</a> pair; may be nullptr</td>
|
||||
</tr>
|
||||
@ -3239,7 +3239,7 @@ storage for <a href="#SkPath_Direction">Direction</a> pair; may be nullptr</td>
|
||||
|
||||
### Return Value
|
||||
|
||||
true if <a href="#Path">Path</a> <a href="#SkPath_contains">contains</a> nested <a href="undocumented#Rect">Rect</a> pair
|
||||
true if <a href="#Path">Path</a> <a href="#SkPath_contains">contains</a> nested <a href="SkRect_Reference#Rect">Rect</a> pair
|
||||
|
||||
### Example
|
||||
|
||||
@ -3267,15 +3267,15 @@ inner (12.5, 22.5, 27.5, 37.5); direction CCW
|
||||
void addRect(const SkRect& rect, Direction dir = kCW_Direction)
|
||||
</pre>
|
||||
|
||||
Add <a href="undocumented#Rect">Rect</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>,
|
||||
starting with top-left corner of <a href="undocumented#Rect">Rect</a>; followed by top-right, bottom-right,
|
||||
Add <a href="SkRect_Reference#Rect">Rect</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>,
|
||||
starting with top-left corner of <a href="SkRect_Reference#Rect">Rect</a>; followed by top-right, bottom-right,
|
||||
and bottom-left if <a href="#SkPath_addRect_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>; or followed by bottom-left,
|
||||
bottom-right, and top-right if <a href="#SkPath_addRect_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_addRect_rect"> <code><strong>rect </strong></code> </a></td> <td>
|
||||
<a href="undocumented#Rect">Rect</a> to add as a closed contour</td>
|
||||
<a href="SkRect_Reference#Rect">Rect</a> to add as a closed contour</td>
|
||||
</tr> <tr> <td><a name="SkPath_addRect_dir"> <code><strong>dir </strong></code> </a></td> <td>
|
||||
<a href="#SkPath_Direction">Direction</a> to wind added contour</td>
|
||||
</tr>
|
||||
@ -3283,8 +3283,8 @@ bottom-right, and top-right if <a href="#SkPath_addRect_dir">dir</a> is <a href=
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="0f841e4eaebb613b5069800567917c2d"><div>The left <a href="undocumented#Rect">Rect</a> dashes starting at the top-left corner, to the right.
|
||||
The right <a href="undocumented#Rect">Rect</a> dashes starting at the top-left corner, towards the bottom.</div></fiddle-embed></div>
|
||||
<div><fiddle-embed name="0f841e4eaebb613b5069800567917c2d"><div>The left <a href="SkRect_Reference#Rect">Rect</a> dashes starting at the top-left corner, to the right.
|
||||
The right <a href="SkRect_Reference#Rect">Rect</a> dashes starting at the top-left corner, towards the bottom.</div></fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
@ -3296,9 +3296,9 @@ The right <a href="undocumented#Rect">Rect</a> dashes starting at the top-left c
|
||||
void addRect(const SkRect& rect, Direction dir, unsigned start)
|
||||
</pre>
|
||||
|
||||
Add <a href="undocumented#Rect">Rect</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>.
|
||||
If <a href="#SkPath_addRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="undocumented#Rect">Rect</a> corners are added clockwise; if <a href="#SkPath_addRect_2_dir">dir</a> is
|
||||
<a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="undocumented#Rect">Rect</a> corners are added counterclockwise.
|
||||
Add <a href="SkRect_Reference#Rect">Rect</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>.
|
||||
If <a href="#SkPath_addRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, <a href="SkRect_Reference#Rect">Rect</a> corners are added clockwise; if <a href="#SkPath_addRect_2_dir">dir</a> is
|
||||
<a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="SkRect_Reference#Rect">Rect</a> corners are added counterclockwise.
|
||||
<a href="#SkPath_addRect_2_start">start</a> determines the first corner added.
|
||||
|
||||
| <a href="#SkPath_addRect_2_start">start</a> | first corner |
|
||||
@ -3311,11 +3311,11 @@ If <a href="#SkPath_addRect_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kC
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_addRect_2_rect"> <code><strong>rect </strong></code> </a></td> <td>
|
||||
<a href="undocumented#Rect">Rect</a> to add as a closed contour</td>
|
||||
<a href="SkRect_Reference#Rect">Rect</a> to add as a closed contour</td>
|
||||
</tr> <tr> <td><a name="SkPath_addRect_2_dir"> <code><strong>dir </strong></code> </a></td> <td>
|
||||
<a href="#SkPath_Direction">Direction</a> to wind added contour</td>
|
||||
</tr> <tr> <td><a name="SkPath_addRect_2_start"> <code><strong>start </strong></code> </a></td> <td>
|
||||
initial corner of <a href="undocumented#Rect">Rect</a> to add</td>
|
||||
initial corner of <a href="SkRect_Reference#Rect">Rect</a> to add</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -3335,22 +3335,22 @@ void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom,
|
||||
Direction dir = kCW_Direction)
|
||||
</pre>
|
||||
|
||||
Add <a href="undocumented#Rect">Rect</a> (<a href="#SkPath_addRect_3_left">left</a>, <a href="#SkPath_addRect_3_top">top</a>, <a href="#SkPath_addRect_3_right">right</a>, <a href="#SkPath_addRect_3_bottom">bottom</a>) to <a href="#Path">Path</a>,
|
||||
Add <a href="SkRect_Reference#Rect">Rect</a> (<a href="#SkPath_addRect_3_left">left</a>, <a href="#SkPath_addRect_3_top">top</a>, <a href="#SkPath_addRect_3_right">right</a>, <a href="#SkPath_addRect_3_bottom">bottom</a>) to <a href="#Path">Path</a>,
|
||||
appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, three <a href="#SkPath_kLine_Verb">kLine Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>,
|
||||
starting with top-left corner of <a href="undocumented#Rect">Rect</a>; followed by top-right, bottom-right,
|
||||
starting with top-left corner of <a href="SkRect_Reference#Rect">Rect</a>; followed by top-right, bottom-right,
|
||||
and bottom-left if <a href="#SkPath_addRect_3_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>; or followed by bottom-left,
|
||||
bottom-right, and top-right if <a href="#SkPath_addRect_3_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_addRect_3_left"> <code><strong>left </strong></code> </a></td> <td>
|
||||
smaller x of <a href="undocumented#Rect">Rect</a></td>
|
||||
smaller x of <a href="SkRect_Reference#Rect">Rect</a></td>
|
||||
</tr> <tr> <td><a name="SkPath_addRect_3_top"> <code><strong>top </strong></code> </a></td> <td>
|
||||
smaller y of <a href="undocumented#Rect">Rect</a></td>
|
||||
smaller y of <a href="SkRect_Reference#Rect">Rect</a></td>
|
||||
</tr> <tr> <td><a name="SkPath_addRect_3_right"> <code><strong>right </strong></code> </a></td> <td>
|
||||
larger x of <a href="undocumented#Rect">Rect</a></td>
|
||||
larger x of <a href="SkRect_Reference#Rect">Rect</a></td>
|
||||
</tr> <tr> <td><a name="SkPath_addRect_3_bottom"> <code><strong>bottom </strong></code> </a></td> <td>
|
||||
larger y of <a href="undocumented#Rect">Rect</a></td>
|
||||
larger y of <a href="SkRect_Reference#Rect">Rect</a></td>
|
||||
</tr> <tr> <td><a name="SkPath_addRect_3_dir"> <code><strong>dir </strong></code> </a></td> <td>
|
||||
<a href="#SkPath_Direction">Direction</a> to wind added contour</td>
|
||||
</tr>
|
||||
@ -3358,8 +3358,8 @@ larger y of <a href="undocumented#Rect">Rect</a></td>
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="3837827310e8b88b8c2e128ef9fbbd65"><div>The <a href="#SkPath_addRect_3_left">left</a> <a href="undocumented#Rect">Rect</a> dashes start at the top-left corner, and continue to the <a href="#SkPath_addRect_3_right">right</a>.
|
||||
The <a href="#SkPath_addRect_3_right">right</a> <a href="undocumented#Rect">Rect</a> dashes start at the top-left corner, and continue down.</div></fiddle-embed></div>
|
||||
<div><fiddle-embed name="3837827310e8b88b8c2e128ef9fbbd65"><div>The <a href="#SkPath_addRect_3_left">left</a> <a href="SkRect_Reference#Rect">Rect</a> dashes start at the top-left corner, and continue to the <a href="#SkPath_addRect_3_right">right</a>.
|
||||
The <a href="#SkPath_addRect_3_right">right</a> <a href="SkRect_Reference#Rect">Rect</a> dashes start at the top-left corner, and continue down.</div></fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
@ -3375,7 +3375,7 @@ void addOval(const SkRect& oval, Direction dir = kCW_Direction)
|
||||
</pre>
|
||||
|
||||
Add <a href="undocumented#Oval">Oval</a> to path, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, four <a href="#SkPath_kConic_Verb">kConic Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>.
|
||||
<a href="undocumented#Oval">Oval</a> is upright ellipse bounded by <a href="undocumented#Rect">Rect</a> <a href="#SkPath_addOval_oval">oval</a> with radii equal to half <a href="#SkPath_addOval_oval">oval</a> width
|
||||
<a href="undocumented#Oval">Oval</a> is upright ellipse bounded by <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addOval_oval">oval</a> with radii equal to half <a href="#SkPath_addOval_oval">oval</a> width
|
||||
and half <a href="#SkPath_addOval_oval">oval</a> height. <a href="undocumented#Oval">Oval</a> begins at (<a href="#SkPath_addOval_oval">oval</a>.fRight, <a href="#SkPath_addOval_oval">oval</a>.centerY()) and continues
|
||||
clockwise if <a href="#SkPath_addOval_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, counterclockwise if <a href="#SkPath_addOval_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>.
|
||||
|
||||
@ -3405,7 +3405,7 @@ void addOval(const SkRect& oval, Direction dir, unsigned start)
|
||||
</pre>
|
||||
|
||||
Add <a href="undocumented#Oval">Oval</a> to <a href="#Path">Path</a>, appending <a href="#SkPath_kMove_Verb">kMove Verb</a>, four <a href="#SkPath_kConic_Verb">kConic Verb</a>, and <a href="#SkPath_kClose_Verb">kClose Verb</a>.
|
||||
<a href="undocumented#Oval">Oval</a> is upright ellipse bounded by <a href="undocumented#Rect">Rect</a> <a href="#SkPath_addOval_2_oval">oval</a> with radii equal to half <a href="#SkPath_addOval_2_oval">oval</a> width
|
||||
<a href="undocumented#Oval">Oval</a> is upright ellipse bounded by <a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addOval_2_oval">oval</a> with radii equal to half <a href="#SkPath_addOval_2_oval">oval</a> width
|
||||
and half <a href="#SkPath_addOval_2_oval">oval</a> height. <a href="undocumented#Oval">Oval</a> begins at <a href="#SkPath_addOval_2_start">start</a> and continues
|
||||
clockwise if <a href="#SkPath_addOval_2_dir">dir</a> is <a href="#SkPath_kCW_Direction">kCW Direction</a>, counterclockwise if <a href="#SkPath_addOval_2_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>.
|
||||
|
||||
@ -3530,9 +3530,9 @@ of the upper-left corner and winds counterclockwise.
|
||||
|
||||
If either <a href="#SkPath_addRoundRect_rx">rx</a> or <a href="#SkPath_addRoundRect_ry">ry</a> is too large, <a href="#SkPath_addRoundRect_rx">rx</a> and <a href="#SkPath_addRoundRect_ry">ry</a> are scaled uniformly until the
|
||||
corners fit. If <a href="#SkPath_addRoundRect_rx">rx</a> or <a href="#SkPath_addRoundRect_ry">ry</a> is less than or equal to zero, <a href="#SkPath_addRoundRect">addRoundRect</a> appends
|
||||
<a href="undocumented#Rect">Rect</a> <a href="#SkPath_addRoundRect_rect">rect</a> to <a href="#Path">Path</a>.
|
||||
<a href="SkRect_Reference#Rect">Rect</a> <a href="#SkPath_addRoundRect_rect">rect</a> to <a href="#Path">Path</a>.
|
||||
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect.
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -3549,7 +3549,7 @@ y-radius of rounded corners on the <a href="undocumented#Round_Rect">Round Rect<
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="24736f685f265cf533f1700c042db353"><div>If either radius is zero, path <a href="#SkPath_contains">contains</a> <a href="undocumented#Rect">Rect</a> and is drawn red.
|
||||
<div><fiddle-embed name="24736f685f265cf533f1700c042db353"><div>If either radius is zero, path <a href="#SkPath_contains">contains</a> <a href="SkRect_Reference#Rect">Rect</a> and is drawn red.
|
||||
If sides are only radii, path <a href="#SkPath_contains">contains</a> <a href="undocumented#Oval">Oval</a> and is drawn blue.
|
||||
All remaining path draws are convex, and are drawn in gray; no
|
||||
paths constructed from <a href="#SkPath_addRoundRect">addRoundRect</a> are concave, so none are
|
||||
@ -3589,7 +3589,7 @@ If both <a href="#SkPath_addRoundRect_2_radii">radii</a> on any side of <a href=
|
||||
uniformly until the corners fit. If either radius of a corner is less than or
|
||||
equal to zero, both are treated as zero.
|
||||
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect.
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or RoundRect.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -3624,7 +3624,7 @@ Add <a href="#SkPath_addRRect_rrect">rrect</a> to <a href="#Path">Path</a>, crea
|
||||
winds clockwise. If <a href="#SkPath_addRRect_dir">dir</a> is <a href="#SkPath_kCCW_Direction">kCCW Direction</a>, <a href="#SkPath_addRRect_rrect">rrect</a> starts at the bottom-left
|
||||
of the upper-left corner and winds counterclockwise.
|
||||
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or <a href="undocumented#Round_Rect">Round Rect</a>.
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or <a href="undocumented#Round_Rect">Round Rect</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -3664,7 +3664,7 @@ winds clockwise; if <a href="#SkPath_addRRect_2_dir">dir</a> is <a href="#SkPath
|
||||
| 6 | top of bottom-left corner |
|
||||
| 7 | bottom of top-left corner |
|
||||
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="undocumented#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or <a href="undocumented#Round_Rect">Round Rect</a>.
|
||||
After appending, <a href="#Path">Path</a> may be empty, or may contain: <a href="SkRect_Reference#Rect">Rect</a>, <a href="undocumented#Oval">Oval</a>, or <a href="undocumented#Round_Rect">Round Rect</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -3956,7 +3956,7 @@ is replaced.
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_transform_matrix"> <code><strong>matrix </strong></code> </a></td> <td>
|
||||
<a href="undocumented#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td>
|
||||
<a href="SkMatrix_Reference#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td>
|
||||
</tr> <tr> <td><a name="SkPath_transform_dst"> <code><strong>dst </strong></code> </a></td> <td>
|
||||
overwritten, transformed copy of <a href="#Path">Path</a>; may be nullptr</td>
|
||||
</tr>
|
||||
@ -3968,7 +3968,7 @@ overwritten, transformed copy of <a href="#Path">Path</a>; may be nullptr</td>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPath_addPath">addPath</a> <a href="#SkPath_offset">offset</a> <a href="#SkCanvas_concat">SkCanvas::concat()</a> <a href="undocumented#SkMatrix">SkMatrix</a>
|
||||
<a href="#SkPath_addPath">addPath</a> <a href="#SkPath_offset">offset</a> <a href="#SkCanvas_concat">SkCanvas::concat()</a> <a href="SkMatrix_Reference#SkMatrix">SkMatrix</a>
|
||||
|
||||
---
|
||||
|
||||
@ -3983,7 +3983,7 @@ Transform <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Arr
|
||||
### Parameters
|
||||
|
||||
<table> <tr> <td><a name="SkPath_transform_2_matrix"> <code><strong>matrix </strong></code> </a></td> <td>
|
||||
<a href="undocumented#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td>
|
||||
<a href="SkMatrix_Reference#Matrix">Matrix</a> to apply to <a href="#Path">Path</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -3993,7 +3993,7 @@ Transform <a href="#Verb_Array">Verb Array</a>, <a href="#Point_Array">Point Arr
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPath_addPath">addPath</a> <a href="#SkPath_offset">offset</a> <a href="#SkCanvas_concat">SkCanvas::concat()</a> <a href="undocumented#SkMatrix">SkMatrix</a>
|
||||
<a href="#SkPath_addPath">addPath</a> <a href="#SkPath_offset">offset</a> <a href="#SkCanvas_concat">SkCanvas::concat()</a> <a href="SkMatrix_Reference#SkMatrix">SkMatrix</a>
|
||||
|
||||
---
|
||||
|
||||
@ -4390,7 +4390,7 @@ path is equal to copy
|
||||
## serialize
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkData> serialize() const
|
||||
sk_sp<SkData> serialize() const
|
||||
</pre>
|
||||
|
||||
Write <a href="#Path">Path</a> to buffer, returning the buffer written to, wrapped in <a href="undocumented#Data">Data</a>.
|
||||
|
@ -9,11 +9,11 @@ SkPixmap Reference
|
||||
raster destinations. <a href="SkCanvas_Reference#Canvas">Canvas</a> can not draw <a href="#Pixmap">Pixmap</a>, nor does <a href="#Pixmap">Pixmap</a> provide
|
||||
a direct drawing destination.
|
||||
|
||||
Use <a href="undocumented#Bitmap">Bitmap</a> to draw pixels referenced by <a href="#Pixmap">Pixmap</a>; use <a href="undocumented#Surface">Surface</a> to draw into
|
||||
Use <a href="SkBitmap_Reference#Bitmap">Bitmap</a> to draw pixels referenced by <a href="#Pixmap">Pixmap</a>; use <a href="undocumented#Surface">Surface</a> to draw into
|
||||
pixels referenced by <a href="#Pixmap">Pixmap</a>.
|
||||
|
||||
<a href="#Pixmap">Pixmap</a> does not try to manage the lifetime of the pixel memory. Use <a href="undocumented#PixelRef">PixelRef</a>
|
||||
to manage pixel memory; <a href="undocumented#PixelRef">PixelRef</a> is safe across threads.
|
||||
<a href="#Pixmap">Pixmap</a> does not try to manage the lifetime of the pixel memory. Use <a href="undocumented#Pixel_Ref">Pixel Ref</a>
|
||||
to manage pixel memory; <a href="undocumented#Pixel_Ref">Pixel Ref</a> is safe across threads.
|
||||
|
||||
# <a name="Overview"></a> Overview
|
||||
|
||||
@ -238,7 +238,7 @@ size of one row of <a href="#SkPixmap_addr">addr</a>; <a href="#SkPixmap_width">
|
||||
## setColorSpace
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setColorSpace(sk_sp<SkColorSpace> colorSpace)
|
||||
void setColorSpace(sk_sp<SkColorSpace> colorSpace)
|
||||
</pre>
|
||||
|
||||
Changes <a href="undocumented#Color_Space">Color Space</a> in <a href="#Info">Image Info</a>; preserves <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and
|
||||
@ -391,7 +391,8 @@ size_t rowBytes() const
|
||||
Returns row bytes, the interval from one pixel row to the next. Row bytes
|
||||
is at least as large as<a href="#SkPixmap_width">width</a> * <a href="#SkPixmap_info">info</a>.bytesPerPixel().
|
||||
|
||||
It is up to the <a href="#Pixmap">Pixmap</a> creator to ensure that row bytes is a useful value.
|
||||
Returns zero if <a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>.
|
||||
It is up to the <a href="SkBitmap_Reference#Bitmap">Bitmap</a> creator to ensure that row bytes is a useful value.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -479,7 +480,7 @@ pixmap width: 16 info width: 16
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_height">height</a>
|
||||
<a href="#SkPixmap_height">height</a> <a href="#SkImageInfo_width">SkImageInfo::width()</a>
|
||||
|
||||
---
|
||||
|
||||
@ -498,7 +499,7 @@ pixel <a href="#SkPixmap_height">height</a> in <a href="#Info">Image Info</a>
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="cf80286d58a00cb0328c4205b6517755">
|
||||
<div><fiddle-embed name="4a996d32122f469d51ddd0186efb48cc">
|
||||
|
||||
#### Example Output
|
||||
|
||||
@ -510,7 +511,7 @@ pixmap height: 32 info height: 32
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_width">width</a>
|
||||
<a href="#SkPixmap_width">width</a> ImageInfo::height()
|
||||
|
||||
---
|
||||
|
||||
@ -543,7 +544,7 @@ color type: kAlpha_SkColorType
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_alphaType">alphaType</a>
|
||||
<a href="#SkPixmap_alphaType">alphaType</a> <a href="#SkImageInfo_colorType">SkImageInfo::colorType</a>
|
||||
|
||||
---
|
||||
|
||||
@ -575,7 +576,7 @@ alpha type: kPremul_SkAlphaType
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_colorType">colorType</a>
|
||||
<a href="#SkPixmap_colorType">colorType</a> <a href="#SkImageInfo_alphaType">SkImageInfo::alphaType</a>
|
||||
|
||||
---
|
||||
|
||||
@ -586,11 +587,13 @@ alpha type: kPremul_SkAlphaType
|
||||
SkColorSpace* colorSpace() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#Color_Space">Color Space</a> associated with <a href="#Info">Image Info</a>.
|
||||
Returns <a href="undocumented#Color_Space">Color Space</a> associated with <a href="#Info">Image Info</a>. The
|
||||
reference count of <a href="undocumented#Color_Space">Color Space</a> is unchanged. The returned <a href="undocumented#Color_Space">Color Space</a> is
|
||||
immutable.
|
||||
|
||||
### Return Value
|
||||
|
||||
<a href="undocumented#Color_Space">Color Space</a> in <a href="#Info">Image Info</a>
|
||||
<a href="undocumented#Color_Space">Color Space</a>, the range of colors, in <a href="#Info">Image Info</a>
|
||||
|
||||
### Example
|
||||
|
||||
@ -607,7 +610,7 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="undocumented#Color_Space">Color Space</a>
|
||||
<a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_colorSpace">SkImageInfo::colorSpace</a>
|
||||
|
||||
---
|
||||
|
||||
@ -619,7 +622,8 @@ bool isOpaque() const
|
||||
</pre>
|
||||
|
||||
Returns true if <a href="undocumented#Alpha_Type">Alpha Type</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>.
|
||||
Does not check if <a href="undocumented#Color_Type">Color Type</a> allows <a href="#Alpha">Alpha</a>, or <a href="#Alpha">Alpha</a> in pixel values.
|
||||
Does not check if <a href="undocumented#Color_Type">Color Type</a> allows <a href="#Alpha">Alpha</a>, or if any pixel value has
|
||||
transparency.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -653,7 +657,7 @@ isOpaque: true
|
||||
SkIRect bounds() const
|
||||
</pre>
|
||||
|
||||
Returns <a href="undocumented#IRect">IRect</a>{ 0, 0, <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a> }.
|
||||
Returns <a href="SkIRect_Reference#IRect">IRect</a>{ 0, 0, <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a> }.
|
||||
|
||||
### Return Value
|
||||
|
||||
@ -676,7 +680,7 @@ width: 2 height: 2 empty: false
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_height">height</a> <a href="#SkPixmap_width">width</a> <a href="undocumented#IRect">IRect</a>
|
||||
<a href="#SkPixmap_height">height</a> <a href="#SkPixmap_width">width</a> <a href="SkIRect_Reference#IRect">IRect</a>
|
||||
|
||||
---
|
||||
|
||||
@ -769,26 +773,6 @@ Includes unused memory on last row when <a href="#SkPixmap_rowBytesAsPixels">row
|
||||
|
||||
conservative pixel storage size
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="2ab8c15170ff23edb386258299221051">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
width: 1 height: 1 getSize64: 5
|
||||
width: 1 height: 1000 getSize64: 5000
|
||||
width: 1 height: 1000000 getSize64: 5000000
|
||||
width: 1000 height: 1 getSize64: 5000
|
||||
width: 1000 height: 1000 getSize64: 5000000
|
||||
width: 1000 height: 1000000 getSize64: 5000000000
|
||||
width: 1000000 height: 1 getSize64: 5000000
|
||||
width: 1000000 height: 1000 getSize64: 5000000000
|
||||
width: 1000000 height: 1000000 getSize64: 5000000000000
|
||||
~~~~
|
||||
|
||||
</fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_getSafeSize64">getSafeSize64</a> <a href="#SkPixmap_getSafeSize">getSafeSize</a> <a href="#SkPixmap_height">height</a> <a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a>
|
||||
@ -809,26 +793,6 @@ Does not include unused memory on last row when <a href="#SkPixmap_rowBytesAsPix
|
||||
|
||||
exact pixel storage size
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="aee6a517fce327bba42844b26bd4655f">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
width: 1 height: 1 getSafeSize64: 4
|
||||
width: 1 height: 1000 getSafeSize64: 4999
|
||||
width: 1 height: 1000000 getSafeSize64: 4999999
|
||||
width: 1000 height: 1 getSafeSize64: 4000
|
||||
width: 1000 height: 1000 getSafeSize64: 4999000
|
||||
width: 1000 height: 1000000 getSafeSize64: 4999999000
|
||||
width: 1000000 height: 1 getSafeSize64: 4000000
|
||||
width: 1000000 height: 1000 getSafeSize64: 4999000000
|
||||
width: 1000000 height: 1000000 getSafeSize64: 4999999000000
|
||||
~~~~
|
||||
|
||||
</fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_getSize64">getSize64</a> <a href="#SkPixmap_getSafeSize">getSafeSize</a> <a href="#SkPixmap_height">height</a> <a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a>
|
||||
@ -851,29 +815,52 @@ The largest value than can be returned is 2,147,483,647.
|
||||
|
||||
exact pixel storage size if size fits in signed 32 bits
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_getSize64">getSize64</a> <a href="#SkPixmap_getSafeSize64">getSafeSize64</a> <a href="#SkPixmap_height">height</a> <a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> <a href="undocumented#sk_64_isS32">sk 64 isS32</a>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkPixmap_computeByteSize"></a>
|
||||
## computeByteSize
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
size_t computeByteSize() const
|
||||
</pre>
|
||||
|
||||
Returns minimum memory required for pixel storage.
|
||||
Does not include unused memory on last row when <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <a href="#SkPixmap_width">width</a>.
|
||||
Returns zero if result does not fit in size_t.
|
||||
Returns zero if <a href="#SkPixmap_height">height</a> or <a href="#SkPixmap_width">width</a> is 0.
|
||||
Returns <a href="#SkPixmap_height">height</a> times <a href="#SkPixmap_rowBytes">rowBytes</a> if <a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>.
|
||||
|
||||
### Return Value
|
||||
|
||||
size in bytes of image buffer
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="1e2830708e4da1db886d8d7541af618b">
|
||||
<div><fiddle-embed name="410d14ddc45d272598c5a4e52bb047de">
|
||||
|
||||
#### Example Output
|
||||
|
||||
~~~~
|
||||
width: 1 height: 1 getSafeSize: 4
|
||||
width: 1 height: 1000 getSafeSize: 4999
|
||||
width: 1 height: 1000000 getSafeSize: 4999999
|
||||
width: 1000 height: 1 getSafeSize: 4000
|
||||
width: 1000 height: 1000 getSafeSize: 4999000
|
||||
width: 1000 height: 1000000 getSafeSize: 0
|
||||
width: 1000000 height: 1 getSafeSize: 4000000
|
||||
width: 1000000 height: 1000 getSafeSize: 0
|
||||
width: 1000000 height: 1000000 getSafeSize: 0
|
||||
width: 1 height: 1 computeByteSize: 4
|
||||
width: 1 height: 1000 computeByteSize: 4999
|
||||
width: 1 height: 1000000 computeByteSize: 4999999
|
||||
width: 1000 height: 1 computeByteSize: 4000
|
||||
width: 1000 height: 1000 computeByteSize: 4999000
|
||||
width: 1000 height: 1000000 computeByteSize: 4999999000
|
||||
width: 1000000 height: 1 computeByteSize: 4000000
|
||||
width: 1000000 height: 1000 computeByteSize: 4999000000
|
||||
width: 1000000 height: 1000000 computeByteSize: 4999999000000
|
||||
~~~~
|
||||
|
||||
</fiddle-embed></div>
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_getSize64">getSize64</a> <a href="#SkPixmap_getSafeSize64">getSafeSize64</a> <a href="#SkPixmap_height">height</a> <a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a> <a href="undocumented#sk_64_isS32">sk 64 isS32</a>
|
||||
<a href="#SkImageInfo_computeByteSize">SkImageInfo::computeByteSize</a>
|
||||
|
||||
---
|
||||
|
||||
@ -902,7 +889,7 @@ Returns false for <a href="undocumented#SkColorType">kUnknown SkColorType</a>.
|
||||
|
||||
### Return Value
|
||||
|
||||
true all pixels have opaque values or <a href="undocumented#Color_Type">Color Type</a> is opaque
|
||||
true if all pixels have opaque values or <a href="undocumented#Color_Type">Color Type</a> is opaque
|
||||
|
||||
### Example
|
||||
|
||||
@ -990,10 +977,13 @@ Unpremultiplied:
|
||||
const void* addr(int x, int y) const
|
||||
</pre>
|
||||
|
||||
Returns readable pixel address at (<a href="#SkPixmap_addr_2_x">x</a>, <a href="#SkPixmap_addr_2_y">y</a>).
|
||||
Returns readable pixel address at (<a href="#SkPixmap_addr_2_x">x</a>, <a href="#SkPixmap_addr_2_y">y</a>). Returns nullptr if <a href="undocumented#Pixel_Ref">Pixel Ref</a> is nullptr.
|
||||
|
||||
Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr_2_x">x</a> or <a href="#SkPixmap_addr_2_y">y</a> trigger an assert() if
|
||||
built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. Returns zero if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>.
|
||||
built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined. Returns nullptr if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>.
|
||||
|
||||
Performs a lookup of pixel size; for better performance, call
|
||||
one of: <a href="#SkPixmap_addr8">addr8</a>, <a href="#SkPixmap_addr16">addr16</a>, <a href="#SkPixmap_addr32">addr32</a>, <a href="#SkPixmap_addr64">addr64</a>, or <a href="#SkPixmap_addrF16">addrF16</a>.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -1022,7 +1012,7 @@ pixmap.addr(1, 2) == &storage[1 + 2 * w]
|
||||
|
||||
### See Also
|
||||
|
||||
<a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a>
|
||||
<a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addr64">addr64</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkBitmap_getAddr">SkBitmap::getAddr</a>
|
||||
|
||||
---
|
||||
|
||||
@ -1521,7 +1511,7 @@ writable unsigned 8-bit pointer to pixels
|
||||
|
||||
### Example
|
||||
|
||||
<div><fiddle-embed name="809284db136748208b3efc31cd89de29"><div>Altering pixels after drawing <a href="undocumented#Bitmap">Bitmap</a> is not guaranteed to affect subsequent
|
||||
<div><fiddle-embed name="809284db136748208b3efc31cd89de29"><div>Altering pixels after drawing <a href="SkBitmap_Reference#Bitmap">Bitmap</a> is not guaranteed to affect subsequent
|
||||
drawing on all platforms. Adding a second <a href="#SkBitmap_installPixels">SkBitmap::installPixels</a> after editing
|
||||
pixel memory is safer.</div></fiddle-embed></div>
|
||||
|
||||
@ -1689,7 +1679,7 @@ bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
|
||||
int srcX, int srcY, SkTransferFunctionBehavior behavior) const
|
||||
</pre>
|
||||
|
||||
Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_srcX">srcX</a>, <a href="#SkPixmap_readPixels_srcY">srcY</a>), and does not exceed(this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>).
|
||||
Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_srcX">srcX</a>, <a href="#SkPixmap_readPixels_srcY">srcY</a>), and does not exceed(this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>).
|
||||
|
||||
<a href="#SkPixmap_readPixels_dstInfo">dstInfo</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, and
|
||||
<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_dstRowBytes">dstRowBytes</a> specifics the gap from one destination
|
||||
@ -1709,7 +1699,7 @@ or ifabs(srcY) >= this-><a href="#SkPixmap_height">height</a>.
|
||||
If <a href="#SkPixmap_readPixels_behavior">behavior</a> is <a href="#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>: converts source
|
||||
pixels to a linear space before converting to <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.
|
||||
If <a href="#SkPixmap_readPixels_behavior">behavior</a> is <a href="#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a>: source
|
||||
pixels are treated as if they are linear, regardless of their encoding.
|
||||
pixels are treated as if they are linear, regardless of how they are encoded.
|
||||
|
||||
### Parameters
|
||||
|
||||
@ -1747,7 +1737,7 @@ true if pixels are copied to <a href="#SkPixmap_readPixels_dstPixels">dstPixels<
|
||||
bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const
|
||||
</pre>
|
||||
|
||||
Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_2_dstPixels">dstPixels</a>. Copy starts at (0, 0), and does not
|
||||
Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_2_dstPixels">dstPixels</a>. Copy starts at (0, 0), and does not
|
||||
exceed(this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>).
|
||||
|
||||
<a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, and
|
||||
@ -1795,7 +1785,7 @@ bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
|
||||
int srcX, int srcY) const
|
||||
</pre>
|
||||
|
||||
Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_3_srcX">srcX</a>, <a href="#SkPixmap_readPixels_3_srcY">srcY</a>), and does not
|
||||
Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixels</a>. Copy starts at (<a href="#SkPixmap_readPixels_3_srcX">srcX</a>, <a href="#SkPixmap_readPixels_3_srcY">srcY</a>), and does not
|
||||
exceed(this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>).
|
||||
|
||||
<a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>, <a href="undocumented#Alpha_Type">Alpha Type</a>, and
|
||||
@ -1846,7 +1836,7 @@ true if pixels are copied to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixel
|
||||
bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
|
||||
</pre>
|
||||
|
||||
Copies a <a href="undocumented#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_4_dst">dst</a>. Copy starts at (<a href="#SkPixmap_readPixels_4_srcX">srcX</a>, <a href="#SkPixmap_readPixels_4_srcY">srcY</a>), and does not
|
||||
Copies a <a href="SkRect_Reference#Rect">Rect</a> of pixels to <a href="#SkPixmap_readPixels_4_dst">dst</a>. Copy starts at (<a href="#SkPixmap_readPixels_4_srcX">srcX</a>, <a href="#SkPixmap_readPixels_4_srcY">srcY</a>), and does not
|
||||
exceed (this-><a href="#SkPixmap_width">width</a>, this-><a href="#SkPixmap_height">height</a>). <a href="#SkPixmap_readPixels_4_dst">dst</a> specifies <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#Color_Type">Color Type</a>,
|
||||
<a href="undocumented#Alpha_Type">Alpha Type</a>, and <a href="undocumented#Color_Space">Color Space</a> of destination. Returns true if pixels are copied.
|
||||
Returns false if <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is less than
|
||||
@ -1993,7 +1983,7 @@ not intersect <a href="#SkPixmap_bounds">bounds</a>.
|
||||
<table> <tr> <td><a name="SkPixmap_erase_color"> <code><strong>color </strong></code> </a></td> <td>
|
||||
<a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a> to write</td>
|
||||
</tr> <tr> <td><a name="SkPixmap_erase_subset"> <code><strong>subset </strong></code> </a></td> <td>
|
||||
bounding integer <a href="undocumented#Rect">Rect</a> of written pixels</td>
|
||||
bounding integer <a href="SkRect_Reference#Rect">Rect</a> of written pixels</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -2054,7 +2044,7 @@ not intersect <a href="#SkPixmap_bounds">bounds</a>, or if <a href="#SkPixmap_er
|
||||
<table> <tr> <td><a name="SkPixmap_erase_3_color"> <code><strong>color </strong></code> </a></td> <td>
|
||||
<a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a> to write</td>
|
||||
</tr> <tr> <td><a name="SkPixmap_erase_3_subset"> <code><strong>subset </strong></code> </a></td> <td>
|
||||
bounding integer <a href="undocumented#Rect">Rect</a> of pixels to write; may be nullptr</td>
|
||||
bounding integer <a href="SkRect_Reference#Rect">Rect</a> of pixels to write; may be nullptr</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
@ -3,8 +3,6 @@ undocumented
|
||||
|
||||
# <a name="Glyph"></a> Glyph
|
||||
|
||||
# <a name="Curve"></a> Curve
|
||||
|
||||
# <a name="Document"></a> Document
|
||||
|
||||
# <a name="SkDocument"></a> Class SkDocument
|
||||
@ -21,41 +19,18 @@ SkCanvas* beginPage(SkScalar width, SkScalar height,
|
||||
|
||||
## <a name="PDF"></a> PDF
|
||||
|
||||
# <a name="PostScript"></a> PostScript
|
||||
|
||||
## <a name="Arct"></a> Arct
|
||||
|
||||
# <a name="Size"></a> Size
|
||||
|
||||
# <a name="Arc"></a> Arc
|
||||
|
||||
# <a name="Rect"></a> Rect
|
||||
|
||||
# <a name="SkRect"></a> Struct SkRect
|
||||
|
||||
<a name="SkRect_MakeEmpty"></a>
|
||||
## MakeEmpty
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
static constexpr SkRect SK_WARN_UNUSED_RESULT MakeEmpty()
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkRect_dump"></a>
|
||||
## dump
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void dump() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkRect_dumpHex"></a>
|
||||
## dumpHex
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void dumpHex() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
# <a name="Line"></a> Line
|
||||
|
||||
# <a name="Mip_Map"></a> Mip Map
|
||||
|
||||
# <a name="Region"></a> Region
|
||||
|
||||
# <a name="SkRegion"></a> Class SkRegion
|
||||
@ -68,6 +43,10 @@ void dumpHex() const
|
||||
|
||||
# <a name="SkVector"></a> Struct SkVector
|
||||
|
||||
# <a name="Patch"></a> Patch
|
||||
|
||||
# <a name="Curve"></a> Curve
|
||||
|
||||
# <a name="Point"></a> Point
|
||||
|
||||
# <a name="SkPoint"></a> Struct SkPoint
|
||||
@ -83,8 +62,6 @@ bool equalsWithinTolerance(const SkPoint& p) const
|
||||
|
||||
## <a name="Array"></a> Array
|
||||
|
||||
# <a name="Patch"></a> Patch
|
||||
|
||||
# <a name="Typeface"></a> Typeface
|
||||
|
||||
# <a name="SkTypeface"></a> Class SkTypeface
|
||||
@ -105,40 +82,6 @@ bool equalsWithinTolerance(const SkPoint& p) const
|
||||
|
||||
# <a name="SkBBHFactory"></a> Class SkBBHFactory
|
||||
|
||||
# <a name="Bitmap"></a> Bitmap
|
||||
|
||||
# <a name="SkBitmap"></a> Class SkBitmap
|
||||
|
||||
## <a name="Row_Bytes"></a> Row Bytes
|
||||
|
||||
<a name="SkBitmap_erase"></a>
|
||||
## erase
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void erase(SkColor c, const SkIRect& area) const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkBitmap_installPixels"></a>
|
||||
## installPixels
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
bool installPixels(const SkImageInfo& info, void* pixels, size_t rowBytes)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkBitmap_readPixels"></a>
|
||||
## readPixels
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
|
||||
int srcX, int srcY, SkTransferFunctionBehavior behavior) const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
# <a name="Blend_Mode"></a> Blend Mode
|
||||
|
||||
## <a name="SkBlendMode"></a> Enum SkBlendMode
|
||||
@ -271,7 +214,7 @@ int SkColorSetARGB(a, r, g, b)
|
||||
## MakeSRGBLinear
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
static sk_sp<SkColorSpace> MakeSRGBLinear()
|
||||
static sk_sp<SkColorSpace> MakeSRGBLinear()
|
||||
</pre>
|
||||
|
||||
---
|
||||
@ -329,8 +272,8 @@ void draw(SkCanvas*, const SkMatrix* = NULL)
|
||||
## MakeCanvas
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
static std::unique_ptr<SkCanvas>
|
||||
MakeCanvas(std::unique_ptr<SkRasterHandleAllocator>,
|
||||
static std::unique_ptr<SkCanvas>
|
||||
MakeCanvas(std::unique_ptr<SkRasterHandleAllocator>,
|
||||
const SkImageInfo&,
|
||||
const Rec* rec = nullptr)
|
||||
</pre>
|
||||
@ -469,7 +412,7 @@ SkImageInfo()
|
||||
## makeColorSpace
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
|
||||
SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
|
||||
</pre>
|
||||
|
||||
---
|
||||
@ -501,13 +444,79 @@ int bytesPerPixel() const
|
||||
|
||||
---
|
||||
|
||||
<a name="SkImageInfo_height"></a>
|
||||
## height
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
int height() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkImageInfo_width"></a>
|
||||
## width
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
int width() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkImageInfo_colorType"></a>
|
||||
## colorType
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkColorType colorType() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkImageInfo_alphaType"></a>
|
||||
## alphaType
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkAlphaType alphaType() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkImageInfo_colorSpace"></a>
|
||||
## colorSpace
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkColorSpace* colorSpace() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
bool isOpaque() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
size_t minRowBytes() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkImageInfo_computeByteSize"></a>
|
||||
## computeByteSize
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
size_t computeByteSize(size_t rowBytes) const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
# <a name="SkImage"></a> Class SkImage
|
||||
|
||||
<a name="SkImage_makeShader"></a>
|
||||
## makeShader
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
|
||||
sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
|
||||
const SkMatrix* localMatrix = nullptr) const
|
||||
</pre>
|
||||
|
||||
@ -517,7 +526,7 @@ sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
|
||||
## MakeRasterCopy
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
static sk_sp<SkImage> MakeRasterCopy(const SkPixmap&)
|
||||
static sk_sp<SkImage> MakeRasterCopy(const SkPixmap&)
|
||||
</pre>
|
||||
|
||||
---
|
||||
@ -550,15 +559,24 @@ bool scalePixels(const SkPixmap& dst, SkFilterQuality,
|
||||
|
||||
# <a name="Image_Scaling"></a> Image Scaling
|
||||
|
||||
# <a name="IRect"></a> IRect
|
||||
# <a name="Malloc_Pixel_Ref"></a> Malloc Pixel Ref
|
||||
|
||||
# <a name="SkIRect"></a> Struct SkIRect
|
||||
# <a name="SkMallocPixelRef"></a> Class SkMallocPixelRef
|
||||
|
||||
<a name="SkIRect_intersect"></a>
|
||||
## intersect
|
||||
<a name="SkMallocPixelRef_MakeZeroed"></a>
|
||||
## MakeZeroed
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
bool intersect(const SkIRect& r)
|
||||
static sk_sp<SkPixelRef> MakeZeroed(const SkImageInfo&, size_t rowBytes)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkMallocPixelRef_MakeAllocate"></a>
|
||||
## MakeAllocate
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
static sk_sp<SkPixelRef> MakeAllocate(const SkImageInfo&, size_t rowBytes)
|
||||
</pre>
|
||||
|
||||
---
|
||||
@ -596,6 +614,16 @@ k <tr>
|
||||
|
||||
# <a name="SkMaskFilter"></a> Class SkMaskFilter
|
||||
|
||||
<a name="SkMaskFilter_filterMask"></a>
|
||||
## filterMask
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix&,
|
||||
SkIPoint* margin) const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
# <a name="Math"></a> Math
|
||||
|
||||
<a name="sk_64_isS32"></a>
|
||||
@ -607,9 +635,59 @@ static inline bool sk_64_isS32(int64_t value)
|
||||
|
||||
---
|
||||
|
||||
# <a name="Matrix"></a> Matrix
|
||||
<a name="SkIntToScalar"></a>
|
||||
## SkIntToScalar
|
||||
|
||||
# <a name="SkMatrix"></a> Struct SkMatrix
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkIntToScalar(x)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkScalarRoundToInt"></a>
|
||||
## SkScalarRoundToInt
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkScalarRoundToInt(x)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkScalarFloorToInt"></a>
|
||||
## SkScalarFloorToInt
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkScalarFloorToInt(x)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkScalarCeilToInt"></a>
|
||||
## SkScalarCeilToInt
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkScalarCeilToInt(x)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkScalarFloorToScalar"></a>
|
||||
## SkScalarFloorToScalar
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkScalarFloorToScalar(x)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkScalarCeilToScalar"></a>
|
||||
## SkScalarCeilToScalar
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
SkScalarCeilToScalar(x)
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
# <a name="Nine_Patch"></a> Nine Patch
|
||||
|
||||
@ -701,13 +779,45 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL,
|
||||
|
||||
## <a name="Storage"></a> Storage
|
||||
|
||||
# <a name="PixelRef"></a> PixelRef
|
||||
# <a name="Pixel_Ref"></a> Pixel Ref
|
||||
|
||||
# <a name="SkPixelRef"></a> Class SkPixelRef
|
||||
|
||||
# <a name="PostScript"></a> PostScript
|
||||
<a name="SkPixelRef_width"></a>
|
||||
## width
|
||||
|
||||
## <a name="Arct"></a> Arct
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
int width() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkPixelRef_height"></a>
|
||||
## height
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
int height() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkPixelRef_isImmutable"></a>
|
||||
## isImmutable
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
bool isImmutable() const
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<a name="SkPixelRef_setImmutable"></a>
|
||||
## setImmutable
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
void setImmutable()
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
# <a name="Premultiply"></a> Premultiply
|
||||
|
||||
@ -723,6 +833,8 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL,
|
||||
|
||||
# <a name="Reference_Count"></a> Reference Count
|
||||
|
||||
# <a name="SkRefCnt"></a> Class SkRefCnt
|
||||
|
||||
# <a name="sk_sp"></a> Class sk_sp
|
||||
|
||||
# <a name="Right_Side_Bearing"></a> Right Side Bearing
|
||||
@ -772,7 +884,7 @@ void dumpHex() const
|
||||
## MakeBitmapShader
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
static sk_sp<SkShader> MakeBitmapShader(const SkBitmap& src, TileMode tmx,
|
||||
static sk_sp<SkShader> MakeBitmapShader(const SkBitmap& src, TileMode tmx,
|
||||
TileMode tmy,
|
||||
const SkMatrix* localMatrix = nullptr)
|
||||
</pre>
|
||||
@ -801,7 +913,7 @@ static sk_sp<SkShader> MakeBitmapShader(const SkBitmap& src, TileMode tmx,
|
||||
## MakeRasterDirect
|
||||
|
||||
<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
|
||||
static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo&, void* pixels,
|
||||
static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo&, void* pixels,
|
||||
size_t rowBytes,
|
||||
const SkSurfaceProps* = nullptr)
|
||||
</pre>
|
||||
|
@ -10,6 +10,18 @@
|
||||
#include "SkOSFile.h"
|
||||
#include "SkOSPath.h"
|
||||
|
||||
DEFINE_string2(bmh, b, "", "Path to a *.bmh file or a directory.");
|
||||
DEFINE_string2(examples, e, "", "File of fiddlecli input, usually fiddle.json (For now, disables -r -f -s)");
|
||||
DEFINE_string2(fiddle, f, "", "File of fiddlecli output, usually fiddleout.json.");
|
||||
DEFINE_string2(include, i, "", "Path to a *.h file or a directory.");
|
||||
DEFINE_bool2(hack, k, false, "Do a find/replace hack to update all *.bmh files. (Requires -b)");
|
||||
DEFINE_bool2(stdout, o, false, "Write file out to standard out.");
|
||||
DEFINE_bool2(populate, p, false, "Populate include from bmh. (Requires -b -i)");
|
||||
DEFINE_string2(ref, r, "", "Resolve refs and write bmh_*.md files to path. (Requires -b)");
|
||||
DEFINE_string2(spellcheck, s, "", "Spell-check [once, all, mispelling]. (Requires -b)");
|
||||
DEFINE_string2(tokens, t, "", "Directory to write bmh from include. (Requires -i)");
|
||||
DEFINE_bool2(crosscheck, x, false, "Check bmh against includes. (Requires -b -i)");
|
||||
DEFINE_bool2(skip, z, false, "Skip missing example error.");
|
||||
|
||||
/* recipe for generating timestamps for existing doxygen comments
|
||||
find include/core -type f -name '*.h' -print -exec git blame {} \; > ~/all.blame.txt
|
||||
@ -118,6 +130,17 @@ void Definition::setCanonicalFiddle() {
|
||||
SkASSERT('=' == fName[opPos + 1]);
|
||||
result += "equal_operator";
|
||||
}
|
||||
} else if ('[' == fName[opPos]) {
|
||||
result += "subscript_operator";
|
||||
const char* end = fContentStart;
|
||||
while (end > fStart && ' ' >= end[-1]) {
|
||||
--end;
|
||||
}
|
||||
string constCheck(fStart, end - fStart);
|
||||
size_t constPos = constCheck.rfind("const");
|
||||
if (constCheck.length() == constPos + 5) {
|
||||
result += "_const";
|
||||
}
|
||||
} else {
|
||||
SkASSERT(0); // todo: incomplete
|
||||
}
|
||||
@ -331,7 +354,8 @@ bool Definition::checkMethod() const {
|
||||
methodParser.skipName("#Method");
|
||||
methodParser.skipSpace();
|
||||
string name = this->methodName();
|
||||
if (MethodType::kNone == fMethodType && "()" == name.substr(name.length() - 2)) {
|
||||
if (MethodType::kNone == fMethodType && name.length() > 2 &&
|
||||
"()" == name.substr(name.length() - 2)) {
|
||||
name = name.substr(0, name.length() - 2);
|
||||
}
|
||||
bool expectReturn = this->methodHasReturn(name, &methodParser);
|
||||
@ -366,6 +390,9 @@ bool Definition::checkMethod() const {
|
||||
string paramName;
|
||||
methodParser.fChar = nextEnd + 1;
|
||||
methodParser.skipSpace();
|
||||
if (1494 == methodParser.fLineCount) {
|
||||
SkDebugf("");
|
||||
}
|
||||
if (!this->nextMethodParam(&methodParser, &nextEnd, ¶mName)) {
|
||||
continue;
|
||||
}
|
||||
@ -663,11 +690,29 @@ string Definition::methodName() const {
|
||||
|
||||
bool Definition::nextMethodParam(TextParser* methodParser, const char** nextEndPtr,
|
||||
string* paramName) const {
|
||||
*nextEndPtr = methodParser->anyOf(",)");
|
||||
const char* nextEnd = *nextEndPtr;
|
||||
if (!nextEnd) {
|
||||
return methodParser->reportError<bool>("#Method function missing close paren");
|
||||
int parenCount = 0;
|
||||
TextParser::Save saveState(methodParser);
|
||||
while (true) {
|
||||
if (methodParser->eof()) {
|
||||
return methodParser->reportError<bool>("#Method function missing close paren");
|
||||
}
|
||||
char ch = methodParser->peek();
|
||||
if ('(' == ch) {
|
||||
++parenCount;
|
||||
}
|
||||
if (parenCount == 0 && (')' == ch || ',' == ch)) {
|
||||
*nextEndPtr = methodParser->fChar;
|
||||
break;
|
||||
}
|
||||
if (')' == ch) {
|
||||
if (0 > --parenCount) {
|
||||
return this->reportError<bool>("mismatched parentheses");
|
||||
}
|
||||
}
|
||||
methodParser->next();
|
||||
}
|
||||
saveState.restore();
|
||||
const char* nextEnd = *nextEndPtr;
|
||||
const char* paramEnd = nextEnd;
|
||||
const char* assign = methodParser->strnstr(" = ", paramEnd);
|
||||
if (assign) {
|
||||
@ -684,6 +729,10 @@ bool Definition::nextMethodParam(TextParser* methodParser, const char** nextEndP
|
||||
}
|
||||
}
|
||||
}
|
||||
const char* function = methodParser->strnstr(")(", paramEnd);
|
||||
if (function) {
|
||||
paramEnd = function;
|
||||
}
|
||||
while (paramEnd > methodParser->fChar && ' ' == paramEnd[-1]) {
|
||||
--paramEnd;
|
||||
}
|
||||
@ -1071,7 +1120,9 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
|
||||
if (definition->fChildren.size() == 0) {
|
||||
TextParser emptyCheck(definition);
|
||||
if (emptyCheck.eof() || !emptyCheck.skipWhiteSpace()) {
|
||||
return this->reportError<bool>("missing example body");
|
||||
if (!FLAGS_skip) {
|
||||
return this->reportError<bool>("missing example body");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2141,18 +2192,6 @@ string BmhParser::word(const string& prefix, const string& delimiter) {
|
||||
// pass one: parse text, collect definitions
|
||||
// pass two: lookup references
|
||||
|
||||
DEFINE_string2(bmh, b, "", "Path to a *.bmh file or a directory.");
|
||||
DEFINE_string2(examples, e, "", "File of fiddlecli input, usually fiddle.json (For now, disables -r -f -s)");
|
||||
DEFINE_string2(fiddle, f, "", "File of fiddlecli output, usually fiddleout.json.");
|
||||
DEFINE_string2(include, i, "", "Path to a *.h file or a directory.");
|
||||
DEFINE_bool2(hack, k, false, "Do a find/replace hack to update all *.bmh files. (Requires -b)");
|
||||
DEFINE_bool2(stdout, o, false, "Write file out to standard out.");
|
||||
DEFINE_bool2(populate, p, false, "Populate include from bmh. (Requires -b -i)");
|
||||
DEFINE_string2(ref, r, "", "Resolve refs and write bmh_*.md files to path. (Requires -b)");
|
||||
DEFINE_string2(spellcheck, s, "", "Spell-check [once, all, mispelling]. (Requires -b)");
|
||||
DEFINE_string2(tokens, t, "", "Directory to write bmh from include. (Requires -i)");
|
||||
DEFINE_bool2(crosscheck, x, false, "Check bmh against includes. (Requires -b -i)");
|
||||
|
||||
static int count_children(const Definition& def, MarkType markType) {
|
||||
int count = 0;
|
||||
if (markType == def.fMarkType) {
|
||||
|
@ -14,6 +14,20 @@ static void add_ref(const string& leadingSpaces, const string& ref, string* resu
|
||||
*result += leadingSpaces + ref;
|
||||
}
|
||||
|
||||
static string preformat(const string& orig) {
|
||||
string result;
|
||||
for (auto c : orig) {
|
||||
if ('<' == c) {
|
||||
result += "<";
|
||||
} else if ('>' == c) {
|
||||
result += ">";
|
||||
} else {
|
||||
result += c;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// FIXME: preserve inter-line spaces and don't add new ones
|
||||
string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
BmhParser::Resolvable resolvable) {
|
||||
@ -149,7 +163,7 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
|
||||
if (('f' != ref[0] && string::npos == ref.find("()"))
|
||||
// || '.' != t.backup(ref.c_str())
|
||||
&& ('k' != ref[0] && string::npos == ref.find("_Private"))) {
|
||||
if ('.' == wordStart[0] && distFromParam == 1) {
|
||||
if ('.' == wordStart[0] && (distFromParam >= 1 && distFromParam <= 16)) {
|
||||
const Definition* paramType = this->findParamType();
|
||||
if (paramType) {
|
||||
string fullName = paramType->fName + "::" + ref;
|
||||
@ -756,10 +770,11 @@ void MdOut::markTypeOut(Definition* def) {
|
||||
// TODO: put in css spec that we can define somewhere else (if markup supports that)
|
||||
// TODO: 50em below should match limt = 80 in formatFunction()
|
||||
this->writePending();
|
||||
string preformattedStr = preformat(formattedStr);
|
||||
fprintf(fOut, "<pre style=\"padding: 1em 1em 1em 1em;"
|
||||
"width: 50em; background-color: #f0f0f0\">\n"
|
||||
"%s\n"
|
||||
"</pre>", formattedStr.c_str());
|
||||
"</pre>", preformattedStr.c_str());
|
||||
this->lf(2);
|
||||
fTableState = TableState::kNone;
|
||||
fMethod = def;
|
||||
|
@ -579,7 +579,8 @@ void SpellCheck::wordCheck(const string& str) {
|
||||
hasColon |= isColon;
|
||||
bool isDot = '.' == ch;
|
||||
hasDot |= isDot;
|
||||
bool isParen = '(' == ch || ')' == ch || '~' == ch || '=' == ch || '!' == ch;
|
||||
bool isParen = '(' == ch || ')' == ch || '~' == ch || '=' == ch || '!' == ch ||
|
||||
'[' == ch || ']' == ch;
|
||||
hasParen |= isParen;
|
||||
bool isUnderscore = '_' == ch;
|
||||
hasUnderscore |= isUnderscore;
|
||||
@ -594,6 +595,7 @@ void SpellCheck::wordCheck(const string& str) {
|
||||
sawSpecial = true;
|
||||
continue;
|
||||
}
|
||||
SkDebugf("");
|
||||
SkASSERT(0);
|
||||
}
|
||||
if (sawSpecial && !hasParen) {
|
||||
|
Loading…
Reference in New Issue
Block a user