aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/user
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-03-12 08:09:48 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-12 12:28:58 +0000
commit947326638a25d321981cc6f7ec0bf992273b884b (patch)
tree60710991793759a962957685aa5e92683efd2498 /site/user
parentef9b793386752198ee30bae6b1869298c77366d6 (diff)
add SkDebugCanvas to undocumented
SkDumpCanvas was replaced by SkDebugCanvas as an undefined reference, but SkDumpCanvas was not added to undocumented.bmh and caused bookmaker to generate a broken version of site/user/api/SkCanva_Reference.md The Skia-Commit-Bot detected that the SkCanvas_Reference.md was changed, and checked it in, causing the online version of SkCanvas like https://skia.org/user/api/SkCanvas_Reference#SkCanvas_readPixels to be truncated. I assume there is a mistake in bookmaker where it wrote an error to stdout but failed to abort the tool when the *.md file was partially written. I'll look into that. This CL adds SkDebugCanvas to undocumented.bmh to fix the documentation. TBR=brianosman@google.com,rmistry@google.com Docs-Preview: https://skia.org/?cl=113700 Bug: skia:6898 Change-Id: Ib4e32eea3e56c178d0016f8ae392e28aab5ffafa Reviewed-on: https://skia-review.googlesource.com/113700 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'site/user')
-rw-r--r--site/user/api/SkCanvas_Reference.md63
-rw-r--r--site/user/api/undocumented.md4
2 files changed, 61 insertions, 6 deletions
diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md
index dc4d3fe027..908fbaf524 100644
--- a/site/user/api/SkCanvas_Reference.md
+++ b/site/user/api/SkCanvas_Reference.md
@@ -934,7 +934,10 @@ Returns true if <a href="#Canvas">Canvas</a> has direct access to its pixels.
<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster. <a href="#Pixels">Pixels</a> are not readable when <a href="#Canvas">Canvas</a>
is returned from <a href="undocumented#GPU_Surface">GPU Surface</a>, returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>, returned by
<a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility class
-like
+like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>.
+
+<a href="#SkCanvas_peekPixels_pixmap">pixmap</a> is valid only while <a href="#Canvas">Canvas</a> is in scope and unchanged. Any
+<a href="#Canvas">Canvas</a> or <a href="SkSurface_Reference#Surface">Surface</a> call may invalidate the <a href="#SkCanvas_peekPixels_pixmap">pixmap</a> values.
### Parameters
@@ -983,7 +986,17 @@ converting to <a href="#SkCanvas_readPixels_dstInfo">dstInfo</a>.colorType() and
<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU.
<a href="#Pixels">Pixels</a> are not readable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>,
returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility
-class like
+class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>.
+
+The destination pixel storage must be allocated by the caller.
+
+<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>
+do not match. Only pixels within both source and destination rectangles
+are copied. <a href="#SkCanvas_readPixels_dstPixels">dstPixels</a> contents outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged.
+
+Pass negative values for <a href="#SkCanvas_readPixels_srcX">srcX</a> or <a href="#SkCanvas_readPixels_srcY">srcY</a> to offset pixels across or down destination.
+
+Does not copy, and returns false if:
<table> <tr>
<td>Source and destination rectangles do not intersect.</td> </tr> <tr>
@@ -1059,7 +1072,17 @@ converting to <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.colorType() and
<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU.
<a href="#Pixels">Pixels</a> are not readable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>,
returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility
-class like
+class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>.
+
+Caller must allocate pixel storage in <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a> if needed.
+
+<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>
+do not match. Only pixels within both source and destination <a href="SkRect_Reference#Rect">Rects</a>
+are copied. <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a> pixels contents outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged.
+
+Pass negative values for <a href="#SkCanvas_readPixels_2_srcX">srcX</a> or <a href="#SkCanvas_readPixels_2_srcY">srcY</a> to offset pixels across or down <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.
+
+Does not copy, and returns false if:
<table> <tr>
<td>Source and destination rectangles do not intersect.</td> </tr> <tr>
@@ -1122,7 +1145,17 @@ converting to <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.colorType() and
<a href="#Pixels">Pixels</a> are readable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU.
<a href="#Pixels">Pixels</a> are not readable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>,
returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility
-class like
+class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>.
+
+Caller must allocate pixel storage in <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a> if needed.
+
+<a href="SkBitmap_Reference#Bitmap">Bitmap</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>
+do not match. Only pixels within both source and destination rectangles
+are copied. <a href="SkBitmap_Reference#Bitmap">Bitmap</a> pixels outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged.
+
+Pass negative values for <a href="#SkCanvas_readPixels_3_srcX">srcX</a> or <a href="#SkCanvas_readPixels_3_srcY">srcY</a> to offset pixels across or down <a href="#SkCanvas_readPixels_3_bitmap">bitmap</a>.
+
+Does not copy, and returns false if:
<table> <tr>
<td>Source and destination rectangles do not intersect.</td> </tr> <tr>
@@ -1186,7 +1219,16 @@ converting to <a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() and <a hre
<a href="#Pixels">Pixels</a> are writable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU.
<a href="#Pixels">Pixels</a> are not writable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>,
returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility
-class like
+class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>.
+
+<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>
+do not match. Only <a href="#SkCanvas_writePixels_pixels">pixels</a> within both source and destination rectangles
+are copied. <a href="#Canvas">Canvas</a> <a href="#SkCanvas_writePixels_pixels">pixels</a> outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged.
+
+Pass negative values for <a href="#SkCanvas_writePixels_x">x</a> or <a href="#SkCanvas_writePixels_y">y</a> to offset <a href="#SkCanvas_writePixels_pixels">pixels</a> to the left or
+above <a href="#Canvas">Canvas</a> <a href="#SkCanvas_writePixels_pixels">pixels</a>.
+
+Does not copy, and returns false if:
<table> <tr>
<td>Source and destination rectangles do not intersect.</td> </tr> <tr>
@@ -1243,7 +1285,16 @@ converting to <a href="#SkCanvas_imageInfo">imageInfo</a>.colorType() and <a hre
<a href="#Pixels">Pixels</a> are writable when <a href="undocumented#Device">Device</a> is raster, or backed by a GPU.
<a href="#Pixels">Pixels</a> are not writable when <a href="#SkCanvas">SkCanvas</a> is returned by <a href="undocumented#SkDocument_beginPage">SkDocument::beginPage</a>,
returned by <a href="undocumented#SkPictureRecorder_beginRecording">SkPictureRecorder::beginRecording</a>, or <a href="#Canvas">Canvas</a> is the base of a utility
-class like
+class like <a href="undocumented#SkDebugCanvas">SkDebugCanvas</a>.
+
+<a href="undocumented#Pixel">Pixel</a> values are converted only if <a href="SkImageInfo_Reference#Color_Type">Color Type</a> and <a href="SkImageInfo_Reference#Alpha_Type">Alpha Type</a>
+do not match. Only pixels within both source and destination rectangles
+are copied. <a href="#Canvas">Canvas</a> pixels outside <a href="SkRect_Reference#Rect">Rect</a> intersection are unchanged.
+
+Pass negative values for <a href="#SkCanvas_writePixels_2_x">x</a> or <a href="#SkCanvas_writePixels_2_y">y</a> to offset pixels to the left or
+above <a href="#Canvas">Canvas</a> pixels.
+
+Does not copy, and returns false if:
<table> <tr>
<td>Source and destination rectangles do not intersect.</td> </tr> <tr>
diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md
index ca53526d05..f7ccf2bb37 100644
--- a/site/user/api/undocumented.md
+++ b/site/user/api/undocumented.md
@@ -208,6 +208,10 @@ std::unique_ptr&lt;SkCanvas&gt; SK_API SkCreateColorSpaceXformCanvas(SkCanvas* t
# <a name="SkData"></a> Class SkData
+# <a name="Debug_Canvas"></a> Debug Canvas
+
+# <a name="SkDebugCanvas"></a> Class SkDebugCanvas
+
# <a name="Debugging"></a> Debugging
<a name="SkDebugf"></a>