From 5635631c8887db678e6123c191ae68456b60d2a7 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 8 Feb 2018 14:45:18 -0500 Subject: working on SkImage docs also fix minor break in SkSurface TBR=caryclark@google.com Docs-Preview: https://skia.org/?cl=105021 Bug: skia: Change-Id: I0cfc01ab5ba4df13a9e84f8dd2904d32e5726a5b Reviewed-on: https://skia-review.googlesource.com/105021 Reviewed-by: Cary Clark Commit-Queue: Cary Clark --- site/user/api/SkSurface_Reference.md | 83 ++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 4 deletions(-) (limited to 'site/user/api/SkSurface_Reference.md') diff --git a/site/user/api/SkSurface_Reference.md b/site/user/api/SkSurface_Reference.md index a3b675e180..3cc14e973d 100644 --- a/site/user/api/SkSurface_Reference.md +++ b/site/user/api/SkSurface_Reference.md @@ -61,6 +61,7 @@ of the requested dimensions are zero, then nullptr will be returned. | readPixels | copies Rect of pixels | | wait | rause commands until signaled | | width | returns pixel column count | +| writePixels | copies Rect of pixels | ## Constructor @@ -1396,6 +1397,9 @@ are not captured. Image allocation is acco | | readPixels(const SkPixmap& dst, int srcX, int srcY) | | | readPixels(const SkImageInfo& dstInfo, void* dstPixels, size t dstRowBytes, int srcX, int srcY) | | | readPixels(const SkBitmap& dst, int srcX, int srcY) | +| writePixels | copies Rect of pixels | +| | writePixels(const SkPixmap& src, int dstX, int dstY) | +| | writePixels(const SkBitmap& src, int dstX, int dstY) | ## draw @@ -1463,7 +1467,7 @@ true if Surface has direct access to pixels ### See Also -readPixels[2][3] +readPixels[2][3] writePixels[2] --- @@ -1520,7 +1524,7 @@ true if pixels were copied ### See Also -peekPixels +peekPixels writePixels[2] --- @@ -1582,7 +1586,7 @@ The copied quarter ovals overdraw the original oval. ### See Also -peekPixels +peekPixels writePixels[2] --- @@ -1639,7 +1643,78 @@ true if pixels were copied ### See Also -peekPixels +peekPixels writePixels[2] + +--- + + +## writePixels + +
+void writePixels(const SkPixmap& src, int dstX, int dstY)
+
+ +Copies Rect of pixels from the src Pixmap to the Surface. + +Source Rect corners are (0, 0) and (src.width, src.height). +Destination Rect corners are (dstX, dstY) and(dstX + Surface width, dstY + Surface height). + +Copies each readable pixel intersecting both rectangles, without scaling, +converting to Surface colorType() and Surface alphaType() if required. + +### Parameters + + + + + +
src +storage for pixels to copy to Surface
dstX +x position relative to Surface to begin copy; may be negative
dstY +x position relative to Surface to begin copy; may be negative
+ +### Example + +
+ +### See Also + +readPixels[2][3] peekPixels + +--- + + + +
+void writePixels(const SkBitmap& src, int dstX, int dstY)
+
+ +Copies Rect of pixels from the src Bitmap to the Surface. + +Source Rect corners are (0, 0) and (src.width, src.height). +Destination Rect corners are (dstX, dstY) and(dstX + Surface width, dstY + Surface height). + +Copies each readable pixel intersecting both rectangles, without scaling, +converting to Surface colorType() and Surface alphaType() if required. + +### Parameters + + + + + +
src +storage for pixels to copy to Surface
dstX +x position relative to Surface to begin copy; may be negative
dstY +x position relative to Surface to begin copy; may be negative
+ +### Example + +
+ +### See Also + +readPixels[2][3] peekPixels --- -- cgit v1.2.3