From 947326638a25d321981cc6f7ec0bf992273b884b Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 12 Mar 2018 08:09:48 -0400 Subject: 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 Reviewed-by: Cary Clark --- site/user/api/SkCanvas_Reference.md | 63 +++++++++++++++++++++++++++++++++---- site/user/api/undocumented.md | 4 +++ 2 files changed, 61 insertions(+), 6 deletions(-) (limited to 'site/user') 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 Canvas has direct access to its pixels. Pixels are readable when Device is raster. Pixels are not readable when Canvas is returned from GPU Surface, returned by SkDocument::beginPage, returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility class -like +like SkDebugCanvas. + +pixmap is valid only while Canvas is in scope and unchanged. Any +Canvas or Surface call may invalidate the pixmap values. ### Parameters @@ -983,7 +986,17 @@ converting to dstInfo.colorType() and Pixels are readable when Device is raster, or backed by a GPU. Pixels are not readable when SkCanvas is returned by SkDocument::beginPage, returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility -class like +class like SkDebugCanvas. + +The destination pixel storage must be allocated by the caller. + +Pixel values are converted only if Color Type and Alpha Type +do not match. Only pixels within both source and destination rectangles +are copied. dstPixels contents outside Rect intersection are unchanged. + +Pass negative values for srcX or srcY to offset pixels across or down destination. + +Does not copy, and returns false if: @@ -1059,7 +1072,17 @@ converting to pixmap.colorType() and Pixels are readable when Device is raster, or backed by a GPU. Pixels are not readable when SkCanvas is returned by SkDocument::beginPage, returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility -class like +class like SkDebugCanvas. + +Caller must allocate pixel storage in pixmap if needed. + +Pixel values are converted only if Color Type and Alpha Type +do not match. Only pixels within both source and destination Rects +are copied. pixmap pixels contents outside Rect intersection are unchanged. + +Pass negative values for srcX or srcY to offset pixels across or down pixmap. + +Does not copy, and returns false if:
Source and destination rectangles do not intersect.
@@ -1122,7 +1145,17 @@ converting to bitmap.colorType() and Pixels are readable when Device is raster, or backed by a GPU. Pixels are not readable when SkCanvas is returned by SkDocument::beginPage, returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility -class like +class like SkDebugCanvas. + +Caller must allocate pixel storage in bitmap if needed. + +Bitmap values are converted only if Color Type and Alpha Type +do not match. Only pixels within both source and destination rectangles +are copied. Bitmap pixels outside Rect intersection are unchanged. + +Pass negative values for srcX or srcY to offset pixels across or down bitmap. + +Does not copy, and returns false if:
Source and destination rectangles do not intersect.
@@ -1186,7 +1219,16 @@ converting to imageInfo.colorType() and Pixels are writable when Device is raster, or backed by a GPU. Pixels are not writable when SkCanvas is returned by SkDocument::beginPage, returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility -class like +class like SkDebugCanvas. + +Pixel values are converted only if Color Type and Alpha Type +do not match. Only pixels within both source and destination rectangles +are copied. Canvaspixels outside Rect intersection are unchanged. + +Pass negative values for x or y to offset pixels to the left or +above Canvaspixels. + +Does not copy, and returns false if:
Source and destination rectangles do not intersect.
@@ -1243,7 +1285,16 @@ converting to imageInfo.colorType() and Pixels are writable when Device is raster, or backed by a GPU. Pixels are not writable when SkCanvas is returned by SkDocument::beginPage, returned by SkPictureRecorder::beginRecording, or Canvas is the base of a utility -class like +class like SkDebugCanvas. + +Pixel values are converted only if Color Type and Alpha Type +do not match. Only pixels within both source and destination rectangles +are copied. Canvas pixels outside Rect intersection are unchanged. + +Pass negative values for x or y to offset pixels to the left or +above Canvas pixels. + +Does not copy, and returns false if:
Source and destination rectangles do not intersect.
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<SkCanvas> SK_API SkCreateColorSpaceXformCanvas(SkCanvas* t # Class SkData +# Debug Canvas + +# Class SkDebugCanvas + # Debugging -- cgit v1.2.3
Source and destination rectangles do not intersect.