aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2017-09-14 11:25:39 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-14 16:05:21 +0000
commitd0530ba8f406ef287ce89a995ce7be4b32ab6e85 (patch)
tree4a4f575d252e68364d041a4a67ee38739e7b5e1b
parentd29f0e7ccb84993562f34f2d8e3933a19a3ed676 (diff)
wip pixmap docs
wip pixmap docs Docs-Preview: https://skia.org/?cl=42522 Bug: skia: 6898 Change-Id: I85947bc36ea057ed008b87d7bef2efa82d7c89ad Reviewed-on: https://skia-review.googlesource.com/42522 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
-rw-r--r--docs/SkCanvas_Reference.bmh53
-rw-r--r--docs/SkPaint_Reference.bmh32
-rw-r--r--docs/SkPixmap_Reference.bmh2040
-rw-r--r--docs/undocumented.bmh89
-rw-r--r--docs/usingBookmaker.bmh35
-rw-r--r--site/user/api/SkCanvas_Reference.md34
-rw-r--r--site/user/api/SkPaint_Reference.md32
-rw-r--r--site/user/api/SkPixmap_Reference.md2066
-rw-r--r--site/user/api/index.md3
-rw-r--r--site/user/api/undocumented.md203
-rw-r--r--site/user/api/usingBookmaker.md35
-rw-r--r--tools/bookmaker/bookmaker.cpp59
-rw-r--r--tools/bookmaker/bookmaker.h95
-rw-r--r--tools/bookmaker/fiddleParser.cpp18
-rw-r--r--tools/bookmaker/includeParser.cpp45
-rw-r--r--tools/bookmaker/includeWriter.cpp95
-rw-r--r--tools/bookmaker/mdOut.cpp50
-rw-r--r--tools/bookmaker/spellCheck.cpp67
18 files changed, 4794 insertions, 257 deletions
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index 632c7c1260..ae351421a5 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -95,7 +95,7 @@ when no Surface is required, and some helpers implicitly create Raster_Surface.
# drawArc # Draws Arc using Clip, Matrix, and Paint.##
# drawAtlas # Draws sprites using Clip, Matrix, and Paint.##
# drawBitmap # Draws Bitmap at (x, y) position. ##
-# drawBitmapLattice # Draws differentially stretched Bitmap. ##
+# drawBitmapLattice # Draws proportionally stretched Bitmap. ##
# drawBitmapNine # Draws Nine_Patch Bitmap. ##
# drawBitmapRect # Draws Bitmap, source Rect to destination Rect. ##
# drawCircle # Draws Circle using Clip, Matrix, and Paint. ##
@@ -104,7 +104,7 @@ when no Surface is required, and some helpers implicitly create Raster_Surface.
# drawDrawable # Draws Drawable, encapsulated drawing commands. ##
# drawIRect # Draws IRect using Clip, Matrix, and Paint. ##
# drawImage # Draws Image at (x, y) position. ##
-# drawImageLattice # Draws differentially stretched Image. ##
+# drawImageLattice # Draws proportionally stretched Image. ##
# drawImageNine # Draws Nine_Patch Image. ##
# drawImageRect # Draws Image, source Rect to destination Rect. ##
# drawLine # Draws line segment between two points.##
@@ -314,10 +314,10 @@ void draw(SkCanvas* ) {
#Method SkCanvas()
-Creates an empty canvas with no backing device or pixels, with
+Creates an empty Canvas with no backing device or pixels, with
a width and height of zero.
-#Return empty canvas ##
+#Return empty Canvas ##
#Example
@@ -369,11 +369,11 @@ void draw(SkCanvas* canvas) {
Creates Canvas of the specified dimensions without a Surface.
Used by Subclasses with custom implementations for draw methods.
-If props equals nullptr, Surface_Properties are created with Surface_Properties_Legacy_Font_Host settings,
-which choose the pixel striping direction and order. Since a platform may dynamically
-change its direction when the device is rotated, and since a platform may have
-multiple monitors with different characteristics, it's best not to rely on this
-legacy behavior.
+If props equals nullptr, Surface_Properties are created with
+Surface_Properties_Legacy_Font_Host settings, which choose the pixel striping
+direction and order. Since a platform may dynamically change its direction when
+the device is rotated, and since a platform may have multiple monitors with
+different characteristics, it is best not to rely on this legacy behavior.
#Param width zero or greater ##
#Param height zero or greater ##
@@ -465,16 +465,16 @@ The actual output depends on the installed fonts.
}
#StdOut
- -----
- ---x-
- ---x-
- ---x-
- ---x-
- ---x-
- ---x-
- -----
- ---x-
- ---x-
+ -----
+ ---x-
+ ---x-
+ ---x-
+ ---x-
+ ---x-
+ ---x-
+ -----
+ ---x-
+ ---x-
-----
#StdOut ##
##
@@ -1252,7 +1252,7 @@ this->imageInfo.alphaType()
#Param info width, height, Image_Color_Type, and Image_Alpha_Type of pixels ##
#Param pixels pixels to copy, of size info.height() times rowBytes, or larger ##
-#Param rowBytes size of one pixels row; info.width() times pixel size, or larger ##
+#Param rowBytes size of one row of pixels; info.width() times pixel size, or larger ##
#Param x offset into Canvas writable pixels in x; may be negative ##
#Param y offset into Canvas writable pixels in y; may be negative ##
@@ -1551,6 +1551,7 @@ depth = 1
# ------------------------------------------------------------------------------
#Topic Layer
+#Substitute layer
#Alias Layers
Layer allocates a temporary Bitmap to draw into. When the drawing is
@@ -3118,7 +3119,7 @@ void draw(SkCanvas* canvas) {
enum PointMode {
kPoints_PointMode,
kLines_PointMode,
- kPolygon_PointMode
+ kPolygon_PointMode,
};
##
@@ -4284,7 +4285,7 @@ void draw(SkCanvas* canvas) {
#Method void drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst,
const SkPaint* paint = nullptr)
-Draw Image image stretched differentially to fit into Rect dst.
+Draw Image image stretched proportionally to fit into Rect dst.
IRect center divides the image into nine sections: four sides, four corners, and
the center. Corners are unmodified or scaled down proportionately if their sides
are larger than dst; center and four sides are scaled to fit remaining space, if any.
@@ -4350,7 +4351,7 @@ void draw(SkCanvas* canvas) {
#Method void drawImageNine(const sk_sp<SkImage>& image, const SkIRect& center, const SkRect& dst,
const SkPaint* paint = nullptr)
-Draw Image image stretched differentially to fit into Rect dst.
+Draw Image image stretched proportionally to fit into Rect dst.
IRect center divides the image into nine sections: four sides, four corners, and
the center. Corners are not scaled, or scaled down proportionately if their sides
are larger than dst; center and four sides are scaled to fit remaining space, if any.
@@ -4635,7 +4636,7 @@ void draw(SkCanvas* canvas) {
#Method void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
const SkPaint* paint = nullptr)
-Draw Bitmap bitmap stretched differentially to fit into Rect dst.
+Draw Bitmap bitmap stretched proportionally to fit into Rect dst.
IRect center divides the bitmap into nine sections: four sides, four corners,
and the center. Corners are not scaled, or scaled down proportionately if their
sides are larger than dst; center and four sides are scaled to fit remaining
@@ -4783,7 +4784,7 @@ void draw(SkCanvas* canvas) {
#Method void drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, const SkRect& dst,
const SkPaint* paint = nullptr)
-Draw Bitmap bitmap stretched differentially to fit into Rect dst.
+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
@@ -4860,7 +4861,7 @@ void draw(SkCanvas* canvas) {
#Method void drawImageLattice(const SkImage* image, const Lattice& lattice, const SkRect& dst,
const SkPaint* paint = nullptr)
-Draw Image image stretched differentially to fit into Rect dst.
+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
diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh
index 30007f185a..0b80bf7e07 100644
--- a/docs/SkPaint_Reference.bmh
+++ b/docs/SkPaint_Reference.bmh
@@ -348,7 +348,7 @@ This prevents objects with Reference_Count from being modified once Paint refers
#Method SkPaint(SkPaint&& paint)
- Implements a move constructor to avoid incrementing the reference counts
+ Implements a move constructor to avoid increasing the reference counts
of objects referenced by the paint.
After the call, paint is undefined, and can be safely destructed.
@@ -443,7 +443,7 @@ are increased by one. paint is unmodified.
#Method SkPaint& operator=(SkPaint&& paint)
-Moves the paint to avoid incrementing the reference counts
+Moves the paint to avoid increasing the reference counts
of objects referenced by the paint parameter. Objects containing Reference_Count in the
prior destination are decreased by one; those objects are deleted if the resulting count
is zero.
@@ -1178,7 +1178,7 @@ kLCDRenderText_Flag or kSubpixelText_Flag (or both) at compile time.
Linear_Text selects whether text is rendered as a Glyph or as a Path.
If kLinearText_Flag is set, it has the same effect as setting Hinting to kNormal_Hinting.
-If kLinearText_Flag is clear, it's the same as setting Hinting to kNo_Hinting.
+If kLinearText_Flag is clear, it is the same as setting Hinting to kNo_Hinting.
#Method bool isLinearText() const
@@ -2838,7 +2838,7 @@ void draw(SkCanvas* canvas) {
Optional colors used when filling a path, such as a gradient.
- Sets Shader to shader, decrementing Reference_Count of the previous Shader.
+ Sets Shader to shader, decreasing Reference_Count of the previous Shader.
Does not alter shader Reference_Count.
#Param shader how geometry is filled with color; if nullptr, Color is used instead ##
@@ -2930,7 +2930,7 @@ void draw(SkCanvas* canvas) {
#Method void setColorFilter(sk_sp<SkColorFilter> colorFilter)
- Sets Color_Filter to filter, decrementing Reference_Count of the previous Color_Filter.
+ Sets Color_Filter to filter, decreasing Reference_Count of the previous Color_Filter.
Pass nullptr to clear Color_Filter.
Does not alter filter Reference_Count.
@@ -3120,7 +3120,7 @@ If Paint has no Path_Effect, the path geometry is unaltered when filled or strok
#Method void setPathEffect(sk_sp<SkPathEffect> pathEffect)
Sets Path_Effect to pathEffect,
- decrementing Reference_Count of the previous Path_Effect.
+ decreasing Reference_Count of the previous Path_Effect.
Pass nullptr to leave the path geometry unaltered.
Does not alter pathEffect Reference_Count.
@@ -3204,7 +3204,7 @@ Set Mask_Filter to nullptr to prevent Mask_Filter from modifying the draw.
#Method void setMaskFilter(sk_sp<SkMaskFilter> maskFilter)
Sets Mask_Filter to maskFilter,
- decrementing Reference_Count of the previous Mask_Filter.
+ decreasing Reference_Count of the previous Mask_Filter.
Pass nullptr to clear Mask_Filter and leave Mask_Filter effect on Mask_Alpha unaltered.
Does not affect Rasterizer.
Does not alter maskFilter Reference_Count.
@@ -3299,7 +3299,7 @@ implementation.
#Method void setTypeface(sk_sp<SkTypeface> typeface)
Sets Typeface to typeface,
- decrementing Reference_Count of the previous Typeface.
+ decreasing Reference_Count of the previous Typeface.
Pass nullptr to clear Typeface and use the default typeface.
Does not alter typeface Reference_Count.
@@ -3416,7 +3416,7 @@ Path, and Text.
#Method void setRasterizer(sk_sp<SkRasterizer> rasterizer)
Sets Rasterizer to rasterizer,
- decrementing Reference_Count of the previous Rasterizer.
+ decreasing Reference_Count of the previous Rasterizer.
Pass nullptr to clear Rasterizer and leave Rasterizer effect on Mask_Alpha unaltered.
Does not affect Mask_Filter.
Does not alter rasterizer Reference_Count.
@@ -3521,7 +3521,7 @@ Mask_Filter and Rasterizer.
#Method void setImageFilter(sk_sp<SkImageFilter> imageFilter)
Sets Image_Filter to imageFilter,
- decrementing Reference_Count of the previous Image_Filter.
+ decreasing Reference_Count of the previous Image_Filter.
Pass nullptr to clear Image_Filter, and remove Image_Filter effect
on drawing.
Does not affect Rasterizer or Mask_Filter.
@@ -3642,7 +3642,7 @@ Deprecated.
#Method void setDrawLooper(sk_sp<SkDrawLooper> drawLooper)
Sets Draw_Looper to drawLooper,
- decrementing Reference_Count of the previous drawLooper.
+ decreasing Reference_Count of the previous drawLooper.
Pass nullptr to clear Draw_Looper and leave Draw_Looper effect on drawing unaltered.
Does not alter drawLooper Reference_Count.
@@ -4000,11 +4000,11 @@ All character encoding 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 ## is made up of 8-bit bytes,
-and is a superset of ASCII.
-#A UTF-16 (RFC 2781) # https://tools.ietf.org/html/rfc2781 ## is made up of 16-bit words,
-and is a superset of Unicode ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF.
-#A UTF-32 # http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf ## is
-made up of 32-bit words, and is a superset of Unicode.
+and encodes ASCII in one byte, and all valid code points in Unicode in multiple bytes.
+#A UTF-16 (RFC 2781) # https://tools.ietf.org/html/rfc2781 ## uses one or two 16-bit words,
+and encodes Unicode ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF in one word.
+#A UTF-32 # http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf ## describes
+a 32-bit word, which encodes all code points in Unicode.
Font_Manager uses font data to convert character code points into glyph indices.
A glyph index is a 16-bit word.
diff --git a/docs/SkPixmap_Reference.bmh b/docs/SkPixmap_Reference.bmh
new file mode 100644
index 0000000000..83f350252c
--- /dev/null
+++ b/docs/SkPixmap_Reference.bmh
@@ -0,0 +1,2040 @@
+#Topic Pixmap
+
+#Class SkPixmap
+
+Pixmap provides a utility to pair SkImageInfo with pixels and row bytes.
+Pixmap is a low level class which provides convenience functions to access
+raster destinations. Canvas can not draw Pixmap, nor does Pixmap provide
+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.
+
+#Topic Overview
+
+#Subtopic Subtopics
+#Table
+#Legend
+# topics # description ##
+#Legend ##
+# Image_Info_Access # Returns all or part of Image_Info. ##
+# Initialization # Sets fields for use. ##
+# Reader # Examine pixel value. ##
+# Writer # Copy to pixel values. ##
+# Readable_Address # Returns read only pixels. ##
+# Writable_Address # Returns writable pixels. ##
+#Table ##
+#Subtopic ##
+
+#Subtopic Constructors
+#Table
+#Legend
+# # description ##
+#Legend ##
+# SkPixmap() # Constructs with default values. ##
+# SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes) # Constructs from Image_Info, pixels. ##
+#Table ##
+#Subtopic ##
+
+#Subtopic Member_Functions
+#Table
+#Legend
+# function # description ##
+#Legend ##
+# addr() # Returns readable pixel address as void pointer. ##
+# addr16 # Returns readable pixel address as 16-bit pointer. ##
+# addr32 # Returns readable pixel address as 32-bit pointer. ##
+# addr64 # Returns readable pixel address as 64-bit pointer. ##
+# addr8 # Returns readable pixel address as 8-bit pointer. ##
+# addrF16 # Returns readable pixel component address as 16-bit pointer. ##
+# alphaType # Returns Image_Info Alpha_Type. ##
+# bounds() # Returns width and height as Rectangle. ##
+# colorSpace # Returns Image_Info Color_Space. ##
+# colorType # Returns Image_Info Color_Type. ##
+# computeIsOpaque # Returns true if all pixels are opaque. ##
+# erase() # Writes Color to pixels. ##
+# extractSubset # Sets pointer to portion of original. ##
+# getColor # Returns one pixel as Unpremultiplied Color. ##
+# getSafeSize # Returns minimum size required for pixels in 32 bits. ##
+# getSafeSize64 # Returns minimum size required for pixels in 64 bits. ##
+# getSize64 # Returns conservative size required for pixels. ##
+# height() # Returns pixel row count. ##
+# info() # Returns Image_Info. ##
+# isOpaque # Returns true if Image_Info describes opaque pixels. ##
+# readPixels # Copies and converts pixels. ##
+# reset() # Reuses existing Pixmap with replacement values. ##
+# rowBytes # Returns interval between rows in bytes. ##
+# rowBytesAsPixels # Returns interval between rows in pixels. ##
+# scalePixels # Scales and converts pixels. ##
+# setColorSpace # Sets Image_Info Color_Space. ##
+# shiftPerPixel # Returns bit shift from pixels to bytes. ##
+# width() # Returns pixel column count. ##
+# writable_addr # Returns writable pixel address as void pointer. ##
+# writable_addr16 # Returns writable pixel address as 16-bit pointer. ##
+# writable_addr32 # Returns writable pixel address as 32-bit pointer. ##
+# writable_addr64 # Returns writable pixel address as 64-bit pointer. ##
+# writable_addr8 # Returns writable pixel address as 8-bit pointer. ##
+# writable_addrF16 # Returns writable pixel component address as 16-bit pointer. ##
+#Table ##
+#Subtopic ##
+
+#Topic Overview ##
+
+#Subtopic Initialization
+
+# ------------------------------------------------------------------------------
+
+#Method SkPixmap()
+
+Creates an empty Pixmap without pixels, with kUnknown_SkColorType, with
+kUnknown_SkAlphaType, and with a width and height of zero. Use
+reset() to associate pixels, SkColorType, SkAlphaType, width, and height
+after Pixmap has been created.
+
+#Return empty Pixmap ##
+
+#Example
+void draw(SkCanvas* canvas) {
+ const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
+ const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444", "RGBA_8888", "BGRA_8888",
+ "Gray_8", "RGBA_F16"};
+ SkPixmap pixmap;
+ for (int i = 0; i < 2; ++i) {
+ SkDebugf("width: %2d height: %2d", pixmap.width(), pixmap.height());
+ SkDebugf(" color: k%s_SkColorType", colors[pixmap.colorType()]);
+ SkDebugf(" alpha: k%s_SkAlphaType\n", alphas[pixmap.alphaType()]);
+ pixmap.reset(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),
+ nullptr, 0);
+ }
+}
+#StdOut
+width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType
+width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType
+##
+##
+
+#SeeAlso SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes) reset() SkAlphaType SkColorType
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes)
+
+Creates Pixmap from info width, height, SkAlphaType, and SkColorType.
+addr points to pixels, or nullptr. rowBytes should be
+#Formula
+info.width() * info.bytesPerPixel()
+##
+or larger.
+
+No parameter checking is performed; it is up to the caller to ensure that
+addr and rowBytes agree with info.
+
+The memory lifetime pixels are managed by the caller. When Pixmap goes
+out of scope, addr is unaffected.
+
+Pixmap may be later modified by reset() to change its size, pixel type, or
+storage.
+
+#Param info width, height, SkAlphaType, SkColorType of Image_Info ##
+#Param addr pointer to pixels allocated by caller; may be nullptr ##
+#Param rowBytes size of one row of addr; width times pixel size, or larger ##
+
+#Return initialized Pixmap ##
+
+#Example
+#Image 3
+#Description
+SkImage::MakeRasterCopy takes const SkPixmap& as an argument. The example
+constructs a SkPixmap from the brace-delimited parameters.
+##
+ SkDebugf("image alpha only = %s\n", image->isAlphaOnly() ? "true" : "false");
+ SkPMColor pmColors = 0;
+ sk_sp<SkImage> copy = SkImage::MakeRasterCopy({SkImageInfo::MakeA8(1, 1),
+ (uint8_t*)&pmColors,
+ 1});
+ SkDebugf("copy alpha only = %s\n", copy->isAlphaOnly() ? "true" : "false");
+#StdOut
+image alpha only = false
+copy alpha only = true
+##
+##
+
+#SeeAlso SkPixmap() reset() SkAlphaType SkColorType
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method void reset()
+
+Sets width, height, row bytes to zero; pixel address to nullptr; SkColorType to
+kUnknown_SkColorType; and SkAlphaType to kUnknown_SkAlphaType.
+
+The prior pixels are unaffected; it is up to the caller to release pixels
+memory if desired.
+
+#Example
+void draw(SkCanvas* canvas) {
+ const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
+ const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444", "RGBA_8888", "BGRA_8888",
+ "Gray_8", "RGBA_F16"};
+ SkPixmap pixmap(SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType),
+ nullptr, 0);
+ for (int i = 0; i < 2; ++i) {
+ SkDebugf("width: %2d height: %2d", pixmap.width(), pixmap.height());
+ SkDebugf(" color: k%s_SkColorType", colors[pixmap.colorType()]);
+ SkDebugf(" alpha: k%s_SkAlphaType\n", alphas[pixmap.alphaType()]);
+ pixmap.reset();
+ }
+}
+#StdOut
+width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType
+width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType
+##
+##
+
+#SeeAlso SkPixmap() SkAlphaType SkColorType
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method void reset(const SkImageInfo& info, const void* addr, size_t rowBytes)
+
+Sets width, height, SkAlphaType, and SkColorType from info.
+Sets pixel address from addr, which may be nullptr.
+Sets row bytes from rowBytes, which should be
+#Formula
+info.width() * info.bytesPerPixel()
+##
+or larger.
+
+Does not check addr. Asserts if built with SK_DEBUG defined and if rowBytes is
+too small to hold one row of pixels.
+
+The memory lifetime pixels are managed by the caller. When Pixmap goes
+out of scope, addr is unaffected.
+
+#Param info width, height, SkAlphaType, SkColorType of Image_Info ##
+#Param addr pointer to pixels allocated by caller; may be nullptr ##
+#Param rowBytes size of one row of addr; width times pixel size, or larger ##
+
+#Example
+#Image 4
+#Height 128
+void draw(SkCanvas* canvas) {
+ std::vector<int32_t> pixels;
+ pixels.resize(image->height() * image->width() * 4);
+ SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,
+ image->alphaType()), (const void*) &pixels.front(), image->width() * 4);
+ image->readPixels(pixmap, 0, 0);
+ int x = 0;
+ for (auto colorType : { kRGBA_8888_SkColorType, kBGRA_8888_SkColorType } ) {
+ pixmap.reset(SkImageInfo::Make(image->width(), image->height(), colorType,
+ image->alphaType()), (const void*) &pixels.front(), image->width() * 4);
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, x, 0);
+ x += 128;
+ }
+}
+##
+
+#SeeAlso SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes) reset() SkAlphaType SkColorType
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method void setColorSpace(sk_sp<SkColorSpace> colorSpace)
+
+
+Changes Color_Space in Image_Info; preserves width, height, SkAlphaType, and
+SkColorType in Image, and leaves pixel address and row bytes unchanged.
+colorSpace reference count is incremented.
+
+#Param colorSpace Color_Space moved to Image_Info ##
+
+#Example
+void draw(SkCanvas* canvas) {
+ SkPixmap pixmap;
+ sk_sp<SkColorSpace> colorSpace1 = SkColorSpace::MakeRGB(SkColorSpace::kLinear_RenderTargetGamma,
+ SkColorSpace::kRec2020_Gamut);
+ SkDebugf("is %sunique\n", colorSpace1->unique() ? "" : "not ");
+ pixmap.setColorSpace(colorSpace1);
+ SkDebugf("is %sunique\n", colorSpace1->unique() ? "" : "not ");
+}
+#StdOut
+is unique
+is not unique
+##
+##
+
+#SeeAlso Color_Space SkImageInfo::makeColorSpace
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT reset(const SkMask& mask)
+
+Sets width, height, pixel address, and row bytes to Mask properties, if Mask
+format is SkMask::kA8_Format; and returns true. Otherwise sets width, height,
+row bytes to zero; pixel address to nullptr; SkColorType to kUnknown_SkColorType;
+and SkAlphaType to kUnknown_SkAlphaType; and returns false.
+
+Failing to read the return value generates a compile time warning.
+
+#Param mask Mask containing pixels and dimensions ##
+
+#Return true if set to Mask properties ##
+
+#Example
+ const int width = 2;
+ const int height = 2;
+ uint8_t bytes[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ SkMask mask;
+ mask.fFormat = SkMask::kA8_Format;
+ mask.fBounds = {0, 0, width, height};
+ mask.fImage = bytes;
+ mask.fRowBytes = (width + 7) >> 3;
+ SkPixmap pixmap;
+ bool success = pixmap.reset(mask);
+ SkDebugf("success: %s width: %d height: %d\n", success ? "true " : "false",
+ pixmap.width(), pixmap.height());
+ mask.fFormat = SkMask::kBW_Format;
+ success = pixmap.reset(mask);
+ SkDebugf("success: %s width: %d height: %d\n", success ? "true " : "false",
+ pixmap.width(), pixmap.height());
+#StdOut
+success: true width: 2 height: 2
+success: false width: 0 height: 0
+##
+##
+
+#SeeAlso Mask reset()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool SK_WARN_UNUSED_RESULT extractSubset(SkPixmap* subset, const SkIRect& area) const
+
+Sets subset width, height, pixel address to intersection of Pixmap with area,
+if intersection is not empty; and return true. Otherwise, leave subset unchanged
+and return false.
+
+Failing to read the return value generates a compile time warning.
+
+#Param subset storage for width, height, pixel address of intersection ##
+#Param area bounds to intersect with Pixmap ##
+
+#Return true if intersection of Pixmap and area is not empty ##
+
+#Example
+#Image 3
+#Height 128
+void draw(SkCanvas* canvas) {
+ std::vector<int32_t> pixels;
+ pixels.resize(image->height() * image->width() * 4);
+ SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,
+ image->alphaType()), (const void*) &pixels.front(), image->width() * 4);
+ image->readPixels(pixmap, 0, 0);
+ SkPixmap inset;
+ if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) {
+ SkBitmap bitmap;
+ bitmap.installPixels(inset);
+ canvas->drawBitmap(bitmap, 0, 0);
+ }
+}
+##
+
+#SeeAlso reset() SkIRect::intersect
+
+##
+
+#Subtopic Initialization ##
+
+#Subtopic Image_Info_Access
+
+# ------------------------------------------------------------------------------
+
+#Method const SkImageInfo& info() const
+
+Returns width, height, SkAlphaType, and SkColorType.
+
+#Return reference to ImageInfo ##
+
+#Example
+#Image 3
+ std::vector<int32_t> pixels;
+ pixels.resize(image->height() * image->width() * 4);
+ SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,
+ image->alphaType()), (const void*) &pixels.front(), image->width() * 4);
+ image->readPixels(pixmap, 0, 0);
+ SkPixmap inset;
+ if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) {
+ const SkImageInfo& info = inset.info();
+ const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
+ const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
+ "RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
+ SkDebugf("width: %d height: %d color: %s alpha: %s\n", info.width(), info.height(),
+ colors[info.colorType()], alphas[info.alphaType()]);
+ }
+#StdOut
+width: 384 height: 384 color: BGRA_8888 alpha: Opaque
+##
+##
+
+#SeeAlso Image_Info
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t rowBytes() const
+
+Returns row bytes, the interval from one pixel row to the next. Row bytes
+is at least as large as
+#Formula
+width() * info().bytesPerPixel()
+##
+.
+
+It is up to the Pixmap creator to ensure that row bytes is a useful value.
+
+#Return byte length of pixel row ##
+
+#Example
+SkPixmap badPixmap = {SkImageInfo::MakeA8(4, 4), nullptr, 2};
+SkPixmap okPixmap = {SkImageInfo::MakeA8(4, 4), nullptr, 8};
+for (auto& pixmap : { badPixmap, okPixmap } ) {
+ SkDebugf("rowBytes: %d minRowBytes: %d\n", pixmap.rowBytes(),
+ pixmap.info().minRowBytes());
+}
+#StdOut
+rowBytes: 2 minRowBytes: 4
+rowBytes: 8 minRowBytes: 4
+##
+##
+
+#SeeAlso addr() info() SkImageInfo::minRowBytes
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const void* addr() const
+
+Returns pixel address, the base corresponding the pixel origin.
+
+It is up to the Pixmap creator to ensure that pixel address is a useful value.
+
+#Return pixel address ##
+
+#Example
+#Image 3
+ std::vector<int32_t> pixels;
+ pixels.resize(image->height() * image->width() * 4);
+ SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,
+ image->alphaType()), (const void*) &pixels.front(), image->width() * 4);
+ image->readPixels(pixmap, 0, 0);
+ SkDebugf("pixels address: 0x%llx\n", pixmap.addr());
+ SkPixmap inset;
+ if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) {
+ SkDebugf("inset address: 0x%llx\n", inset.addr());
+ }
+#StdOut
+#Volatile
+pixels address: 0x7f2a440bb010
+inset address: 0x7f2a440fb210
+##
+##
+
+#SeeAlso addr(int x, int y) addr8 addr16 addr32 addr64 info() rowBytes()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method int width() const
+
+Returns pixel count in each pixel row. Should be equal or less than:
+#Formula
+rowBytes() / info.bytesPerPixel()
+##
+.
+
+#Return pixel width in Image_Info ##
+
+#Example
+ SkImageInfo info = SkImageInfo::MakeA8(16, 32);
+ SkPixmap pixmap(info, nullptr, 64);
+ SkDebugf("pixmap width: %d info width: %d\n", pixmap.width(), info.width());
+#StdOut
+pixmap width: 16 info width: 16
+##
+##
+
+#SeeAlso height()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method int height() const
+
+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());
+#StdOut
+pixmap height: 32 info height: 32
+##
+##
+
+#SeeAlso width()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkColorType colorType() const
+
+Returns Color_Type, one of: kUnknown_SkColorType, kAlpha_8_SkColorType,
+kRGB_565_SkColorType, kARGB_4444_SkColorType, kRGBA_8888_SkColorType,
+kBGRA_8888_SkColorType, kGray_8_SkColorType, kRGBA_F16_SkColorType.
+
+#Return Color_Type in Image_Info ##
+
+#Example
+ const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
+ "RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
+ SkPixmap pixmap(SkImageInfo::MakeA8(16, 32), nullptr, 64);
+ SkDebugf("color type: k" "%s" "_SkColorType\n", colors[pixmap.colorType()]);
+#StdOut
+color type: kAlpha_SkColorType
+##
+##
+
+#SeeAlso alphaType()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkAlphaType alphaType() const
+
+Returns Alpha_Type, one of: kUnknown_SkAlphaType, kOpaque_SkAlphaType,
+kPremul_SkAlphaType, kUnpremul_SkAlphaType.
+
+#Return Alpha_Type in Image_Info ##
+
+#Example
+ const char* alphas[] = {"Unknown", "Opaque", "Premul", "Unpremul"};
+ SkPixmap pixmap(SkImageInfo::MakeA8(16, 32), nullptr, 64);
+ SkDebugf("alpha type: k" "%s" "_SkAlphaType\n", alphas[pixmap.alphaType()]);
+#StdOut
+alpha type: kPremul_SkAlphaType
+##
+##
+
+#SeeAlso colorType()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkColorSpace* colorSpace() const
+
+Returns Color_Space associated with Image_Info.
+
+#Return Color_Space in Image_Info ##
+
+#Example
+#Description
+SkColorSpace::MakeSRGBLinear creates Color_Space with linear gamma
+and an sRGB gamut. This Color_Space gamma is not close to sRGB gamma.
+##
+ SkPixmap pixmap(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
+ SkColorSpace::MakeSRGBLinear()), nullptr, 64);
+ SkColorSpace* colorSpace = pixmap.colorSpace();
+ SkDebugf("gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\n",
+ colorSpace->gammaCloseToSRGB() ? "true" : "false",
+ colorSpace->gammaIsLinear() ? "true" : "false",
+ colorSpace->isSRGB() ? "true" : "false");
+#StdOut
+gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
+##
+##
+
+#SeeAlso Color_Space
+
+##
+
+# ------------------------------------------------------------------------------
+
+#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.
+
+#Return true if Image_Info has opaque Alpha_Type ##
+
+#Example
+#Description
+ isOpaque ignores whether all pixels are opaque or not.
+##
+ std::vector<uint32_t> pixels;
+ const int height = 2;
+ const int width = 2;
+ pixels.resize(height * width * 4);
+ SkPixmap pixmap(SkImageInfo::Make(width, height, kN32_SkColorType,
+ kPremul_SkAlphaType), (const void*) &pixels.front(), width * 4);
+ for (int index = 0; index < 2; ++index) {
+ pixmap.erase(0x00000000);
+ SkDebugf("isOpaque: %s\n", pixmap.isOpaque() ? "true" : "false");
+ pixmap.erase(0xFFFFFFFF);
+ SkDebugf("isOpaque: %s\n", pixmap.isOpaque() ? "true" : "false");
+ pixmap.reset(pixmap.info().makeAlphaType(kOpaque_SkAlphaType),
+ (const void*) &pixels.front(), width * 4);
+ }
+#StdOut
+isOpaque: false
+isOpaque: false
+isOpaque: true
+isOpaque: true
+##
+##
+
+#SeeAlso computeIsOpaque SkImageInfo::isOpaque
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkIRect bounds() const
+
+Returns IRect
+#Formula
+{ 0, 0, width(), height() }
+##
+.
+
+#Return integral rectangle from origin to width() and height() ##
+
+#Example
+ for (int width : { 0, 2 } ) {
+ for (int height : { 0, 2 } ) {
+ SkPixmap pixmap(SkImageInfo::MakeA8(width, height), nullptr, width);
+ SkDebugf("width: %d height: %d empty: %s\n", width, height,
+ pixmap.bounds().isEmpty() ? "true" : "false");
+ }
+ }
+#StdOut
+width: 0 height: 0 empty: true
+width: 0 height: 2 empty: true
+width: 2 height: 0 empty: true
+width: 2 height: 2 empty: false
+##
+##
+
+#SeeAlso height() width() IRect
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method int rowBytesAsPixels() const
+
+
+Returns number of pixels that fit on row. Should be greater than or equal to
+width().
+
+#Return maximum pixels per row ##
+
+#Example
+ for (int rowBytes : { 4, 5, 6, 7, 8} ) {
+ SkPixmap pixmap(SkImageInfo::MakeN32(1, 1, kPremul_SkAlphaType), nullptr, rowBytes);
+ SkDebugf("rowBytes: %d rowBytesAsPixels: %d\n", rowBytes, pixmap.rowBytesAsPixels());
+ }
+#StdOut
+rowBytes: 4 rowBytesAsPixels: 1
+rowBytes: 5 rowBytesAsPixels: 1
+rowBytes: 6 rowBytesAsPixels: 1
+rowBytes: 7 rowBytesAsPixels: 1
+rowBytes: 8 rowBytesAsPixels: 2
+##
+##
+
+#SeeAlso rowBytes shiftPerPixel width SkImageInfo::bytesPerPixel
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method int shiftPerPixel() const
+
+Returns bit shift converting row bytes to row pixels.
+Returns zero for kUnknown_SkColorType.
+
+#Return one of: 0, 1, 2, 3; left shift to convert pixels to bytes ##
+
+#Example
+ const char* colors[] = {"Unknown", "Alpha", "RGB_565", "ARGB_4444",
+ "RGBA_8888", "BGRA_8888", "Gray_8", "RGBA_F16"};
+ SkImageInfo info = SkImageInfo::MakeA8(1, 1);
+ for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType,
+ kRGB_565_SkColorType, kARGB_4444_SkColorType,
+ kRGBA_8888_SkColorType, kBGRA_8888_SkColorType,
+ kGray_8_SkColorType, kRGBA_F16_SkColorType } ) {
+ SkPixmap pixmap(info.makeColorType(colorType), nullptr, 4);
+ SkDebugf("color: k" "%s" "_SkColorType" "%*s" "bytesPerPixel: %d shiftPerPixel: %d\n",
+ colors[colorType], 10 - strlen(colors[colorType]), " ",
+ pixmap.info().bytesPerPixel(), pixmap.shiftPerPixel());
+ }
+#StdOut
+color: kUnknown_SkColorType bytesPerPixel: 0 shiftPerPixel: 0
+color: kAlpha_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
+color: kRGB_565_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
+color: kARGB_4444_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
+color: kRGBA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2
+color: kBGRA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2
+color: kGray_8_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
+color: kRGBA_F16_SkColorType bytesPerPixel: 8 shiftPerPixel: 3
+##
+##
+
+#SeeAlso rowBytes rowBytesAsPixels width SkImageInfo::bytesPerPixel
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method uint64_t getSize64() const
+
+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
+##
+##
+
+#SeeAlso getSafeSize64 getSafeSize height() rowBytes width() SkImageInfo::bytesPerPixel
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method uint64_t getSafeSize64() const
+
+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
+##
+##
+
+#SeeAlso getSize64 getSafeSize height() rowBytes width() SkImageInfo::bytesPerPixel
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method size_t getSafeSize() const
+
+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.
+The largest value than can be returned is 2,147,483,647.
+
+#Return exact pixel storage size if size fits in signed 32 bits ##
+
+#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());
+ }
+ }
+}
+#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
+##
+##
+
+#SeeAlso getSize64 getSafeSize64 height() rowBytes width() SkImageInfo::bytesPerPixel sk_64_isS32
+
+##
+
+#Subtopic Image_Info_Access ##
+
+#Subtopic Reader
+
+# ------------------------------------------------------------------------------
+
+#Method bool computeIsOpaque() const
+
+Returns true if all pixels are opaque. Color_Type determines how pixels
+are encoded, and whether pixel describes Alpha. Returns true for Color_Types
+without alpha for each pixel; for other Color_Types, returns true if all
+pixels have alpha values equivalent to 1.0 or greater.
+
+For Color_Types kRGB_565_SkColorType or kGray_8_SkColorType: always
+returns true. For Color_Types kAlpha_8_SkColorType, kBGRA_8888_SkColorType,
+kRGBA_8888_SkColorType: returns true if all pixel Alpha values are 255.
+For Color_Type kARGB_4444_SkColorType: returns true if all pixel Alpha values are 15.
+For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or
+greater.
+
+Returns false for any other Color_Type.
+
+#Return true all pixels have opaque values or Color_Type is opaque ##
+
+#Example
+ std::vector<uint32_t> pixels;
+ const int height = 2;
+ const int width = 2;
+ pixels.resize(height * width * 4);
+ SkPixmap pixmap(SkImageInfo::Make(width, height, kN32_SkColorType,
+ kPremul_SkAlphaType), (const void*) &pixels.front(), width * 4);
+ for (int index = 0; index < 2; ++index) {
+ pixmap.erase(0x00000000);
+ SkDebugf("computeIsOpaque: %s\n", pixmap.computeIsOpaque() ? "true" : "false");
+ pixmap.erase(0xFFFFFFFF);
+ SkDebugf("computeIsOpaque: %s\n", pixmap.computeIsOpaque() ? "true" : "false");
+ pixmap.reset(pixmap.info().makeAlphaType(kOpaque_SkAlphaType),
+ (const void*) &pixels.front(), width * 4);
+ }
+#StdOut
+computeIsOpaque: false
+computeIsOpaque: true
+computeIsOpaque: false
+computeIsOpaque: true
+##
+##
+
+#SeeAlso isOpaque Color_Type Alpha
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method SkColor getColor(int x, int y) const
+
+Returns pixel at (x, y) as Unpremultiplied Color.
+Returns black with Alpha if Color_Type is kAlpha_8_SkColorType.
+
+Input is not validated: out of bounds values of x or y trigger an assert() if
+built with SK_DEBUG defined; and returns undefined values or may crash if
+SK_RELEASE is defined. Fails if Color_Type is kUnknown_SkColorType or
+pixel address is nullptr.
+
+Color_Space in Image_Info is ignored. Some Color precision may be lost in the
+conversion to Unpremultiplied Color; original pixel data may have additional
+precision.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return pixel converted to Unpremultiplied Color ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ std::vector<SkPMColor> storage;
+ storage.resize(w * h);
+ SkDebugf("Premultiplied:\n");
+ for (int y = 0; y < h; ++y) {
+ SkDebugf("(0, %d) ", y);
+ for (int x = 0; x < w; ++x) {
+ int a = 0xFF * (x + y) / (w - 1 + h - 1);
+ storage[x + y * w] = SkPackARGB32(a, a * x / (w - 1), a * y / (h - 1), a);
+ SkDebugf("0x%08x%c", storage[x + y * w], x == w - 1 ? '\n' : ' ');
+ }
+ }
+ SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType), &storage.front(), w * 4);
+ SkDebugf("Unpremultiplied:\n");
+ for (int y = 0; y < h; ++y) {
+ SkDebugf("(0, %d) ", y);
+ for (int x = 0; x < w; ++x) {
+ SkDebugf("0x%08x%c", pixmap.getColor(x, y), x == w - 1 ? '\n' : ' ');
+ }
+ }
+#StdOut
+Premultiplied:
+(0, 0) 0x00000000 0x2a0e002a 0x55380055 0x7f7f007f
+(0, 1) 0x2a000e2a 0x551c1c55 0x7f542a7f 0xaaaa38aa
+(0, 2) 0x55003855 0x7f2a547f 0xaa7171aa 0xd4d48dd4
+(0, 3) 0x7f007f7f 0xaa38aaaa 0xd48dd4d4 0xffffffff
+Unpremultiplied:
+(0, 0) 0x00000000 0x2a5500ff 0x55a800ff 0x7fff00ff
+(0, 1) 0x2a0055ff 0x555454ff 0x7fa954ff 0xaaff54ff
+(0, 2) 0x5500a8ff 0x7f54a9ff 0xaaaaaaff 0xd4ffaaff
+(0, 3) 0x7f00ffff 0xaa54ffff 0xd4aaffff 0xffffffff
+##
+##
+
+#SeeAlso addr() readPixels
+
+##
+
+#Subtopic Reader ##
+
+#Subtopic Readable_Address
+
+# ------------------------------------------------------------------------------
+
+#Method const void* addr(int x, int y) const
+
+Returns readable pixel address at (x, y).
+
+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.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return readable generic pointer to pixel ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ std::vector<SkPMColor> storage;
+ storage.resize(w * h);
+ SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType), &storage.front(), w * 4);
+ SkDebugf("pixmap.addr(1, 2) %c= &storage[1 + 2 * w]\n",
+ pixmap.addr(1, 2) == &storage[1 + 2 * w] ? '=' : '!');
+#StdOut
+pixmap.addr(1, 2) == &storage[1 + 2 * w]
+##
+##
+
+#SeeAlso addr8 addr16 addr32 addr64 addrF16 getColor writable_addr
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint8_t* addr8() const
+
+Returns readable base pixel address. Result is addressable as unsigned 8-bit bytes.
+Will trigger an assert() if Color_Type is not kAlpha_8_SkColorType or
+kGray_8_SkColorType, and is built with SK_DEBUG defined.
+
+One byte corresponds to one pixel.
+
+#Return readable unsigned 8-bit pointer to pixels ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint8_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kGray_8_SkColorType, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr8() %c= storage\n",
+ pixmap.addr8() == storage ? '=' : '!');
+#StdOut
+pixmap.addr8() == storage
+##
+##
+
+#SeeAlso addr() addr16 addr32 addr64 addrF16 getColor writable_addr writable_addr8
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint16_t* addr16() const
+
+Returns readable base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if Color_Type is not kRGB_565_SkColorType or
+kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
+
+One word corresponds to one pixel.
+
+#Return readable unsigned 16-bit pointer to pixels ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint16_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kARGB_4444_SkColorType, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr16() %c= storage\n",
+ pixmap.addr16() == storage ? '=' : '!');
+#StdOut
+pixmap.addr16() == storage
+##
+##
+
+#SeeAlso addr() addr8 addr32 addr64 addrF16 getColor writable_addr writable_addr16
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint32_t* addr32() const
+
+Returns readable base pixel address. Result is addressable as unsigned 32-bit words.
+Will trigger an assert() if Color_Type is not kRGBA_8888_SkColorType or
+kBGRA_8888_SkColorType, and is built with SK_DEBUG defined.
+
+One word corresponds to one pixel.
+
+#Return readable unsigned 32-bit pointer to pixels ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint32_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr32() %c= storage\n",
+ pixmap.addr32() == storage ? '=' : '!');
+#StdOut
+pixmap.addr32() == storage
+##
+##
+
+#SeeAlso addr() addr8 addr16 addr64 addrF16 getColor writable_addr writable_addr32
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint64_t* addr64() const
+
+Returns readable base pixel address. Result is addressable as unsigned 64-bit words.
+Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
+with SK_DEBUG defined.
+
+One word corresponds to one pixel.
+
+#Return readable unsigned 64-bit pointer to pixels ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint64_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kRGBA_F16_SkColorType, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr64() %c= storage\n",
+ pixmap.addr64() == storage ? '=' : '!');
+#StdOut
+pixmap.addr64() == storage
+##
+##
+
+#SeeAlso addr() addr8 addr16 addr32 addrF16 getColor writable_addr writable_addr64
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint16_t* addrF16() const
+
+Returns readable base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
+with SK_DEBUG defined.
+
+Each word represents one color component encoded as a half float.
+Four words correspond to one pixel.
+
+#Return readable unsigned 16-bit pointer to first component of pixels ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint16_t storage[w * h * 4];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kRGBA_F16_SkColorType, kPremul_SkAlphaType),
+ storage, w * 4 * sizeof(storage[0]));
+ SkDebugf("pixmap.addrF16() %c= storage\n",
+ pixmap.addrF16() == storage ? '=' : '!');
+#StdOut
+pixmap.addrF16() == storage
+##
+##
+
+#SeeAlso addr() addr8 addr16 addr32 addr64 getColor writable_addr writable_addrF16
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint8_t* addr8(int x, int y) const
+
+Returns readable pixel address at (x, y).
+
+Input is not validated: out of bounds values of x or y trigger an assert() if
+built with SK_DEBUG defined.
+
+Will trigger an assert() if Color_Type is not kAlpha_8_SkColorType or
+kGray_8_SkColorType, and is built with SK_DEBUG defined.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return readable unsigned 8-bit pointer to pixel at (x, y) ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint8_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kGray_8_SkColorType, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr8(1, 2) %c= &storage[1 + 2 * w]\n",
+ pixmap.addr8(1, 2) == &storage[1 + 2 * w] ? '=' : '!');
+#StdOut
+pixmap.addr8(1, 2) == &storage[1 + 2 * w]
+##
+##
+
+#SeeAlso addr() addr16 addr32 addr64 addrF16 getColor writable_addr writable_addr8
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint16_t* addr16(int x, int y) const
+
+Returns readable pixel address at (x, y).
+
+Input is not validated: out of bounds values of x or y trigger an assert() if
+built with SK_DEBUG defined.
+
+Will trigger an assert() if Color_Type is not kRGB_565_SkColorType or
+kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return readable unsigned 16-bit pointer to pixel at (x, y) ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint16_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kARGB_4444_SkColorType, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr16(1, 2) %c= &storage[1 + 2 * w]\n",
+ pixmap.addr16(1, 2) == &storage[1 + 2 * w] ? '=' : '!');
+#StdOut
+pixmap.addr16(1, 2) == &storage[1 + 2 * w]
+##
+##
+
+#SeeAlso addr() addr8 addr32 addr64 addrF16 getColor writable_addr writable_addr16
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint32_t* addr32(int x, int y) const
+
+Returns readable pixel address at (x, y).
+
+Input is not validated: out of bounds values of x or y trigger an assert() if
+built with SK_DEBUG defined.
+
+Will trigger an assert() if Color_Type is not kRGBA_8888_SkColorType or
+kBGRA_8888_SkColorType, and is built with SK_DEBUG defined.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return readable unsigned 32-bit pointer to pixel at (x, y) ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint32_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kRGBA_8888_SkColorType, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr32(1, 2) %c= &storage[1 + 2 * w]\n",
+ pixmap.addr32(1, 2) == &storage[1 + 2 * w] ? '=' : '!');
+#StdOut
+pixmap.addr32(1, 2) == &storage[1 + 2 * w]
+##
+##
+
+#ToDo incomplete ##
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint64_t* addr64(int x, int y) const
+
+Returns readable pixel address at (x, y).
+
+Input is not validated: out of bounds values of x or y trigger an assert() if
+built with SK_DEBUG defined.
+
+Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
+with SK_DEBUG defined.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return readable unsigned 64-bit pointer to pixel at (x, y) ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ uint64_t storage[w * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kRGBA_F16_SkColorType, kPremul_SkAlphaType),
+ storage, w * sizeof(storage[0]));
+ SkDebugf("pixmap.addr64(1, 2) %c= &storage[1 + 2 * w]\n",
+ pixmap.addr64(1, 2) == &storage[1 + 2 * w] ? '=' : '!');
+#StdOut
+pixmap.addr64(1, 2) == &storage[1 + 2 * w]
+##
+##
+
+#SeeAlso addr() addr8 addr16 addr32 addrF16 getColor writable_addr writable_addr64
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method const uint16_t* addrF16(int x, int y) const
+
+Returns readable pixel address at (x, y).
+
+Input is not validated: out of bounds values of x or y trigger an assert() if
+built with SK_DEBUG defined.
+
+Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
+with SK_DEBUG defined.
+
+Each unsigned 16-bit word represents one color component encoded as a half float.
+Four words correspond to one pixel.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return readable unsigned 16-bit pointer to pixel component at (x, y) ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ const int wordsPerPixel = 4;
+ const int rowWords = w * wordsPerPixel;
+ uint16_t storage[rowWords * h];
+ SkPixmap pixmap(SkImageInfo::Make(w, h, kRGBA_F16_SkColorType, kPremul_SkAlphaType),
+ storage, rowWords * sizeof(storage[0]));
+ SkDebugf("pixmap.addrF16(1, 2) %c= &storage[1 * wordsPerPixel + 2 * rowWords]\n",
+ pixmap.addrF16(1, 2) == &storage[1 * wordsPerPixel + 2 * rowWords] ? '=' : '!');
+#StdOut
+pixmap.addrF16(1, 2) == &storage[1 * wordsPerPixel + 2 * rowWords]
+##
+##
+
+#SeeAlso addr() addr8 addr16 addr32 addr64 getColor writable_addr writable_addrF16
+
+##
+
+#Subtopic Readable_Address ##
+
+#Subtopic Writable_Address
+
+# ------------------------------------------------------------------------------
+
+#Method void* writable_addr() const
+
+Returns writable base pixel address.
+
+#Return writable generic base pointer to pixels ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ SkPMColor storage[w * h * 4];
+ SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType), storage, w * 4);
+ SkDebugf("pixmap.writable_addr() %c= (void *)storage\n",
+ pixmap.writable_addr() == (void *)storage ? '=' : '!');
+ pixmap.erase(0x00000000);
+ *(SkPMColor*)pixmap.writable_addr() = 0xFFFFFFFF;
+ SkDebugf("pixmap.getColor(0, 1) %c= 0x00000000\n",
+ pixmap.getColor(0, 1) == 0x00000000 ? '=' : '!');
+ SkDebugf("pixmap.getColor(0, 0) %c= 0xFFFFFFFF\n",
+ pixmap.getColor(0, 0) == 0xFFFFFFFF ? '=' : '!');
+#StdOut
+pixmap.writable_addr() == (void *)storage
+pixmap.getColor(0, 1) == 0x00000000
+pixmap.getColor(0, 0) == 0xFFFFFFFF
+##
+##
+
+#SeeAlso writable_addr8 writable_addr16 writable_addr32 writable_addr64 writable_addrF16 addr()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method void* writable_addr(int x, int y) const
+
+Returns writable pixel address at (x, y).
+
+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.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return writable generic pointer to pixel ##
+
+#Example
+ const int w = 4;
+ const int h = 4;
+ SkPMColor storage[w * h * 4];
+ SkPixmap pixmap(SkImageInfo::MakeN32(w, h, kPremul_SkAlphaType), storage, w * 4);
+ SkDebugf("pixmap.writable_addr() %c= (void *)storage\n",
+ pixmap.writable_addr() == (void *)storage ? '=' : '!');
+ pixmap.erase(0x00000000);
+ *(SkPMColor*)pixmap.writable_addr(1, 2) = 0xFFFFFFFF;
+ SkDebugf("pixmap.getColor(0, 0) %c= 0x00000000\n",
+ pixmap.getColor(0, 0) == 0x00000000 ? '=' : '!');
+ SkDebugf("pixmap.getColor(1, 2) %c= 0xFFFFFFFF\n",
+ pixmap.getColor(1, 2) == 0xFFFFFFFF ? '=' : '!');
+#StdOut
+pixmap.writable_addr() == (void *)storage
+pixmap.getColor(0, 0) == 0x00000000
+pixmap.getColor(1, 2) == 0xFFFFFFFF
+##
+##
+
+#SeeAlso writable_addr8 writable_addr16 writable_addr32 writable_addr64 writable_addrF16 addr()
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method uint8_t* writable_addr8(int x, int y) const
+
+Returns writable base pixel address. Result is addressable as unsigned 8-bit bytes.
+Will trigger an assert() if Color_Type is not kAlpha_8_SkColorType or
+kGray_8_SkColorType, and is built with SK_DEBUG defined.
+
+One byte corresponds to one pixel.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return writable unsigned 8-bit pointer to pixels ##
+
+#Example
+#Height 64
+#Description
+Altering pixels after drawing Bitmap is not guaranteed to affect subsequent
+drawing on all platforms. Adding a second SkBitmap::installPixels after editing
+pixel memory is safer.
+##
+void draw(SkCanvas* canvas) {
+ uint8_t storage[][5] = {{ 0, 0, 64, 0, 0},
+ { 0, 128, 255, 128, 0},
+ {64, 255, 255, 255, 64},
+ { 0, 128, 255, 128, 0},
+ { 0, 0, 64, 0, 0}};
+ SkImageInfo imageInfo = SkImageInfo::Make(5, 5, kGray_8_SkColorType, kPremul_SkAlphaType);
+ SkPixmap pixmap(imageInfo, storage[0], 5);
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->scale(10, 10);
+ canvas->drawBitmap(bitmap, 0, 0);
+ *pixmap.writable_addr8(2, 2) = 0;
+// bitmap.installPixels(pixmap); // uncomment to fix on GPU
+ canvas->drawBitmap(bitmap, 10, 0);
+}
+##
+
+#SeeAlso writable_addr writable_addr16 writable_addr32 writable_addr64 writable_addrF16 addr() addr8
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method uint16_t* writable_addr16(int x, int y) const
+
+Returns writable_addr base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if Color_Type is not kRGB_565_SkColorType or
+kARGB_4444_SkColorType, and is built with SK_DEBUG defined.
+
+One word corresponds to one pixel.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return writable unsigned 16-bit pointer to pixel ##
+
+#Example
+#Description
+Draw a five by five bitmap, and draw it again with a center black pixel.
+The low nibble of the 16-bit word is Alpha.
+##
+#Height 64
+ uint16_t storage[][5] = {{ 0xCABF, 0xDABE, 0xCA9D, 0xC96C, 0xA39B },
+ { 0xACEE, 0xA87C, 0x893A, 0x4779, 0x8708 },
+ { 0x4B7C, 0x255B, 0x2559, 0x2557, 0x4656 },
+ { 0x9099, 0x8128, 0x2557, 0x4124, 0x3323 },
+ { 0x7547, 0x5505, 0x4434, 0x2012, 0x0000 }};
+ SkImageInfo imageInfo = SkImageInfo::Make(5, 5, kARGB_4444_SkColorType, kPremul_SkAlphaType);
+ SkPixmap pixmap(imageInfo, storage[0], sizeof(storage) / 5);
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->scale(10, 10);
+ canvas->drawBitmap(bitmap, 0, 0);
+ *pixmap.writable_addr16(2, 2) = 0x000F;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 10, 0);
+##
+
+#SeeAlso writable_addr writable_addr8 writable_addr32 writable_addr64 writable_addrF16 addr() addr16
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method uint32_t* writable_addr32(int x, int y) const
+
+Returns writable base pixel address. Result is addressable as unsigned 32-bit words.
+Will trigger an assert() if Color_Type is not kRGBA_8888_SkColorType or
+kBGRA_8888_SkColorType, and is built with SK_DEBUG defined.
+
+One word corresponds to one pixel.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return writable unsigned 32-bit pointer to pixel ##
+
+#Example
+#Image 4
+#Height 72
+ std::vector<int32_t> pixels;
+ pixels.resize(image->height() * image->width() * 4);
+ SkPixmap pixmap(SkImageInfo::Make(image->width(), image->height(), kN32_SkColorType,
+ image->alphaType()), (const void*) &pixels.front(), image->width() * 4);
+ image->readPixels(pixmap, 0, 0);
+ for (int y = 0; y < pixmap.height() / 2; ++y) {
+ for (int x = 0; x < pixmap.width(); ++x) {
+ if ((x & 4) == (y & 4)) {
+ SkTSwap(*pixmap.writable_addr32(x, y),
+ *pixmap.writable_addr32(pixmap.width() - x, pixmap.height() - y));
+ }
+ }
+ }
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+##
+
+#SeeAlso writable_addr writable_addr8 writable_addr16 writable_addr64 writable_addrF16 addr() addr32
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method uint64_t* writable_addr64(int x, int y) const
+
+Returns writable base pixel address. Result is addressable as unsigned 64-bit words.
+Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
+with SK_DEBUG defined.
+
+One word corresponds to one pixel.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return writable unsigned 64-bit pointer to pixel ##
+
+#Example
+ SkImageInfo info = SkImageInfo::Make(3, 3, kRGBA_F16_SkColorType, kPremul_SkAlphaType);
+ uint64_t storage[9];
+ SkPixmap pixmap(info, storage, 3 * sizeof(uint64_t));
+ SkColor4f c4 { 1, 0.45f, 0.25f, 0.65f };
+ pixmap.erase(c4);
+ SkBitmap bitmap;
+ canvas->scale(10, 10);
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+ *pixmap.writable_addr64(1, 1) |= 0x00ff000000000000LL;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 10, 0);
+##
+
+#SeeAlso writable_addr writable_addr8 writable_addr16 writable_addr32 writable_addrF16 addr() addr64
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method uint16_t* writable_addrF16(int x, int y) const
+
+Returns writable base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if Color_Type is not kRGBA_F16_SkColorType and is built
+with SK_DEBUG defined.
+
+Each word represents one color component encoded as a half float.
+Four words correspond to one pixel.
+
+#Param x positive column index less than width() ##
+#Param y positive row index less than height() ##
+
+#Return writable unsigned 16-bit pointer to first component of pixel ##
+
+#Example
+#Height 64
+#Description
+Left bitmap is drawn with two pixels defined in half float format. Right bitmap
+is drawn after overwriting bottom half float color with top half float color.
+##
+ SkImageInfo info = SkImageInfo::Make(1, 2, kRGBA_F16_SkColorType, kPremul_SkAlphaType);
+ uint16_t storage[2][4];
+ SkPixmap pixmap(info, storage[0], sizeof(uint64_t));
+ SkIRect topPixelBounds = {0, 0, 1, 1};
+ pixmap.erase({ 0.65f, 0.45f, 0.25f, 1 }, &topPixelBounds);
+ SkIRect bottomPixelBounds = {0, 1, 1, 2};
+ pixmap.erase({ 0.25f, 0.65f, 0.45f, 1 }, &bottomPixelBounds);
+ SkBitmap bitmap;
+ canvas->scale(20, 20);
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+ uint16_t* pixel2 = pixmap.writable_addrF16(0, 1);
+ for (int i = 0; i < 4; ++i) {
+ pixel2[i] = storage[0][i];
+ }
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 4, 0);
+##
+
+#SeeAlso writable_addr writable_addr8 writable_addr16 writable_addr32 writable_addr64 addr() addrF16
+
+##
+
+#Subtopic Writable_Address ##
+
+#Subtopic Writer
+
+# ------------------------------------------------------------------------------
+
+#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes,
+ int srcX, int srcY, SkTransferFunctionBehavior behavior) const
+
+Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not
+exceed
+#Formula
+(this->width(), this->height())
+##
+. dstInfo specifies width, height, Color_Type, Alpha_Type, and
+Color_Space of destination. dstRowBytes specifics the gap from one destination
+row to the next. Returns true if pixels are copied. Returns false if
+dstInfo.addr() equals nullptr, or dstRowBytes is less than dstInfo.minRowBytes.
+
+Pixels are copied only if pixel conversion is possible. If this->colorType is
+kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match.
+If this->colorType is kGray_8_SkColorType, dstInfo.colorSpace must match.
+If this->alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must
+match. If this->colorSpace is nullptr, dstInfo.colorSpace must match. Returns
+false if pixel conversion is not possible.
+
+srcX and srcY may be negative to copy only top or left of source. Returns
+false if width() or height() is zero or negative. Returns false if
+#Formula
+abs(srcX) >= this->width() || abs(scrY) >= 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.
+
+#Param dstInfo destination width, height, Color_Type, Alpha_Type, Color_Space ##
+#Param dstPixels destination pixel storage ##
+#Param dstRowBytes destination row length ##
+#Param srcX column index whose absolute value is less than width() ##
+#Param srcY row index whose absolute value is less than height() ##
+#Param behavior one of: SkTransferFunctionBehavior::kRespect,
+ SkTransferFunctionBehavior::kIgnore
+##
+
+#Return true if pixels are copied to dstPixels ##
+
+#Example
+#Image 3
+void draw(SkCanvas* canvas) {
+ SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height(),
+ canvas->imageInfo().colorSpace() ? SkColorSpace::MakeSRGB() : nullptr);
+ std::vector<int32_t> srcPixels;
+ srcPixels.resize(image->height() * image->width() * 4);
+ SkPixmap pixmap(info, (const void*) &srcPixels.front(), image->width() * 4);
+ image->readPixels(pixmap, 0, 0);
+ SkTransferFunctionBehavior behavior = canvas->imageInfo().colorSpace() ?
+ SkTransferFunctionBehavior::kRespect : SkTransferFunctionBehavior::kIgnore;
+ std::vector<int32_t> dstPixels;
+ dstPixels.resize(image->height() * image->width() * 4);
+ int offset = 0;
+ for (auto behavior : { SkTransferFunctionBehavior::kRespect,
+ SkTransferFunctionBehavior::kIgnore} ) {
+ pixmap.readPixels(info, &dstPixels.front(), image->width() * 4, offset, 0, behavior);
+ offset += 128;
+ }
+ SkBitmap bitmap;
+ SkPixmap dstmap(info, &dstPixels.front(), image->width() * 4);
+ bitmap.installPixels(dstmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+}
+##
+
+#SeeAlso erase SkBitmap::readPixels SkCanvas::drawBitmap SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const
+
+Copies a Rect of pixels to dstPixels. Copy starts at (0, 0), and does not
+exceed
+#Formula
+(this->width(), this->height())
+##
+. dstInfo specifies width, height, Color_Type, Alpha_Type, and
+Color_Space of destination. dstRowBytes specifics the gap from one destination
+row to the next. Returns true if pixels are copied. Returns false if
+dstInfo.addr() equals nullptr, or dstRowBytes is less than dstInfo.minRowBytes.
+
+Pixels are copied only if pixel conversion is possible. If this->colorType is
+kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match.
+If this->colorType is kGray_8_SkColorType, dstInfo.colorSpace must match.
+If this->alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must
+match. If this->colorSpace is nullptr, dstInfo.colorSpace must match. Returns
+false if pixel conversion is not possible.
+
+Returns false if this->width() or this->height() is zero or negative.
+
+#Param dstInfo destination width, height, Color_Type, Alpha_Type, Color_Space ##
+#Param dstPixels destination pixel storage ##
+#Param dstRowBytes destination row length ##
+
+#Return true if pixels are copied to dstPixels ##
+
+#Example
+#Height 128
+#Description
+Transferring the gradient from 8 bits per component to 4 bits per component
+creates visible banding.
+##
+ std::vector<int32_t> pixels;
+ const int width = 256;
+ const int height = 64;
+ pixels.resize(height * width * 4);
+ SkImageInfo srcInfo = SkImageInfo::MakeN32Premul(width, height);
+ SkPixmap srcPixmap(srcInfo, (const void*) &pixels.front(), width * 4);
+ SkColor gradColors[] = { 0xFFAA3300, 0x7F881122 };
+ SkPoint gradPoints[] = { { 0, 0 }, { 256, 0 } };
+ SkPaint paint;
+ paint.setShader(SkGradientShader::MakeLinear(gradPoints, gradColors, nullptr,
+ SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));
+ SkBitmap bitmap;
+ bitmap.installPixels(srcPixmap);
+ SkCanvas srcCanvas(bitmap);
+ srcCanvas.drawRect(SkRect::MakeWH(width, height), paint);
+ canvas->drawBitmap(bitmap, 0, 0);
+ std::vector<int32_t> dstPixels;
+ dstPixels.resize(height * width * 2);
+ SkImageInfo dstInfo = srcInfo.makeColorType(kARGB_4444_SkColorType);
+ srcPixmap.readPixels(dstInfo, &dstPixels.front(), width * 2);
+ SkPixmap dstPixmap(dstInfo, &dstPixels.front(), width * 2);
+ bitmap.installPixels(dstPixmap);
+ canvas->drawBitmap(bitmap, 0, 128);
+##
+
+#SeeAlso erase SkBitmap::readPixels SkCanvas::drawBitmap SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX,
+ int srcY) const
+
+Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not
+exceed
+#Formula
+(this->width(), this->height())
+##
+. dstInfo specifies width, height, Color_Type, Alpha_Type, and
+Color_Space of destination. dstRowBytes specifics the gap from one destination
+row to the next. Returns true if pixels are copied. Returns false if
+dstInfo.addr() equals nullptr, or dstRowBytes is less than dstInfo.minRowBytes.
+
+Pixels are copied only if pixel conversion is possible. If this->colorType is
+kGray_8_SkColorType, or kAlpha_8_SkColorType; dstInfo.colorType must match.
+If this->colorType is kGray_8_SkColorType, dstInfo.colorSpace must match.
+If this->alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must
+match. If this->colorSpace is nullptr, dstInfo.colorSpace must match. Returns
+false if pixel conversion is not possible.
+
+srcX and srcY may be negative to copy only top or left of source. Returns
+false if this->width() or this->height() is zero or negative. Returns false if
+#Formula
+abs(srcX) >= this->width() || abs(scrY) >= this->height()
+##
+.
+
+#Param dstInfo destination width, height, Color_Type, Alpha_Type, Color_Space ##
+#Param dstPixels destination pixel storage ##
+#Param dstRowBytes destination row length ##
+#Param srcX column index whose absolute value is less than width() ##
+#Param srcY row index whose absolute value is less than height() ##
+
+#Return true if pixels are copied to dstPixels ##
+
+#Example
+#Image 3
+void draw(SkCanvas* canvas) {
+ SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height());
+ std::vector<int32_t> srcPixels;
+ const int rowBytes = image->width() * 4;
+ srcPixels.resize(image->height() * rowBytes);
+ SkPixmap pixmap(info, (const void*) &srcPixels.front(), rowBytes);
+ image->readPixels(pixmap, 0, 0);
+ for (int offset : { 32, 64, 96 } ) {
+ std::vector<int32_t> dstPixels;
+ dstPixels.resize(image->height() * rowBytes);
+ pixmap.readPixels(info, &dstPixels.front(), rowBytes, offset, 0);
+ SkBitmap bitmap;
+ SkPixmap dstmap(info, &dstPixels.front(), rowBytes);
+ bitmap.installPixels(dstmap);
+ canvas->translate(32, 32);
+ canvas->drawBitmap(bitmap, 0, 0);
+ }
+}
+##
+
+#SeeAlso erase SkBitmap::readPixels SkCanvas::drawBitmap SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
+
+Copies a Rect of pixels to dst. Copy starts at (srcX, srcY), and does not
+exceed (this->width(), this->height()). dst specifies width, height, Color_Type,
+Alpha_Type, and Color_Space of destination. Returns true if pixels are copied.
+Returns false if dst.addr() equals nullptr, or dst.rowBytes is less than
+dst SkImageInfo::minRowBytes.
+
+Pixels are copied only if pixel conversion is possible. If this->colorType is
+kGray_8_SkColorType, or kAlpha_8_SkColorType; dst.info().colorType must match.
+If this->colorType is kGray_8_SkColorType, dst.info().colorSpace must match.
+If this->alphaType is kOpaque_SkAlphaType, dst.info().alphaType must
+match. If this->colorSpace is nullptr, dst.info().colorSpace must match. Returns
+false if pixel conversion is not possible.
+
+srcX and srcY may be negative to copy only top or left of source. Returns
+false this->width() or this->height() is zero or negative. Returns false if
+#Formula
+abs(srcX) >= this->width() || abs(scrY) >= this->height()
+##
+.
+
+#Param dst Image_Info and pixel address to write to ##
+#Param srcX column index whose absolute value is less than width() ##
+#Param srcY row index whose absolute value is less than height() ##
+
+#Return true if pixels are copied to dst ##
+
+#Example
+#Image 3
+void draw(SkCanvas* canvas) {
+ SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height());
+ std::vector<int32_t> srcPixels;
+ const int rowBytes = image->width() * 4;
+ srcPixels.resize(image->height() * rowBytes);
+ SkPixmap pixmap(info, (const void*) &srcPixels.front(), rowBytes);
+ image->readPixels(pixmap, 0, 0);
+ for (int offset : { 32, 64, 96 } ) {
+ std::vector<int32_t> dstPixels;
+ dstPixels.resize(image->height() * rowBytes);
+ SkPixmap dstmap(info, &dstPixels.front(), rowBytes);
+ pixmap.readPixels(dstmap, offset, 0);
+ SkBitmap bitmap;
+ bitmap.installPixels(dstmap);
+ canvas->translate(32, 32);
+ canvas->drawBitmap(bitmap, 0, 0);
+ }
+}
+##
+
+#SeeAlso erase SkBitmap::readPixels SkCanvas::drawBitmap SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool readPixels(const SkPixmap& dst) const
+
+Copies pixels inside bounds() to dst. dst specifies width, height, Color_Type,
+Alpha_Type, and Color_Space of destination. Returns true if pixels are copied.
+Returns false if dst.addr() equals nullptr, or dst.rowBytes is less than
+dst SkImageInfo::minRowBytes.
+
+Pixels are copied only if pixel conversion is possible. If this->colorType is
+kGray_8_SkColorType, or kAlpha_8_SkColorType; dst Color_Type must match.
+If this->colorType is kGray_8_SkColorType, dst Color_Space must match.
+If this->alphaType is kOpaque_SkAlphaType, dst Alpha_Type must
+match. If this->colorSpace is nullptr, dst Color_Space must match. Returns
+false if pixel conversion is not possible.
+
+Returns false if this->width() or this->height() is zero or negative.
+
+#Param dst Image_Info and pixel address to write to ##
+
+#Return true if pixels are copied to dst ##
+
+#Example
+#Image 3
+void draw(SkCanvas* canvas) {
+ SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height());
+ std::vector<int32_t> srcPixels;
+ const int rowBytes = image->width() * 4;
+ srcPixels.resize(image->height() * rowBytes);
+ SkPixmap pixmap(info, (const void*) &srcPixels.front(), rowBytes);
+ image->readPixels(pixmap, 0, 0);
+ for (int index = 0; index < 3; ++index ) {
+ std::vector<int32_t> dstPixels;
+ dstPixels.resize(image->height() * rowBytes);
+ SkPixmap dstmap(info, &dstPixels.front(), rowBytes);
+ pixmap.readPixels(dstmap);
+ SkBitmap bitmap;
+ bitmap.installPixels(dstmap);
+ canvas->translate(32, 32);
+ canvas->drawBitmap(bitmap, 0, 0);
+ }
+}
+##
+
+#SeeAlso erase SkBitmap::readPixels SkCanvas::drawBitmap SkCanvas::readPixels SkImage::readPixels SkSurface::readPixels
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality) const
+
+Copies this to dst, scaling pixels to fit dst.width() and dst.height(), and
+converting pixels to match dst.colorType and dst.alphaType. Returns true if
+pixels are copied. Returns false if dst.addr() is nullptr, or dst.rowBytes is
+less than dst SkImageInfo::minRowBytes.
+
+Pixels are copied only if pixel conversion is possible. If this->colorType is
+kGray_8_SkColorType, or kAlpha_8_SkColorType; dst Color_Type must match.
+If this->colorType is kGray_8_SkColorType, dst Color_Space must match.
+If this->alphaType is kOpaque_SkAlphaType, dst Alpha_Type must
+match. If this->colorSpace is nullptr, dst Color_Space must match. Returns
+false if pixel conversion is not possible.
+
+Returns false if this->width() or this->height() is zero or negative.
+
+Scales the image, with filterQuality, to match dst.width() and dst.height().
+filterQuality kNone_SkFilterQuality is fastest, typically implemented with
+Filter_Quality_Nearest_Neighbor. kLow_SkFilterQuality is typically implemented with
+Filter_Quality_Bilerp. kMedium_SkFilterQuality is typically implemented with
+Filter_Quality_Bilerp, and Filter_Quality_MipMap when size is reduced.
+kHigh_SkFilterQuality is slowest, typically implemented with Filter_Quality_BiCubic.
+
+#Param dst Image_Info and pixel address to write to ##
+#Param filterQuality one of: kNone_SkFilterQuality, kLow_SkFilterQuality,
+ kMedium_SkFilterQuality, kHigh_SkFilterQuality
+##
+
+#Return true if pixels are copied to dst ##
+
+#Example
+#Image 3
+void draw(SkCanvas* canvas) {
+ SkImageInfo info = SkImageInfo::MakeN32Premul(image->width(), image->height());
+ std::vector<int32_t> srcPixels;
+ int rowBytes = image->width() * 4;
+ srcPixels.resize(image->height() * rowBytes);
+ SkPixmap pixmap(info, (const void*) &srcPixels.front(), rowBytes);
+ image->readPixels(pixmap, 0, 0);
+ for (int offset : { 32, 64, 96 } ) {
+ info = SkImageInfo::MakeN32Premul(image->width() + offset, image->height());
+ rowBytes = info.width() * 4;
+ std::vector<int32_t> dstPixels;
+ dstPixels.resize(image->height() * rowBytes);
+ SkPixmap dstmap(info, &dstPixels.front(), rowBytes);
+ pixmap.scalePixels(dstmap, kMedium_SkFilterQuality);
+ SkBitmap bitmap;
+ bitmap.installPixels(dstmap);
+ canvas->translate(32, 32);
+ canvas->drawBitmap(bitmap, 0, 0);
+ }
+}
+##
+
+#SeeAlso SkCanvas::drawBitmap SkImage::scalePixels
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool erase(SkColor color, const SkIRect& subset) const
+
+Writes color to pixels bounded by subset; returns true on success.
+Returns false if colorType is kUnknown_SkColorType, or if subset does
+not intersect bounds().
+
+#Param color Unpremultiplied Color to write ##
+#Param subset bounding integer Rect of written pixels ##
+
+#Return true if pixels are changed ##
+
+#Example
+ uint32_t storage[2];
+ SkImageInfo info = SkImageInfo::MakeN32Premul(1, 2);
+ SkPixmap pixmap(info, storage, info.minRowBytes());
+ pixmap.erase(SK_ColorBLUE, {0, 0, 1, 1});
+ pixmap.erase(SK_ColorRED, {0, 1, 1, 2});
+ SkBitmap bitmap;
+ canvas->scale(20, 20);
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+##
+
+#SeeAlso SkBitmap::erase SkCanvas::clear SkCanvas::drawColor
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool erase(SkColor color) const
+
+Writes color to pixels inside bounds(); returns true on success.
+Returns false if colorType is kUnknown_SkColorType, or if bounds()
+is empty.
+
+#Param color Unpremultiplied Color to write ##
+
+#Return true if pixels are changed ##
+
+#Example
+ uint32_t storage[2];
+ SkImageInfo info = SkImageInfo::MakeN32Premul(1, 2);
+ SkPixmap pixmap(info, storage, info.minRowBytes());
+ pixmap.erase(SK_ColorBLUE);
+ SkBitmap bitmap;
+ canvas->scale(20, 20);
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+##
+
+#SeeAlso SkBitmap::erase SkCanvas::clear SkCanvas::drawColor
+
+##
+
+# ------------------------------------------------------------------------------
+
+#Method bool erase(const SkColor4f& color, const SkIRect* subset = nullptr) const
+
+Writes color to pixels bounded by subset; returns true on success.
+if subset is nullptr, writes colors pixels inside bounds(). Returns false if
+colorType is kUnknown_SkColorType, if subset is not nullptr and does
+not intersect bounds(), or if subset is nullptr and bounds() is empty.
+
+#Param color Unpremultiplied Color to write ##
+#Param subset bounding integer Rect of pixels to write; may be nullptr ##
+
+#Return true if pixels are changed ##
+
+#Example
+ uint32_t storage[2];
+ SkImageInfo info = SkImageInfo::MakeN32Premul(1, 2);
+ SkPixmap pixmap(info, storage, info.minRowBytes());
+ SkIRect topPixelBounds = {0, 0, 1, 1};
+ pixmap.erase({ 0.65f, 0.45f, 0.25f, 1 }, &topPixelBounds);
+ SkIRect bottomPixelBounds = {0, 1, 1, 2};
+ pixmap.erase({ 0.25f, 0.65f, 0.45f, 1 }, &bottomPixelBounds);
+ SkBitmap bitmap;
+ canvas->scale(20, 20);
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+##
+
+#SeeAlso SkBitmap::erase SkCanvas::clear SkCanvas::drawColor
+
+##
+
+
+#Subtopic Writer ##
+
+#Class SkPixmap ##
+
+#Topic Pixmap ##
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index 9a7c488d67..ad7233f2b6 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -14,7 +14,10 @@
SaveLayerFlags # not external; need to add typedef support
SkUserConfig # not external, but still thinking about how markup refers to this
SkXXX.h # ditto
+ SkXXX_Reference # ditto
Skia # ditto
+ SK_DEBUG # ditto
+ SK_RELEASE # ditto
SK_USE_FREETYPE_EMBOLDEN # ditto
SK_SUPPORT_LEGACY_PAINT_TEXTDECORATION # ditto
SK_BUILD_FOR_ANDROID_FRAMEWORK # ditto
@@ -53,6 +56,13 @@ FT_Load_Glyph
#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 ##
##
@@ -141,6 +151,16 @@ FT_Load_Glyph
#Topic ##
#Topic Color_Space
+#Class SkColorSpace
+ #Method static sk_sp<SkColorSpace> MakeSRGBLinear()
+ ##
+##
+#EnumClass SkTransferFunctionBehavior
+#Const kRespect 0
+##
+#Const kIgnore 1
+##
+#EnumClass ##
##
#Topic Core_Graphics
@@ -209,6 +229,18 @@ FT_Load_Glyph
#Const kHigh_SkFilterQuality 3
##
#Enum ##
+#Subtopic Nearest_Neighbor
+#Substitute nearest neighbor filter
+##
+#Subtopic Bilerp
+#Substitute bilerp filter
+##
+#Subtopic MipMap
+#Substitute mip-map filter
+##
+#Subtopic BiCubic
+#Substitute bicubic filter
+##
#Topic ##
#Topic Font
@@ -242,12 +274,21 @@ FT_Load_Glyph
#Topic Image
#Subtopic Alpha_Type
+ #Alias Alpha_Type
#Enum SkAlphaType
+ #Const kUnknown_SkAlphaType 0
+ ##
+ #Const kOpaque_SkAlphaType 1
+ ##
#Const kPremul_SkAlphaType 2
##
+ #Const kUnpremul_SkAlphaType 3
+ ##
##
#Subtopic ##
- #Subtopic Color_Type
+ #Subtopic Color_Type
+ #Alias Color_Type
+ #Alias Color_Types
#Enum SkColorType
#Const kUnknown_SkColorType 0
##
@@ -276,12 +317,27 @@ FT_Load_Glyph
#Struct SkImageInfo
#Method SkImageInfo()
##
+ #Method SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
+ ##
+ #Method size_t minRowBytes() const
+ ##
+ #Method bool isOpaque() const
+ ##
+ #Method int bytesPerPixel() const
+ ##
##
#Subtopic ##
#Class SkImage
#Method sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
const SkMatrix* localMatrix = nullptr) const
##
+ #Method static sk_sp<SkImage> MakeRasterCopy(const SkPixmap&)
+ ##
+ #Method bool readPixels(const SkPixmap& dst, int srcX, int srcY,
+ CachingHint = kAllow_CachingHint) const
+ ##
+ #Method bool scalePixels(const SkPixmap& dst, SkFilterQuality, CachingHint = kAllow_CachingHint) const
+ ##
##
#Topic ##
@@ -297,6 +353,8 @@ FT_Load_Glyph
#Topic IRect
#Struct SkIRect
+ #Method bool intersect(const SkIRect& r)
+ ##
##
##
@@ -308,6 +366,20 @@ FT_Load_Glyph
#Topic ##
#Topic Mask
+#Class SkMask
+ #Enum Format
+ #Const kBW_Format 0
+ ##
+ #Const kA8_Format 1
+ ##
+ #Const k3D_Format 2
+ ##
+ #Const kARGB32_Format 3
+ ##
+ k#Const LCD16_Format 4
+ ##
+ ##
+##
#Topic ##
#Topic Mask_Alpha
@@ -318,6 +390,11 @@ FT_Load_Glyph
#Class ##
#Topic ##
+#Topic Math
+ #Method static inline bool sk_64_isS32(int64_t value)
+ ##
+##
+
#Topic Matrix
#Struct SkMatrix
#Struct ##
@@ -405,12 +482,12 @@ FT_Load_Glyph
##
##
-#Enum SkPixelGeometry
+#Topic PixelRef
+#Class SkPixelRef
##
-
-#Topic Pixmap
-#Class SkPixmap
##
+
+#Enum SkPixelGeometry
##
#Topic Point
@@ -533,6 +610,8 @@ FT_Load_Glyph
#Method static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo&, void* pixels, size_t rowBytes,
const SkSurfaceProps* = nullptr)
##
+ #Method bool readPixels(const SkPixmap& dst, int srcX, int srcY);
+ ##
##
#Subtopic Properties
#Class SkSurfaceProps
diff --git a/docs/usingBookmaker.bmh b/docs/usingBookmaker.bmh
index 60505ca279..16775c5716 100644
--- a/docs/usingBookmaker.bmh
+++ b/docs/usingBookmaker.bmh
@@ -25,15 +25,35 @@ $ ninja -C out/dir bookmaker
##
Generate an starter Bookmaker file from an existing include.
-This writes SkXXX.bmh in the current directory, which is
-out/dir/obj/ from an IDE.
#Code
-$ ./out/dir/bookmaker -t -i include/core/SkXXX.h
+$ ./out/dir/bookmaker -i include/core/SkXXX.h -t docs
##
-Copy SkXXX.bmh to docs.
-Use your favorite editor to fill out docs/SkXXX.bmh.
+If a method or function has an unnamed parameter, bookmaker generates an error:
+
+#Code
+###$
+C:/puregit/include/core/SkPixmap.h(208): error: #Method missing param name
+bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const
+ ^
+$$$#
+##
+
+All parameters require names to allow markdown and doxygen documents to refer to
+them. After naming all parameters, check in the include before continuing.
+
+A successful run generates
+#Code
+docs/SkXXX_Reference.bmh
+##
+.
+
+Next, use your favorite editor to fill out
+#Code
+docs/SkXXX_Reference.bmh
+##
+.
#Subtopic Style
@@ -102,13 +122,14 @@ This reports if a method no longer exists or its parameters have changed.
$ ./out/dir/bookmaker -x -b docs/SkXXX.bmh -i include/core/SkXXX.h
##
-Generate an updated include header.
-This writes the updated SkXXX.h to the current directory.
+Generate an updated include header. Run:
#Code
$ ./out/dir/bookmaker -p -b docs -i include/core/SkXXX.h
##
+to write the updated SkXXX.h to the current directory.
+
#Subtopic Bugs
Bookmaker bugs are tracked #A here # bug.skia.org/6898 ##.
diff --git a/site/user/api/SkCanvas_Reference.md b/site/user/api/SkCanvas_Reference.md
index 1848816aff..98875b8888 100644
--- a/site/user/api/SkCanvas_Reference.md
+++ b/site/user/api/SkCanvas_Reference.md
@@ -80,7 +80,7 @@ when no <a href="undocumented#Surface">Surface</a> is required, and some helpers
| <a href="#SkCanvas_drawArc">drawArc</a> | Draws <a href="undocumented#Arc">Arc</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. |
| <a href="#SkCanvas_drawAtlas">drawAtlas</a> | Draws sprites using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. |
| <a href="#SkCanvas_drawBitmap">drawBitmap</a> | Draws <a href="undocumented#Bitmap">Bitmap</a> at (x, y) position. |
-| <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> | Draws differentially stretched <a href="undocumented#Bitmap">Bitmap</a>. |
+| <a href="#SkCanvas_drawBitmapLattice">drawBitmapLattice</a> | Draws proportionally stretched <a href="undocumented#Bitmap">Bitmap</a>. |
| <a href="#SkCanvas_drawBitmapNine">drawBitmapNine</a> | Draws <a href="undocumented#Nine_Patch">Nine Patch</a> <a href="undocumented#Bitmap">Bitmap</a>. |
| <a href="#SkCanvas_drawBitmapRect">drawBitmapRect</a> | Draws <a href="undocumented#Bitmap">Bitmap</a>, source <a href="undocumented#Rect">Rect</a> to destination <a href="undocumented#Rect">Rect</a>. |
| <a href="#SkCanvas_drawCircle">drawCircle</a> | Draws <a href="undocumented#Circle">Circle</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. |
@@ -89,7 +89,7 @@ when no <a href="undocumented#Surface">Surface</a> is required, and some helpers
| <a href="#SkCanvas_drawDrawable">drawDrawable</a> | Draws <a href="undocumented#Drawable">Drawable</a>, encapsulated drawing commands. |
| <a href="#SkCanvas_drawIRect">drawIRect</a> | Draws <a href="undocumented#IRect">IRect</a> using <a href="#Clip">Clip</a>, <a href="#Matrix">Matrix</a>, and <a href="SkPaint_Reference#Paint">Paint</a>. |
| <a href="#SkCanvas_drawImage">drawImage</a> | Draws <a href="undocumented#Image">Image</a> at (x, y) position. |
-| <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> | Draws differentially stretched <a href="undocumented#Image">Image</a>. |
+| <a href="#SkCanvas_drawImageLattice">drawImageLattice</a> | Draws proportionally stretched <a href="undocumented#Image">Image</a>. |
| <a href="#SkCanvas_drawImageNine">drawImageNine</a> | Draws <a href="undocumented#Nine_Patch">Nine Patch</a> <a href="undocumented#Image">Image</a>. |
| <a href="#SkCanvas_drawImageRect">drawImageRect</a> | Draws <a href="undocumented#Image">Image</a>, source <a href="undocumented#Rect">Rect</a> to destination <a href="undocumented#Rect">Rect</a>. |
| <a href="#SkCanvas_drawLine">drawLine</a> | Draws line segment between two points. |
@@ -277,12 +277,12 @@ in the center.</div>
SkCanvas()
</pre>
-Creates an empty canvas with no backing device or pixels, with
+Creates an empty <a href="#Canvas">Canvas</a> with no backing device or pixels, with
a width and height of zero.
### Return Value
-empty canvas
+empty <a href="#Canvas">Canvas</a>
### Example
@@ -310,11 +310,11 @@ SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr)
Creates <a href="#Canvas">Canvas</a> of the specified dimensions without a <a href="undocumented#Surface">Surface</a>.
Used by <a href="undocumented#Subclasses">Subclasses</a> with custom implementations for draw methods.
-If <a href="#SkCanvas_int_int_const_SkSurfaceProps_star_props">props</a> equals nullptr, <a href="#Properties">Surface Properties</a> are created with <a href="#Properties_Legacy_Font_Host">Surface Properties Legacy Font Host</a> settings,
-which choose the pixel striping direction and order. Since a platform may dynamically
-change its direction when the device is rotated, and since a platform may have
-multiple monitors with different characteristics, it's best not to rely on this
-legacy behavior.
+If <a href="#SkCanvas_int_int_const_SkSurfaceProps_star_props">props</a> equals nullptr, <a href="#Properties">Surface Properties</a> are created with
+<a href="#Properties_Legacy_Font_Host">Surface Properties Legacy Font Host</a> settings, which choose the pixel striping
+direction and order. Since a platform may dynamically change its direction when
+the device is rotated, and since a platform may have multiple monitors with
+different characteristics, it is best not to rely on this legacy behavior.
### Parameters
@@ -981,7 +981,7 @@ Does not copy, and returns false if:
<td>Source and destination rectangles do not intersect.</td> </tr> <tr>
<td><a href="#Canvas">Canvas</a> pixels could not be converted to <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.colorType() or <a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.alphaType().</td> </tr> <tr>
<td><a href="#Canvas">Canvas</a> pixels are not readable; for instance, <a href="#Canvas">Canvas</a> is document-based.</td> </tr> <tr>
- <td><a href="undocumented#Pixmap">Pixmap</a> pixels could not be allocated.</td> </tr> <tr>
+ <td><a href="SkPixmap_Reference#Pixmap">Pixmap</a> pixels could not be allocated.</td> </tr> <tr>
<td><a href="#SkCanvas_readPixels_2_pixmap">pixmap</a>.rowBytes() is too small to contain one row of pixels.</td> </tr>
</table>
@@ -1130,7 +1130,7 @@ width, height, <a href="#Color_Type">Image Color Type</a>, and <a href="#Alpha_T
</tr> <tr> <td><a name="SkCanvas_writePixels_pixels"> <code><strong>pixels </strong></code> </a></td> <td>
<a href="#SkCanvas_writePixels_pixels">pixels</a> to copy, of size <a href="#SkCanvas_writePixels_info">info</a>.height() times <a href="#SkCanvas_writePixels_rowBytes">rowBytes</a>, or larger</td>
</tr> <tr> <td><a name="SkCanvas_writePixels_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td>
-size of one <a href="#SkCanvas_writePixels_pixels">pixels</a> row; <a href="#SkCanvas_writePixels_info">info</a>.width() times pixel size, or larger</td>
+size of one row of <a href="#SkCanvas_writePixels_pixels">pixels</a>; <a href="#SkCanvas_writePixels_info">info</a>.width() times pixel size, or larger</td>
</tr> <tr> <td><a name="SkCanvas_writePixels_x"> <code><strong>x </strong></code> </a></td> <td>
offset into <a href="#Canvas">Canvas</a> writable <a href="#SkCanvas_writePixels_pixels">pixels</a> in <a href="#SkCanvas_writePixels_x">x</a>; may be negative</td>
</tr> <tr> <td><a name="SkCanvas_writePixels_y"> <code><strong>y </strong></code> </a></td> <td>
@@ -2730,7 +2730,7 @@ graphics state used to fill <a href="#Canvas">Canvas</a></td>
enum <a href="#SkCanvas_PointMode">PointMode</a> {
<a href="#SkCanvas_kPoints_PointMode">kPoints PointMode</a>,
<a href="#SkCanvas_kLines_PointMode">kLines PointMode</a>,
-<a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>
+<a href="#SkCanvas_kPolygon_PointMode">kPolygon PointMode</a>,
};</pre>
Selects if an array of points are drawn as discrete points, as lines, or as
@@ -3692,7 +3692,7 @@ void drawImageNine(const SkImage* image, const SkIRect& center,
const SkRect& dst, const SkPaint* paint = nullptr)
</pre>
-Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_dst">dst</a>.
+Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_image">image</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_dst">dst</a>.
<a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_center">center</a> divides the <a href="#SkCanvas_drawImageNine_image">image</a> into nine sections: four sides, four corners, and
the <a href="#SkCanvas_drawImageNine_center">center</a>. Corners are unmodified or scaled down proportionately if their sides
are larger than <a href="#SkCanvas_drawImageNine_dst">dst</a>; <a href="#SkCanvas_drawImageNine_center">center</a> and four sides are scaled to fit remaining space, if any.
@@ -3735,7 +3735,7 @@ void drawImageNine(const sk_sp<SkImage>& image, const SkIRect& center,
const SkRect& dst, const SkPaint* paint = nullptr)
</pre>
-Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_2_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_2_dst">dst</a>.
+Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageNine_2_image">image</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageNine_2_dst">dst</a>.
<a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawImageNine_2_center">center</a> divides the <a href="#SkCanvas_drawImageNine_2_image">image</a> into nine sections: four sides, four corners, and
the <a href="#SkCanvas_drawImageNine_2_center">center</a>. Corners are not scaled, or scaled down proportionately if their sides
are larger than <a href="#SkCanvas_drawImageNine_2_dst">dst</a>; <a href="#SkCanvas_drawImageNine_2_center">center</a> and four sides are scaled to fit remaining space, if any.
@@ -3958,7 +3958,7 @@ void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint* paint = nullptr)
</pre>
-Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapNine_dst">dst</a>.
+Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapNine_dst">dst</a>.
<a href="undocumented#IRect">IRect</a> <a href="#SkCanvas_drawBitmapNine_center">center</a> divides the <a href="#SkCanvas_drawBitmapNine_bitmap">bitmap</a> into nine sections: four sides, four corners,
and the <a href="#SkCanvas_drawBitmapNine_center">center</a>. Corners are not scaled, or scaled down proportionately if their
sides are larger than <a href="#SkCanvas_drawBitmapNine_dst">dst</a>; <a href="#SkCanvas_drawBitmapNine_center">center</a> and four sides are scaled to fit remaining
@@ -4085,7 +4085,7 @@ void drawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice,
const SkRect& dst, const SkPaint* paint = nullptr)
</pre>
-Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapLattice_dst">dst</a>.
+Draw <a href="undocumented#Bitmap">Bitmap</a> <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawBitmapLattice_dst">dst</a>.
<a href="#SkCanvas_Lattice">Lattice</a> <a href="#SkCanvas_drawBitmapLattice_lattice">lattice</a> divides <a href="#SkCanvas_drawBitmapLattice_bitmap">bitmap</a> into a rectangular grid.
Each intersection of an even-numbered row and column is fixed; like the corners
@@ -4137,7 +4137,7 @@ void drawImageLattice(const SkImage* image, const Lattice& lattice,
const SkRect& dst, const SkPaint* paint = nullptr)
</pre>
-Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageLattice_image">image</a> stretched differentially to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageLattice_dst">dst</a>.
+Draw <a href="undocumented#Image">Image</a> <a href="#SkCanvas_drawImageLattice_image">image</a> stretched proportionally to fit into <a href="undocumented#Rect">Rect</a> <a href="#SkCanvas_drawImageLattice_dst">dst</a>.
<a href="#SkCanvas_Lattice">Lattice</a> <a href="#SkCanvas_drawImageLattice_lattice">lattice</a> divides <a href="#SkCanvas_drawImageLattice_image">image</a> into a rectangular grid.
Each intersection of an even-numbered row and column is fixed; like the corners
diff --git a/site/user/api/SkPaint_Reference.md b/site/user/api/SkPaint_Reference.md
index cbb77e720d..a9fa76e3d3 100644
--- a/site/user/api/SkPaint_Reference.md
+++ b/site/user/api/SkPaint_Reference.md
@@ -332,7 +332,7 @@ SK_ColorBLUE == paint2.getColor()
SkPaint(SkPaint&& paint)
</pre>
-Implements a move constructor to avoid incrementing the reference counts
+Implements a move constructor to avoid increasing the reference counts
of objects referenced by the <a href="#SkPaint_move_SkPaint_paint">paint</a>.
After the call, <a href="#SkPaint_move_SkPaint_paint">paint</a> is undefined, and can be safely destructed.
@@ -450,7 +450,7 @@ SK_ColorRED == paint2.getColor()
SkPaint& operator=(SkPaint&& paint)
</pre>
-Moves the <a href="#SkPaint_move_assignment_operator_paint">paint</a> to avoid incrementing the reference counts
+Moves the <a href="#SkPaint_move_assignment_operator_paint">paint</a> to avoid increasing the reference counts
of objects referenced by the <a href="#SkPaint_move_assignment_operator_paint">paint</a> parameter. Objects containing <a href="undocumented#Reference_Count">Reference Count</a> in the
prior destination are decreased by one; those objects are deleted if the resulting count
is zero.
@@ -1143,7 +1143,7 @@ When <a href="SkPaint_Reference#Subpixel_Text">Subpixel Text</a> is enabled, the
<a href="SkPaint_Reference#Linear_Text">Linear Text</a> selects whether text is rendered as a <a href="undocumented#Glyph">Glyph</a> or as a <a href="SkPath_Reference#Path">Path</a>.
If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is set, it has the same effect as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNormal_Hinting">kNormal Hinting</a>.
-If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is clear, it's the same as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a>.
+If <a href="#SkPaint_kLinearText_Flag">kLinearText Flag</a> is clear, it is the same as setting <a href="#SkPaint_Hinting">Hinting</a> to <a href="#SkPaint_kNo_Hinting">kNo Hinting</a>.
<a name="SkPaint_isLinearText"></a>
## isLinearText
@@ -2825,7 +2825,7 @@ void setShader(sk_sp<SkShader> shader)
Optional colors used when filling a path, such as a gradient.
-Sets <a href="undocumented#Shader">Shader</a> to <a href="#SkPaint_setShader_shader">shader</a>, decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Shader">Shader</a>.
+Sets <a href="undocumented#Shader">Shader</a> to <a href="#SkPaint_setShader_shader">shader</a>, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Shader">Shader</a>.
Does not alter <a href="#SkPaint_setShader_shader">shader</a> <a href="undocumented#Reference_Count">Reference Count</a>.
### Parameters
@@ -2917,7 +2917,7 @@ color filter unique: false
void setColorFilter(sk_sp<SkColorFilter> colorFilter)
</pre>
-Sets <a href="undocumented#Color_Filter">Color Filter</a> to filter, decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Color_Filter">Color Filter</a>.
+Sets <a href="undocumented#Color_Filter">Color Filter</a> to filter, decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Color_Filter">Color Filter</a>.
Pass nullptr to clear <a href="undocumented#Color_Filter">Color Filter</a>.
Does not alter filter <a href="undocumented#Reference_Count">Reference Count</a>.
@@ -3115,7 +3115,7 @@ void setPathEffect(sk_sp<SkPathEffect> pathEffect)
</pre>
Sets <a href="undocumented#Path_Effect">Path Effect</a> to <a href="#SkPaint_setPathEffect_pathEffect">pathEffect</a>,
-decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Path_Effect">Path Effect</a>.
+decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Path_Effect">Path Effect</a>.
Pass nullptr to leave the path geometry unaltered.
Does not alter <a href="#SkPaint_setPathEffect_pathEffect">pathEffect</a> <a href="undocumented#Reference_Count">Reference Count</a>.
@@ -3209,7 +3209,7 @@ void setMaskFilter(sk_sp<SkMaskFilter> maskFilter)
</pre>
Sets <a href="undocumented#Mask_Filter">Mask Filter</a> to <a href="#SkPaint_setMaskFilter_maskFilter">maskFilter</a>,
-decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Mask_Filter">Mask Filter</a>.
+decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Mask_Filter">Mask Filter</a>.
Pass nullptr to clear <a href="undocumented#Mask_Filter">Mask Filter</a> and leave <a href="undocumented#Mask_Filter">Mask Filter</a> effect on <a href="undocumented#Mask_Alpha">Mask Alpha</a> unaltered.
Does not affect <a href="undocumented#Rasterizer">Rasterizer</a>.
Does not alter <a href="#SkPaint_setMaskFilter_maskFilter">maskFilter</a> <a href="undocumented#Reference_Count">Reference Count</a>.
@@ -3302,7 +3302,7 @@ void setTypeface(sk_sp<SkTypeface> typeface)
</pre>
Sets <a href="undocumented#Typeface">Typeface</a> to <a href="#SkPaint_setTypeface_typeface">typeface</a>,
-decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Typeface">Typeface</a>.
+decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Typeface">Typeface</a>.
Pass nullptr to clear <a href="undocumented#Typeface">Typeface</a> and use the default <a href="#SkPaint_setTypeface_typeface">typeface</a>.
Does not alter <a href="#SkPaint_setTypeface_typeface">typeface</a> <a href="undocumented#Reference_Count">Reference Count</a>.
@@ -3399,7 +3399,7 @@ void setRasterizer(sk_sp<SkRasterizer> rasterizer)
</pre>
Sets <a href="undocumented#Rasterizer">Rasterizer</a> to <a href="#SkPaint_setRasterizer_rasterizer">rasterizer</a>,
-decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Rasterizer">Rasterizer</a>.
+decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Rasterizer">Rasterizer</a>.
Pass nullptr to clear <a href="undocumented#Rasterizer">Rasterizer</a> and leave <a href="undocumented#Rasterizer">Rasterizer</a> effect on <a href="undocumented#Mask_Alpha">Mask Alpha</a> unaltered.
Does not affect <a href="undocumented#Mask_Filter">Mask Filter</a>.
Does not alter <a href="#SkPaint_setRasterizer_rasterizer">rasterizer</a> <a href="undocumented#Reference_Count">Reference Count</a>.
@@ -3496,7 +3496,7 @@ void setImageFilter(sk_sp<SkImageFilter> imageFilter)
</pre>
Sets <a href="undocumented#Image_Filter">Image Filter</a> to <a href="#SkPaint_setImageFilter_imageFilter">imageFilter</a>,
-decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Image_Filter">Image Filter</a>.
+decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="undocumented#Image_Filter">Image Filter</a>.
Pass nullptr to clear <a href="undocumented#Image_Filter">Image Filter</a>, and remove <a href="undocumented#Image_Filter">Image Filter</a> effect
on drawing.
Does not affect <a href="undocumented#Rasterizer">Rasterizer</a> or <a href="undocumented#Mask_Filter">Mask Filter</a>.
@@ -3609,7 +3609,7 @@ void setDrawLooper(sk_sp<SkDrawLooper> drawLooper)
</pre>
Sets <a href="undocumented#Draw_Looper">Draw Looper</a> to <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>,
-decrementing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>.
+decreasing <a href="undocumented#Reference_Count">Reference Count</a> of the previous <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a>.
Pass nullptr to clear <a href="undocumented#Draw_Looper">Draw Looper</a> and leave <a href="undocumented#Draw_Looper">Draw Looper</a> effect on drawing unaltered.
Does not alter <a href="#SkPaint_setDrawLooper_drawLooper">drawLooper</a> <a href="undocumented#Reference_Count">Reference Count</a>.
@@ -3947,11 +3947,11 @@ All character encoding are able to represent all of <a href="undocumented#Unicod
in the total storage required.
<a href="undocumented#UTF_8">UTF-8</a> (<a href="undocumented#RFC">RFC</a> 3629)is made up of 8-bit bytes,
-and is a superset of <a href="undocumented#ASCII">ASCII</a>.
-<a href="undocumented#UTF_16">UTF-16</a> (<a href="undocumented#RFC">RFC</a> 2781)is made up of 16-bit words,
-and is a superset of <a href="undocumented#Unicode">Unicode</a> ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF.
-<a href="undocumented#UTF_32">UTF-32</a>is
-made up of 32-bit words, and is a superset of <a href="undocumented#Unicode">Unicode</a>.
+and encodes <a href="undocumented#ASCII">ASCII</a> in one byte, and all valid code points in <a href="undocumented#Unicode">Unicode</a> in multiple bytes.
+<a href="undocumented#UTF_16">UTF-16</a> (<a href="undocumented#RFC">RFC</a> 2781)uses one or two 16-bit words,
+and encodes <a href="undocumented#Unicode">Unicode</a> ranges 0x0000 to 0xD7FF and 0xE000 to 0xFFFF in one word.
+<a href="undocumented#UTF_32">UTF-32</a>describes
+a 32-bit word, which encodes all code points in <a href="undocumented#Unicode">Unicode</a>.
<a href="undocumented#Font_Manager">Font Manager</a> uses font data to convert character code points into glyph indices.
A glyph index is a 16-bit word.
diff --git a/site/user/api/SkPixmap_Reference.md b/site/user/api/SkPixmap_Reference.md
new file mode 100644
index 0000000000..8fc14c4d86
--- /dev/null
+++ b/site/user/api/SkPixmap_Reference.md
@@ -0,0 +1,2066 @@
+SkPixmap Reference
+===
+
+# <a name="Pixmap"></a> Pixmap
+
+# <a name="SkPixmap"></a> Class SkPixmap
+<a href="#Pixmap">Pixmap</a> provides a utility to pair <a href="undocumented#SkImageInfo">SkImageInfo</a> with pixels and row bytes.
+<a href="#Pixmap">Pixmap</a> is a low level class which provides convenience functions to access
+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
+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 name="Overview"></a> Overview
+
+## <a name="Subtopics"></a> Subtopics
+
+| topics | description |
+| --- | --- |
+| <a href="#Image_Info_Access">Image Info Access</a> | Returns all or part of <a href="#Info">Image Info</a>. |
+| <a href="#Initialization">Initialization</a> | Sets fields for use. |
+| <a href="#Reader">Reader</a> | Examine pixel value. |
+| <a href="#Writer">Writer</a> | Copy to pixel values. |
+| <a href="#Readable_Address">Readable Address</a> | Returns read only pixels. |
+| <a href="#Writable_Address">Writable Address</a> | Returns writable pixels. |
+
+## <a name="Constructors"></a> Constructors
+
+| | description |
+| --- | --- |
+| <a href="#SkPixmap_empty_constructor">SkPixmap()</a> | Constructs with default values. |
+| <a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> | Constructs from <a href="#Info">Image Info</a>, pixels. |
+
+## <a name="Member_Functions"></a> Member Functions
+
+| function | description |
+| --- | --- |
+| <a href="#SkPixmap_addr">addr</a> | Returns readable pixel address as void pointer. |
+| <a href="#SkPixmap_addr16">addr16</a> | Returns readable pixel address as 16-bit pointer. |
+| <a href="#SkPixmap_addr32">addr32</a> | Returns readable pixel address as 32-bit pointer. |
+| <a href="#SkPixmap_addr64">addr64</a> | Returns readable pixel address as 64-bit pointer. |
+| <a href="#SkPixmap_addr8">addr8</a> | Returns readable pixel address as 8-bit pointer. |
+| <a href="#SkPixmap_addrF16">addrF16</a> | Returns readable pixel component address as 16-bit pointer. |
+| <a href="#SkPixmap_alphaType">alphaType</a> | Returns <a href="#Info">Image Info</a> <a href="undocumented#Alpha_Type">Alpha Type</a>. |
+| <a href="#SkPixmap_bounds">bounds</a> | Returns <a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_height">height</a> as Rectangle. |
+| <a href="#SkPixmap_colorSpace">colorSpace</a> | Returns <a href="#Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a>. |
+| <a href="#SkPixmap_colorType">colorType</a> | Returns <a href="#Info">Image Info</a> <a href="undocumented#Color_Type">Color Type</a>. |
+| <a href="#SkPixmap_computeIsOpaque">computeIsOpaque</a> | Returns true if all pixels are opaque. |
+| <a href="#SkPixmap_erase">erase</a> | Writes <a href="undocumented#Color">Color</a> to pixels. |
+| <a href="#SkPixmap_extractSubset">extractSubset</a> | Sets pointer to portion of original. |
+| <a href="#SkPixmap_getColor">getColor</a> | Returns one pixel as <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a>. |
+| <a href="#SkPixmap_getSafeSize">getSafeSize</a> | Returns minimum size required for pixels in 32 bits. |
+| <a href="#SkPixmap_getSafeSize64">getSafeSize64</a> | Returns minimum size required for pixels in 64 bits. |
+| <a href="#SkPixmap_getSize64">getSize64</a> | Returns conservative size required for pixels. |
+| <a href="#SkPixmap_height">height</a> | Returns pixel row count. |
+| <a href="#SkPixmap_info">info</a> | Returns <a href="#Info">Image Info</a>. |
+| <a href="#SkPixmap_isOpaque">isOpaque</a> | Returns true if <a href="#Info">Image Info</a> describes opaque pixels. |
+| <a href="#SkPixmap_readPixels">readPixels</a> | Copies and converts pixels. |
+| <a href="#SkPixmap_reset">reset</a> | Reuses existing <a href="#Pixmap">Pixmap</a> with replacement values. |
+| <a href="#SkPixmap_rowBytes">rowBytes</a> | Returns interval between rows in bytes. |
+| <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> | Returns interval between rows in pixels. |
+| <a href="#SkPixmap_scalePixels">scalePixels</a> | Scales and converts pixels. |
+| <a href="#SkPixmap_setColorSpace">setColorSpace</a> | Sets <a href="#Info">Image Info</a> <a href="undocumented#Color_Space">Color Space</a>. |
+| <a href="#SkPixmap_shiftPerPixel">shiftPerPixel</a> | Returns bit shift from pixels to bytes. |
+| <a href="#SkPixmap_width">width</a> | Returns pixel column count. |
+| <a href="#SkPixmap_writable_addr">writable addr</a> | Returns writable pixel address as void pointer. |
+| <a href="#SkPixmap_writable_addr16">writable addr16</a> | Returns writable pixel address as 16-bit pointer. |
+| <a href="#SkPixmap_writable_addr32">writable addr32</a> | Returns writable pixel address as 32-bit pointer. |
+| <a href="#SkPixmap_writable_addr64">writable addr64</a> | Returns writable pixel address as 64-bit pointer. |
+| <a href="#SkPixmap_writable_addr8">writable addr8</a> | Returns writable pixel address as 8-bit pointer. |
+| <a href="#SkPixmap_writable_addrF16">writable addrF16</a> | Returns writable pixel component address as 16-bit pointer. |
+
+## <a name="Initialization"></a> Initialization
+
+<a name="SkPixmap_empty_constructor"></a>
+## SkPixmap
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+SkPixmap()
+</pre>
+
+Creates an empty <a href="#Pixmap">Pixmap</a> without pixels, with <a href="undocumented#SkColorType">kUnknown SkColorType</a>, with
+<a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, and with a <a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_height">height</a> of zero. Use
+<a href="#SkPixmap_reset">reset</a> to associate pixels, <a href="undocumented#SkColorType">SkColorType</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, <a href="#SkPixmap_width">width</a>, and <a href="#SkPixmap_height">height</a>
+after <a href="#Pixmap">Pixmap</a> has been created.
+
+### Return Value
+
+empty <a href="#Pixmap">Pixmap</a>
+
+### Example
+
+<div><fiddle-embed name="7befb4876e17f4bfc89ae8c54aef8660">
+
+#### Example Output
+
+~~~~
+width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType
+width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href="#SkPixmap_reset">reset</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a>
+
+---
+
+<a name="SkPixmap_const_SkImageInfo_const_star"></a>
+## SkPixmap
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes)
+</pre>
+
+Creates <a href="#Pixmap">Pixmap</a> from <a href="#SkPixmap_info">info</a> <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and <a href="undocumented#SkColorType">SkColorType</a>.
+<a href="#SkPixmap_addr">addr</a> points to pixels, or nullptr. <a href="#SkPixmap_rowBytes">rowBytes</a> should be<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_width">width</a> * <a href="#SkPixmap_info">info</a>.bytesPerPixel()or larger.
+
+No parameter checking is performed; it is up to the caller to ensure that
+<a href="#SkPixmap_addr">addr</a> and <a href="#SkPixmap_rowBytes">rowBytes</a> agree with <a href="#SkPixmap_info">info</a>.
+
+The memory lifetime pixels are managed by the caller. When <a href="#Pixmap">Pixmap</a> goes
+out of scope, <a href="#SkPixmap_addr">addr</a> is unaffected.
+
+<a href="#Pixmap">Pixmap</a> may be later modified by <a href="#SkPixmap_reset">reset</a> to change its size, pixel type, or
+storage.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_info"> <code><strong>info </strong></code> </a></td> <td>
+<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, <a href="undocumented#SkColorType">SkColorType</a> of <a href="#Info">Image Info</a></td>
+ </tr> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_addr"> <code><strong>addr </strong></code> </a></td> <td>
+pointer to pixels allocated by caller; may be nullptr</td>
+ </tr> <tr> <td><a name="SkPixmap_const_SkImageInfo_const_star_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td>
+size of one row of <a href="#SkPixmap_addr">addr</a>; <a href="#SkPixmap_width">width</a> times pixel size, or larger</td>
+ </tr>
+</table>
+
+### Return Value
+
+initialized <a href="#Pixmap">Pixmap</a>
+
+### Example
+
+<div><fiddle-embed name="9a00774be57d7308313b3a9073e6e696"><div><a href="#SkImage_MakeRasterCopy">SkImage::MakeRasterCopy</a> takes const <a href="#SkPixmap">SkPixmap</a>& as an argument. The example
+constructs a <a href="#SkPixmap">SkPixmap</a> from the brace-delimited parameters.</div>
+
+#### Example Output
+
+~~~~
+image alpha only = false
+copy alpha only = true
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_empty_constructor">SkPixmap()</a> <a href="#SkPixmap_reset">reset</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a>
+
+---
+
+<a name="SkPixmap_reset"></a>
+## reset
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+void reset()
+</pre>
+
+Sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, row bytes to zero; pixel address to nullptr; <a href="undocumented#SkColorType">SkColorType</a> to
+<a href="undocumented#SkColorType">kUnknown SkColorType</a>; and <a href="undocumented#SkAlphaType">SkAlphaType</a> to <a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>.
+
+The prior pixels are unaffected; it is up to the caller to release pixels
+memory if desired.
+
+### Example
+
+<div><fiddle-embed name="759feda9c22260f96567b9e2ccc1a118">
+
+#### Example Output
+
+~~~~
+width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType
+width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_empty_constructor">SkPixmap()</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+void reset(const SkImageInfo& info, const void* addr, size_t rowBytes)
+</pre>
+
+Sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and <a href="undocumented#SkColorType">SkColorType</a> from <a href="#SkPixmap_info">info</a>.
+Sets pixel address from <a href="#SkPixmap_addr">addr</a>, which may be nullptr.
+Sets row bytes from <a href="#SkPixmap_rowBytes">rowBytes</a>, which should be<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_width">width</a> * <a href="#SkPixmap_info">info</a>.bytesPerPixel()or larger.
+
+Does not check <a href="#SkPixmap_addr">addr</a>. Asserts if built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined and if <a href="#SkPixmap_rowBytes">rowBytes</a> is
+too small to hold one row of pixels.
+
+The memory lifetime pixels are managed by the caller. When <a href="#Pixmap">Pixmap</a> goes
+out of scope, <a href="#SkPixmap_addr">addr</a> is unaffected.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_reset_2_info"> <code><strong>info </strong></code> </a></td> <td>
+<a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, <a href="undocumented#SkColorType">SkColorType</a> of <a href="#Info">Image Info</a></td>
+ </tr> <tr> <td><a name="SkPixmap_reset_2_addr"> <code><strong>addr </strong></code> </a></td> <td>
+pointer to pixels allocated by caller; may be nullptr</td>
+ </tr> <tr> <td><a name="SkPixmap_reset_2_rowBytes"> <code><strong>rowBytes </strong></code> </a></td> <td>
+size of one row of <a href="#SkPixmap_addr">addr</a>; <a href="#SkPixmap_width">width</a> times pixel size, or larger</td>
+ </tr>
+</table>
+
+### Example
+
+<div><fiddle-embed name="c8e31733704bfebdb038b003aa8a62d7"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_const_SkImageInfo_const_star">SkPixmap(const SkImageInfo& info, const void* addr, size t rowBytes)</a> <a href="#SkPixmap_reset">reset</a> <a href="undocumented#SkAlphaType">SkAlphaType</a> <a href="undocumented#SkColorType">SkColorType</a>
+
+---
+
+<a name="SkPixmap_setColorSpace"></a>
+## setColorSpace
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+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
+<a href="undocumented#SkColorType">SkColorType</a> in <a href="undocumented#Image">Image</a>, and leaves pixel address and row bytes unchanged.
+<a href="#SkPixmap_colorSpace">colorSpace</a> reference count is incremented.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_setColorSpace_colorSpace"> <code><strong>colorSpace </strong></code> </a></td> <td>
+<a href="undocumented#Color_Space">Color Space</a> moved to <a href="#Info">Image Info</a></td>
+ </tr>
+</table>
+
+### Example
+
+<div><fiddle-embed name="bc42aea1e30b7234544bc25b4fc09dd0">
+
+#### Example Output
+
+~~~~
+is unique
+is not unique
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="undocumented#Color_Space">Color Space</a> <a href="#SkImageInfo_makeColorSpace">SkImageInfo::makeColorSpace</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool SK_WARN_UNUSED_RESULT reset(const SkMask& mask)
+</pre>
+
+Sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, pixel address, and row bytes to <a href="undocumented#Mask">Mask</a> properties, if <a href="undocumented#Mask">Mask</a>
+format is <a href="#SkMask_kA8_Format">SkMask::kA8 Format</a>; and returns true. Otherwise sets <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>,
+row bytes to zero; pixel address to nullptr; <a href="undocumented#SkColorType">SkColorType</a> to <a href="undocumented#SkColorType">kUnknown SkColorType</a>;
+and <a href="undocumented#SkAlphaType">SkAlphaType</a> to <a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>; and returns false.
+
+Failing to read the return value generates a compile time warning.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_reset_3_mask"> <code><strong>mask </strong></code> </a></td> <td>
+<a href="undocumented#Mask">Mask</a> containing pixels and dimensions</td>
+ </tr>
+</table>
+
+### Return Value
+
+true if set to <a href="undocumented#Mask">Mask</a> properties
+
+### Example
+
+<div><fiddle-embed name="379761a97bd7a116638a34eb3e80bf0d">
+
+#### Example Output
+
+~~~~
+success: true width: 2 height: 2
+success: false width: 0 height: 0
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="undocumented#Mask">Mask</a> <a href="#SkPixmap_reset">reset</a>
+
+---
+
+<a name="SkPixmap_extractSubset"></a>
+## extractSubset
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool SK_WARN_UNUSED_RESULT extractSubset(SkPixmap* subset, const SkIRect& area) const
+</pre>
+
+Sets <a href="#SkPixmap_extractSubset_subset">subset</a> <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, pixel address to intersection of <a href="#Pixmap">Pixmap</a> with <a href="#SkPixmap_extractSubset_area">area</a>,
+if intersection is not empty; and return true. Otherwise, leave <a href="#SkPixmap_extractSubset_subset">subset</a> unchanged
+and return false.
+
+Failing to read the return value generates a compile time warning.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_extractSubset_subset"> <code><strong>subset </strong></code> </a></td> <td>
+storage for <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, pixel address of intersection</td>
+ </tr> <tr> <td><a name="SkPixmap_extractSubset_area"> <code><strong>area </strong></code> </a></td> <td>
+<a href="#SkPixmap_bounds">bounds</a> to intersect with <a href="#Pixmap">Pixmap</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+true if intersection of <a href="#Pixmap">Pixmap</a> and <a href="#SkPixmap_extractSubset_area">area</a> is not empty
+
+### Example
+
+<div><fiddle-embed name="febdbfac6cf4cde69837643be2e1f6dd"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_reset">reset</a> <a href="#SkIRect_intersect">SkIRect::intersect</a>
+
+---
+
+## <a name="Image_Info_Access"></a> Image Info Access
+
+<a name="SkPixmap_info"></a>
+## info
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const SkImageInfo& info() const
+</pre>
+
+Returns <a href="#SkPixmap_width">width</a>, <a href="#SkPixmap_height">height</a>, <a href="undocumented#SkAlphaType">SkAlphaType</a>, and <a href="undocumented#SkColorType">SkColorType</a>.
+
+### Return Value
+
+reference to ImageInfo
+
+### Example
+
+<div><fiddle-embed name="7294fbffeb15bf062b6ce989719b783f">
+
+#### Example Output
+
+~~~~
+width: 384 height: 384 color: BGRA_8888 alpha: Opaque
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#Info">Image Info</a>
+
+---
+
+<a name="SkPixmap_rowBytes"></a>
+## rowBytes
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+size_t rowBytes() const
+</pre>
+
+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.
+
+### Return Value
+
+byte length of pixel row
+
+### Example
+
+<div><fiddle-embed name="da5e1f7f49891d3805a5a6103a000eff">
+
+#### Example Output
+
+~~~~
+rowBytes: 2 minRowBytes: 4
+rowBytes: 8 minRowBytes: 4
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_info">info</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>
+
+---
+
+<a name="SkPixmap_addr"></a>
+## addr
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const void* addr() const
+</pre>
+
+Returns pixel address, the base corresponding the pixel origin.
+
+It is up to the <a href="#Pixmap">Pixmap</a> creator to ensure that pixel address is a useful value.
+
+### Return Value
+
+pixel address
+
+### Example
+
+<div><fiddle-embed name="17bcabaaee2dbb7beba562e9ca50b55e">
+
+#### Example Output
+
+~~~~
+#Volatile
+pixels address: 0x7f2a440bb010
+inset address: 0x7f2a440fb210
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr_2">addr(int x, int y)</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_info">info</a> <a href="#SkPixmap_rowBytes">rowBytes</a>
+
+---
+
+<a name="SkPixmap_width"></a>
+## width
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+int width() const
+</pre>
+
+Returns pixel count in each pixel row. Should be equal or less than:
+<a href="#SkPixmap_rowBytes">rowBytes</a> / <a href="#SkPixmap_info">info</a>.bytesPerPixel().
+
+### Return Value
+
+pixel <a href="#SkPixmap_width">width</a> in <a href="#Info">Image Info</a>
+
+### Example
+
+<div><fiddle-embed name="f68617b7153a20b2ed3d7f9ed5c6e5e4">
+
+#### Example Output
+
+~~~~
+pixmap width: 16 info width: 16
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_height">height</a>
+
+---
+
+<a name="SkPixmap_height"></a>
+## height
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+int height() const
+</pre>
+
+Returns pixel row count.
+
+### Return Value
+
+pixel <a href="#SkPixmap_height">height</a> in <a href="#Info">Image Info</a>
+
+### Example
+
+<div><fiddle-embed name="cf80286d58a00cb0328c4205b6517755">
+
+#### Example Output
+
+~~~~
+pixmap height: 32 info height: 32
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_width">width</a>
+
+---
+
+<a name="SkPixmap_colorType"></a>
+## colorType
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+SkColorType colorType() const
+</pre>
+
+Returns <a href="undocumented#Color_Type">Color Type</a>, one of: <a href="undocumented#SkColorType">kUnknown SkColorType</a>, <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>,
+<a href="undocumented#SkColorType">kRGB 565 SkColorType</a>, <a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a>,
+<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a>.
+
+### Return Value
+
+<a href="undocumented#Color_Type">Color Type</a> in <a href="#Info">Image Info</a>
+
+### Example
+
+<div><fiddle-embed name="57cebd9fc88c4dfe04b20d0ff34f77fd">
+
+#### Example Output
+
+~~~~
+color type: kAlpha_SkColorType
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_alphaType">alphaType</a>
+
+---
+
+<a name="SkPixmap_alphaType"></a>
+## alphaType
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+SkAlphaType alphaType() const
+</pre>
+
+Returns <a href="undocumented#Alpha_Type">Alpha Type</a>, one of: <a href="undocumented#SkAlphaType">kUnknown SkAlphaType</a>, <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>,
+<a href="undocumented#SkAlphaType">kPremul SkAlphaType</a>, <a href="undocumented#SkAlphaType">kUnpremul SkAlphaType</a>.
+
+### Return Value
+
+<a href="undocumented#Alpha_Type">Alpha Type</a> in <a href="#Info">Image Info</a>
+
+### Example
+
+<div><fiddle-embed name="070b1a60232be499eb10c6ea62371804">
+
+#### Example Output
+
+~~~~
+alpha type: kPremul_SkAlphaType
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_colorType">colorType</a>
+
+---
+
+<a name="SkPixmap_colorSpace"></a>
+## colorSpace
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+SkColorSpace* colorSpace() const
+</pre>
+
+Returns <a href="undocumented#Color_Space">Color Space</a> associated with <a href="#Info">Image Info</a>.
+
+### Return Value
+
+<a href="undocumented#Color_Space">Color Space</a> in <a href="#Info">Image Info</a>
+
+### Example
+
+<div><fiddle-embed name="34c71f803b8edb48eaf1cd0c55bb212e"><div><a href="#SkColorSpace_MakeSRGBLinear">SkColorSpace::MakeSRGBLinear</a> creates <a href="undocumented#Color_Space">Color Space</a> with linear gamma
+and an sRGB gamut. This <a href="undocumented#Color_Space">Color Space</a> gamma is not close to sRGB gamma.</div>
+
+#### Example Output
+
+~~~~
+gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="undocumented#Color_Space">Color Space</a>
+
+---
+
+<a name="SkPixmap_isOpaque"></a>
+## isOpaque
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+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.
+
+### Return Value
+
+true if <a href="#Info">Image Info</a> has opaque <a href="undocumented#Alpha_Type">Alpha Type</a>
+
+### Example
+
+<div><fiddle-embed name="efd083f121e888a523455ea8a49e50d1"><div><a href="#SkPixmap_isOpaque">isOpaque</a> ignores whether all pixels are opaque or not.</div>
+
+#### Example Output
+
+~~~~
+isOpaque: false
+isOpaque: false
+isOpaque: true
+isOpaque: true
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_computeIsOpaque">computeIsOpaque</a> <a href="#SkImageInfo_isOpaque">SkImageInfo::isOpaque</a>
+
+---
+
+<a name="SkPixmap_bounds"></a>
+## bounds
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+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> }.
+
+### Return Value
+
+integral rectangle from origin to <a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_height">height</a>
+
+### Example
+
+<div><fiddle-embed name="79750fb1d898a4e5c8c828b7bc9acec5">
+
+#### Example Output
+
+~~~~
+width: 0 height: 0 empty: true
+width: 0 height: 2 empty: true
+width: 2 height: 0 empty: true
+width: 2 height: 2 empty: false
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_height">height</a> <a href="#SkPixmap_width">width</a> <a href="undocumented#IRect">IRect</a>
+
+---
+
+<a name="SkPixmap_rowBytesAsPixels"></a>
+## rowBytesAsPixels
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+int rowBytesAsPixels() const
+</pre>
+
+Returns number of pixels that fit on row. Should be greater than or equal to
+<a href="#SkPixmap_width">width</a>.
+
+### Return Value
+
+maximum pixels per row
+
+### Example
+
+<div><fiddle-embed name="6231bb212d0c231b5bc44eac626fbcb5">
+
+#### Example Output
+
+~~~~
+rowBytes: 4 rowBytesAsPixels: 1
+rowBytes: 5 rowBytesAsPixels: 1
+rowBytes: 6 rowBytesAsPixels: 1
+rowBytes: 7 rowBytesAsPixels: 1
+rowBytes: 8 rowBytesAsPixels: 2
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_shiftPerPixel">shiftPerPixel</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a>
+
+---
+
+<a name="SkPixmap_shiftPerPixel"></a>
+## shiftPerPixel
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+int shiftPerPixel() const
+</pre>
+
+Returns bit shift converting row bytes to row pixels.
+Returns zero for <a href="undocumented#SkColorType">kUnknown SkColorType</a>.
+
+### Return Value
+
+one of: 0, 1, 2, 3; left shift to convert pixels to bytes
+
+### Example
+
+<div><fiddle-embed name="d91065811bb118dd686a2b94abe3360a">
+
+#### Example Output
+
+~~~~
+color: kUnknown_SkColorType bytesPerPixel: 0 shiftPerPixel: 0
+color: kAlpha_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
+color: kRGB_565_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
+color: kARGB_4444_SkColorType bytesPerPixel: 2 shiftPerPixel: 1
+color: kRGBA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2
+color: kBGRA_8888_SkColorType bytesPerPixel: 4 shiftPerPixel: 2
+color: kGray_8_SkColorType bytesPerPixel: 1 shiftPerPixel: 0
+color: kRGBA_F16_SkColorType bytesPerPixel: 8 shiftPerPixel: 3
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_rowBytes">rowBytes</a> <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> <a href="#SkPixmap_width">width</a> <a href="#SkImageInfo_bytesPerPixel">SkImageInfo::bytesPerPixel</a>
+
+---
+
+<a name="SkPixmap_getSize64"></a>
+## getSize64
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+uint64_t getSize64() const
+</pre>
+
+Returns conservative memory required for pixel storage.
+Includes unused memory on last row when <a href="#SkPixmap_rowBytesAsPixels">rowBytesAsPixels</a> exceeds <a href="#SkPixmap_width">width</a>.
+
+### Return Value
+
+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>
+
+---
+
+<a name="SkPixmap_getSafeSize64"></a>
+## getSafeSize64
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+uint64_t getSafeSize64() 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>.
+
+### Return Value
+
+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>
+
+---
+
+<a name="SkPixmap_getSafeSize"></a>
+## getSafeSize
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+size_t getSafeSize() 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 value is does not fit in a signed 32-bit integer.
+The largest value than can be returned is 2,147,483,647.
+
+### Return Value
+
+exact pixel storage size if size fits in signed 32 bits
+
+### Example
+
+<div><fiddle-embed name="1e2830708e4da1db886d8d7541af618b">
+
+#### 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
+~~~~
+
+</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 name="Reader"></a> Reader
+
+<a name="SkPixmap_computeIsOpaque"></a>
+## computeIsOpaque
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool computeIsOpaque() const
+</pre>
+
+Returns true if all pixels are opaque. <a href="undocumented#Color_Type">Color Type</a> determines how pixels
+are encoded, and whether pixel describes <a href="#Alpha">Alpha</a>. Returns true for <a href="undocumented#Color_Type">Color Types</a>
+without alpha for each pixel; for other <a href="undocumented#Color_Type">Color Types</a>, returns true if all
+pixels have alpha values equivalent to 1.0 or greater.
+
+For <a href="undocumented#Color_Type">Color Types</a> <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or <a href="undocumented#SkColorType">kGray 8 SkColorType</a>: always
+returns true. For <a href="undocumented#Color_Type">Color Types</a> <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>, <a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>,
+<a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a>: returns true if all pixel <a href="#Alpha">Alpha</a> values are 255.
+For <a href="undocumented#Color_Type">Color Type</a> <a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>: returns true if all pixel <a href="#Alpha">Alpha</a> values are 15.
+For <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a>: returns true if all pixel <a href="#Alpha">Alpha</a> values are 1.0 or
+greater.
+
+Returns false for any other <a href="undocumented#Color_Type">Color Type</a>.
+
+### Return Value
+
+true all pixels have opaque values or <a href="undocumented#Color_Type">Color Type</a> is opaque
+
+### Example
+
+<div><fiddle-embed name="6ef37d5be03d0bfaec992dbb5a94c66f">
+
+#### Example Output
+
+~~~~
+computeIsOpaque: false
+computeIsOpaque: true
+computeIsOpaque: false
+computeIsOpaque: true
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_isOpaque">isOpaque</a> <a href="undocumented#Color_Type">Color Type</a> <a href="#Alpha">Alpha</a>
+
+---
+
+<a name="SkPixmap_getColor"></a>
+## getColor
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+SkColor getColor(int x, int y) const
+</pre>
+
+Returns pixel at (<a href="#SkPixmap_getColor_x">x</a>, <a href="#SkPixmap_getColor_y">y</a>) as <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a>.
+Returns black with <a href="#Alpha">Alpha</a> if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>.
+
+Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_getColor_x">x</a> or <a href="#SkPixmap_getColor_y">y</a> trigger an assert() if
+built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined; and returns undefined values or may crash if
+<a href="undocumented#SK_RELEASE">SK RELEASE</a> is defined. Fails if <a href="undocumented#Color_Type">Color Type</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a> or
+pixel address is nullptr.
+
+<a href="undocumented#Color_Space">Color Space</a> in <a href="#Info">Image Info</a> is ignored. Some <a href="undocumented#Color">Color</a> precision may be lost in the
+conversion to <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a>; original pixel data may have additional
+precision.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_getColor_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_getColor_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+pixel converted to <a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a>
+
+### Example
+
+<div><fiddle-embed name="94ad244056dc80ecd87daae004266334">
+
+#### Example Output
+
+~~~~
+Premultiplied:
+(0, 0) 0x00000000 0x2a0e002a 0x55380055 0x7f7f007f
+(0, 1) 0x2a000e2a 0x551c1c55 0x7f542a7f 0xaaaa38aa
+(0, 2) 0x55003855 0x7f2a547f 0xaa7171aa 0xd4d48dd4
+(0, 3) 0x7f007f7f 0xaa38aaaa 0xd48dd4d4 0xffffffff
+Unpremultiplied:
+(0, 0) 0x00000000 0x2a5500ff 0x55a800ff 0x7fff00ff
+(0, 1) 0x2a0055ff 0x555454ff 0x7fa954ff 0xaaff54ff
+(0, 2) 0x5500a8ff 0x7f54a9ff 0xaaaaaaff 0xd4ffaaff
+(0, 3) 0x7f00ffff 0xaa54ffff 0xd4aaffff 0xffffffff
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_readPixels">readPixels</a>
+
+---
+
+## <a name="Readable_Address"></a> Readable Address
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+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>).
+
+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>.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_addr_2_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_addr_2_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+readable generic pointer to pixel
+
+### Example
+
+<div><fiddle-embed name="6e6e29e860eafed77308c973400cc84d">
+
+#### Example Output
+
+~~~~
+pixmap.addr(1, 2) == &storage[1 + 2 * w]
+~~~~
+
+</fiddle-embed></div>
+
+### 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 name="SkPixmap_addr8"></a>
+## addr8
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint8_t* addr8() const
+</pre>
+
+Returns readable base pixel address. Result is addressable as unsigned 8-bit bytes.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a> or
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One byte corresponds to one pixel.
+
+### Return Value
+
+readable unsigned 8-bit pointer to pixels
+
+### Example
+
+<div><fiddle-embed name="9adda80b2dd1b08ec5ccf66da7c8bd91">
+
+#### Example Output
+
+~~~~
+pixmap.addr8() == storage
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</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_writable_addr8">writable addr8</a>
+
+---
+
+<a name="SkPixmap_addr16"></a>
+## addr16
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint16_t* addr16() const
+</pre>
+
+Returns readable base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or
+<a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One word corresponds to one pixel.
+
+### Return Value
+
+readable unsigned 16-bit pointer to pixels
+
+### Example
+
+<div><fiddle-embed name="9b16012d265c954c6de13f3fc960da52">
+
+#### Example Output
+
+~~~~
+pixmap.addr16() == storage
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</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_writable_addr16">writable addr16</a>
+
+---
+
+<a name="SkPixmap_addr32"></a>
+## addr32
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint32_t* addr32() const
+</pre>
+
+Returns readable base pixel address. Result is addressable as unsigned 32-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a> or
+<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One word corresponds to one pixel.
+
+### Return Value
+
+readable unsigned 32-bit pointer to pixels
+
+### Example
+
+<div><fiddle-embed name="6b90c7ae9f254fe4ea9ef638f893a3e6">
+
+#### Example Output
+
+~~~~
+pixmap.addr32() == storage
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</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_writable_addr32">writable addr32</a>
+
+---
+
+<a name="SkPixmap_addr64"></a>
+## addr64
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint64_t* addr64() const
+</pre>
+
+Returns readable base pixel address. Result is addressable as unsigned 64-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built
+with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One word corresponds to one pixel.
+
+### Return Value
+
+readable unsigned 64-bit pointer to pixels
+
+### Example
+
+<div><fiddle-embed name="0d17085a4698a8a2e2235fad9041b4b4">
+
+#### Example Output
+
+~~~~
+pixmap.addr64() == storage
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr64">writable addr64</a>
+
+---
+
+<a name="SkPixmap_addrF16"></a>
+## addrF16
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint16_t* addrF16() const
+</pre>
+
+Returns readable base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built
+with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Each word represents one color component encoded as a half float.
+Four words correspond to one pixel.
+
+### Return Value
+
+readable unsigned 16-bit pointer to first component of pixels
+
+### Example
+
+<div><fiddle-embed name="54e8525a592f05623c33b375aebc90c1">
+
+#### Example Output
+
+~~~~
+pixmap.addrF16() == storage
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">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_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint8_t* addr8(int x, int y) const
+</pre>
+
+Returns readable pixel address at (<a href="#SkPixmap_addr8_2_x">x</a>, <a href="#SkPixmap_addr8_2_y">y</a>).
+
+Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr8_2_x">x</a> or <a href="#SkPixmap_addr8_2_y">y</a> trigger an assert() if
+built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a> or
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_addr8_2_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_addr8_2_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+readable unsigned 8-bit pointer to pixel at (<a href="#SkPixmap_addr8_2_x">x</a>, <a href="#SkPixmap_addr8_2_y">y</a>)
+
+### Example
+
+<div><fiddle-embed name="5b986272268ef2c52045c1856f8b6107">
+
+#### Example Output
+
+~~~~
+pixmap.addr8(1, 2) == &storage[1 + 2 * w]
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</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_writable_addr8">writable addr8</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint16_t* addr16(int x, int y) const
+</pre>
+
+Returns readable pixel address at (<a href="#SkPixmap_addr16_2_x">x</a>, <a href="#SkPixmap_addr16_2_y">y</a>).
+
+Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr16_2_x">x</a> or <a href="#SkPixmap_addr16_2_y">y</a> trigger an assert() if
+built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or
+<a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_addr16_2_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_addr16_2_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+readable unsigned 16-bit pointer to pixel at (<a href="#SkPixmap_addr16_2_x">x</a>, <a href="#SkPixmap_addr16_2_y">y</a>)
+
+### Example
+
+<div><fiddle-embed name="2c0c88a546d4ef093ab63ff72dac00b9">
+
+#### Example Output
+
+~~~~
+pixmap.addr16(1, 2) == &storage[1 + 2 * w]
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</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_writable_addr16">writable addr16</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint32_t* addr32(int x, int y) const
+</pre>
+
+Returns readable pixel address at (<a href="#SkPixmap_addr32_2_x">x</a>, <a href="#SkPixmap_addr32_2_y">y</a>).
+
+Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr32_2_x">x</a> or <a href="#SkPixmap_addr32_2_y">y</a> trigger an assert() if
+built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a> or
+<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_addr32_2_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_addr32_2_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+readable unsigned 32-bit pointer to pixel at (<a href="#SkPixmap_addr32_2_x">x</a>, <a href="#SkPixmap_addr32_2_y">y</a>)
+
+### Example
+
+<div><fiddle-embed name="12f8b5ce9fb25604f33df336677f5d62">
+
+#### Example Output
+
+~~~~
+pixmap.addr32(1, 2) == &storage[1 + 2 * w]
+~~~~
+
+</fiddle-embed></div>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint64_t* addr64(int x, int y) const
+</pre>
+
+Returns readable pixel address at (<a href="#SkPixmap_addr64_2_x">x</a>, <a href="#SkPixmap_addr64_2_y">y</a>).
+
+Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addr64_2_x">x</a> or <a href="#SkPixmap_addr64_2_y">y</a> trigger an assert() if
+built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built
+with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_addr64_2_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_addr64_2_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+readable unsigned 64-bit pointer to pixel at (<a href="#SkPixmap_addr64_2_x">x</a>, <a href="#SkPixmap_addr64_2_y">y</a>)
+
+### Example
+
+<div><fiddle-embed name="5449f65fd7673273b0b57807fd3117ff">
+
+#### Example Output
+
+~~~~
+pixmap.addr64(1, 2) == &storage[1 + 2 * w]
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a> <a href="#SkPixmap_addr16">addr16</a> <a href="#SkPixmap_addr32">addr32</a> <a href="#SkPixmap_addrF16">addrF16</a> <a href="#SkPixmap_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr64">writable addr64</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+const uint16_t* addrF16(int x, int y) const
+</pre>
+
+Returns readable pixel address at (<a href="#SkPixmap_addrF16_2_x">x</a>, <a href="#SkPixmap_addrF16_2_y">y</a>).
+
+Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_addrF16_2_x">x</a> or <a href="#SkPixmap_addrF16_2_y">y</a> trigger an assert() if
+built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built
+with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Each unsigned 16-bit word represents one color component encoded as a half float.
+Four words correspond to one pixel.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_addrF16_2_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_addrF16_2_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+readable unsigned 16-bit pointer to pixel component at (<a href="#SkPixmap_addrF16_2_x">x</a>, <a href="#SkPixmap_addrF16_2_y">y</a>)
+
+### Example
+
+<div><fiddle-embed name="f6076cad455bc80af5d06eb121d3b6f2">
+
+#### Example Output
+
+~~~~
+pixmap.addrF16(1, 2) == &storage[1 * wordsPerPixel + 2 * rowWords]
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_addr">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_getColor">getColor</a> <a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a>
+
+---
+
+## <a name="Writable_Address"></a> Writable Address
+
+<a name="SkPixmap_writable_addr"></a>
+## writable_addr
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+void* writable_addr() const
+</pre>
+
+Returns writable base pixel address.
+
+### Return Value
+
+writable generic base pointer to pixels
+
+### Example
+
+<div><fiddle-embed name="74ef460f89ed5904334d0f8883e781c4">
+
+#### Example Output
+
+~~~~
+pixmap.writable_addr() == (void *)storage
+pixmap.getColor(0, 1) == 0x00000000
+pixmap.getColor(0, 0) == 0xFFFFFFFF
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+void* writable_addr(int x, int y) const
+</pre>
+
+Returns writable pixel address at (<a href="#SkPixmap_writable_addr_2_x">x</a>, <a href="#SkPixmap_writable_addr_2_y">y</a>).
+
+Input is not validated: out of <a href="#SkPixmap_bounds">bounds</a> values of <a href="#SkPixmap_writable_addr_2_x">x</a> or <a href="#SkPixmap_writable_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>.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_writable_addr_2_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_writable_addr_2_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+writable generic pointer to pixel
+
+### Example
+
+<div><fiddle-embed name="559eaca89c765bc8466ea1ba3331d4db">
+
+#### Example Output
+
+~~~~
+pixmap.writable_addr() == (void *)storage
+pixmap.getColor(0, 0) == 0x00000000
+pixmap.getColor(1, 2) == 0xFFFFFFFF
+~~~~
+
+</fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a>
+
+---
+
+<a name="SkPixmap_writable_addr8"></a>
+## writable_addr8
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+uint8_t* writable_addr8(int x, int y) const
+</pre>
+
+Returns writable base pixel address. Result is addressable as unsigned 8-bit bytes.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a> or
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One byte corresponds to one pixel.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_writable_addr8_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_writable_addr8_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+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
+drawing on all platforms. Adding a second <a href="#SkBitmap_installPixels">SkBitmap::installPixels</a> after editing
+pixel memory is safer.</div></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr8">addr8</a>
+
+---
+
+<a name="SkPixmap_writable_addr16"></a>
+## writable_addr16
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+uint16_t* writable_addr16(int x, int y) const
+</pre>
+
+Returns <a href="#SkPixmap_writable_addr">writable addr</a> base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGB 565 SkColorType</a> or
+<a href="undocumented#SkColorType">kARGB 4444 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One word corresponds to one pixel.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_writable_addr16_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_writable_addr16_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+writable unsigned 16-bit pointer to pixel
+
+### Example
+
+<div><fiddle-embed name="6da54774f6432b46b47ea9013c15f280"><div>Draw a five by five bitmap, and draw it again with a center black pixel.
+The low nibble of the 16-bit word is <a href="#Alpha">Alpha</a>.</div></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr16">addr16</a>
+
+---
+
+<a name="SkPixmap_writable_addr32"></a>
+## writable_addr32
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+uint32_t* writable_addr32(int x, int y) const
+</pre>
+
+Returns writable base pixel address. Result is addressable as unsigned 32-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA 8888 SkColorType</a> or
+<a href="undocumented#SkColorType">kBGRA 8888 SkColorType</a>, and is built with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One word corresponds to one pixel.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_writable_addr32_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_writable_addr32_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+writable unsigned 32-bit pointer to pixel
+
+### Example
+
+<div><fiddle-embed name="f4fdce206b8c0a4e79f0a9f52b7f47a6"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr32">addr32</a>
+
+---
+
+<a name="SkPixmap_writable_addr64"></a>
+## writable_addr64
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+uint64_t* writable_addr64(int x, int y) const
+</pre>
+
+Returns writable base pixel address. Result is addressable as unsigned 64-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built
+with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+One word corresponds to one pixel.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_writable_addr64_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_writable_addr64_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+writable unsigned 64-bit pointer to pixel
+
+### Example
+
+<div><fiddle-embed name="33a04ac51c74a1e8d461b1d6f31ed82a"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addrF16">writable addrF16</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addr64">addr64</a>
+
+---
+
+<a name="SkPixmap_writable_addrF16"></a>
+## writable_addrF16
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+uint16_t* writable_addrF16(int x, int y) const
+</pre>
+
+Returns writable base pixel address. Result is addressable as unsigned 16-bit words.
+Will trigger an assert() if <a href="undocumented#Color_Type">Color Type</a> is not <a href="undocumented#SkColorType">kRGBA F16 SkColorType</a> and is built
+with <a href="undocumented#SK_DEBUG">SK DEBUG</a> defined.
+
+Each word represents one color component encoded as a half float.
+Four words correspond to one pixel.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_writable_addrF16_x"> <code><strong>x </strong></code> </a></td> <td>
+positive column index less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_writable_addrF16_y"> <code><strong>y </strong></code> </a></td> <td>
+positive row index less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+writable unsigned 16-bit pointer to first component of pixel
+
+### Example
+
+<div><fiddle-embed name="7822d78f5cacf5c04267cbbc6c6d0b80"><div>Left bitmap is drawn with two pixels defined in half float format. Right bitmap
+is drawn after overwriting bottom half float color with top half float color.</div></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_writable_addr">writable addr</a> <a href="#SkPixmap_writable_addr8">writable addr8</a> <a href="#SkPixmap_writable_addr16">writable addr16</a> <a href="#SkPixmap_writable_addr32">writable addr32</a> <a href="#SkPixmap_writable_addr64">writable addr64</a> <a href="#SkPixmap_addr">addr</a> <a href="#SkPixmap_addrF16">addrF16</a>
+
+---
+
+## <a name="Writer"></a> Writer
+
+<a name="SkPixmap_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>
+
+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>).
+<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
+row to the next. Returns true if pixels are copied. Returns false if
+<a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="undocumented#SkImageInfo">minRowBytes</a>.
+
+Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match.
+If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match.
+If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must
+match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns
+false if pixel conversion is not possible.
+<a href="#SkPixmap_readPixels_srcX">srcX</a> and <a href="#SkPixmap_readPixels_srcY">srcY</a> may be negative to copy only top or left of source. Returns
+false if <a href="#SkPixmap_width">width</a> or <a href="#SkPixmap_height">height</a> is zero or negative. Returns false ifabs(srcX) >= this-><a href="#SkPixmap_width">width</a> || abs(scrY) >= 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.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_readPixels_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td>
+destination <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>, <a href="undocumented#Color_Space">Color Space</a></td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td>
+destination pixel storage</td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td>
+destination row length</td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_srcX"> <code><strong>srcX </strong></code> </a></td> <td>
+column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_srcY"> <code><strong>srcY </strong></code> </a></td> <td>
+row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_behavior"> <code><strong>behavior </strong></code> </a></td> <td>
+one of: <a href="#SkTransferFunctionBehavior_kRespect">SkTransferFunctionBehavior::kRespect</a>,
+<a href="#SkTransferFunctionBehavior_kIgnore">SkTransferFunctionBehavior::kIgnore</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are copied to <a href="#SkPixmap_readPixels_dstPixels">dstPixels</a>
+
+### Example
+
+<div><fiddle-embed name="2b7f6cc59ea2d5ebceddccbc2f232bcf"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+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
+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
+<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_2_dstRowBytes">dstRowBytes</a> specifics the gap from one destination
+row to the next. Returns true if pixels are copied. Returns false if
+<a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_2_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="undocumented#SkImageInfo">minRowBytes</a>.
+
+Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match.
+If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match.
+If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must
+match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_2_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns
+false if pixel conversion is not possible.
+
+Returns false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_readPixels_2_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td>
+destination <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>, <a href="undocumented#Color_Space">Color Space</a></td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_2_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td>
+destination pixel storage</td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_2_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td>
+destination row length</td>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are copied to <a href="#SkPixmap_readPixels_2_dstPixels">dstPixels</a>
+
+### Example
+
+<div><fiddle-embed name="df4e355c4845350daede833b4fd21ec1"><div>Transferring the gradient from 8 bits per component to 4 bits per component
+creates visible banding.</div></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a>
+
+---
+
+<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) 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
+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
+<a href="undocumented#Color_Space">Color Space</a> of destination. <a href="#SkPixmap_readPixels_3_dstRowBytes">dstRowBytes</a> specifics the gap from one destination
+row to the next. Returns true if pixels are copied. Returns false if
+<a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_3_dstRowBytes">dstRowBytes</a> is less than <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="undocumented#SkImageInfo">minRowBytes</a>.
+
+Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorType">colorType</a> must match.
+If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match.
+If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_alphaType">alphaType</a> must
+match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_3_dstInfo">dstInfo</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns
+false if pixel conversion is not possible.
+<a href="#SkPixmap_readPixels_3_srcX">srcX</a> and <a href="#SkPixmap_readPixels_3_srcY">srcY</a> may be negative to copy only top or left of source. Returns
+false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative. Returns false ifabs(srcX) >= this-><a href="#SkPixmap_width">width</a> || abs(scrY) >= this-><a href="#SkPixmap_height">height</a>.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_readPixels_3_dstInfo"> <code><strong>dstInfo </strong></code> </a></td> <td>
+destination <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>, <a href="undocumented#Color_Space">Color Space</a></td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_3_dstPixels"> <code><strong>dstPixels </strong></code> </a></td> <td>
+destination pixel storage</td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_3_dstRowBytes"> <code><strong>dstRowBytes </strong></code> </a></td> <td>
+destination row length</td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_3_srcX"> <code><strong>srcX </strong></code> </a></td> <td>
+column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_3_srcY"> <code><strong>srcY </strong></code> </a></td> <td>
+row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are copied to <a href="#SkPixmap_readPixels_3_dstPixels">dstPixels</a>
+
+### Example
+
+<div><fiddle-embed name="094ca0bd37588cc7be241bb387a3e17b"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+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
+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
+<a href="#SkPixmap_readPixels_4_dst">dst</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>.
+
+Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorType">colorType</a> must match.
+If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match.
+If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_alphaType">alphaType</a> must
+match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_4_dst">dst</a>.<a href="#SkPixmap_info">info</a>.<a href="#SkPixmap_colorSpace">colorSpace</a> must match. Returns
+false if pixel conversion is not possible.
+<a href="#SkPixmap_readPixels_4_srcX">srcX</a> and <a href="#SkPixmap_readPixels_4_srcY">srcY</a> may be negative to copy only top or left of source. Returns
+false this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative. Returns false ifabs(srcX) >= this-><a href="#SkPixmap_width">width</a> || abs(scrY) >= this-><a href="#SkPixmap_height">height</a>.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_readPixels_4_dst"> <code><strong>dst </strong></code> </a></td> <td>
+<a href="#Info">Image Info</a> and pixel address to write to</td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_4_srcX"> <code><strong>srcX </strong></code> </a></td> <td>
+column index whose absolute value is less than <a href="#SkPixmap_width">width</a></td>
+ </tr> <tr> <td><a name="SkPixmap_readPixels_4_srcY"> <code><strong>srcY </strong></code> </a></td> <td>
+row index whose absolute value is less than <a href="#SkPixmap_height">height</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are copied to <a href="#SkPixmap_readPixels_4_dst">dst</a>
+
+### Example
+
+<div><fiddle-embed name="6ec7f7b2cc163cd29f627eef6d4b061c"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool readPixels(const SkPixmap& dst) const
+</pre>
+
+Copies pixels inside <a href="#SkPixmap_bounds">bounds</a> to <a href="#SkPixmap_readPixels_5_dst">dst</a>. <a href="#SkPixmap_readPixels_5_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_5_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> equals nullptr, or <a href="#SkPixmap_readPixels_5_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is less than
+<a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>.
+
+Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Type">Color Type</a> must match.
+If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match.
+If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Alpha_Type">Alpha Type</a> must
+match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_readPixels_5_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns
+false if pixel conversion is not possible.
+Returns false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_readPixels_5_dst"> <code><strong>dst </strong></code> </a></td> <td>
+<a href="#Info">Image Info</a> and pixel address to write to</td>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are copied to <a href="#SkPixmap_readPixels_5_dst">dst</a>
+
+### Example
+
+<div><fiddle-embed name="e18549b5ee1039cb61b0bb38c2104fc9"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkPixmap_erase">erase</a> <a href="#SkBitmap_readPixels">SkBitmap::readPixels</a> <a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkCanvas_readPixels">SkCanvas::readPixels</a> <a href="#SkImage_readPixels">SkImage::readPixels</a> <a href="#SkSurface_readPixels">SkSurface::readPixels</a>
+
+---
+
+<a name="SkPixmap_scalePixels"></a>
+## scalePixels
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool scalePixels(const SkPixmap& dst, SkFilterQuality filterQuality) const
+</pre>
+
+Copies this to <a href="#SkPixmap_scalePixels_dst">dst</a>, scaling pixels to fit <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_height">height</a>, and
+converting pixels to match <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_colorType">colorType</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_alphaType">alphaType</a>. Returns true if
+pixels are copied. Returns false if <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_addr">addr</a> is nullptr, or <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_rowBytes">rowBytes</a> is
+less than <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="#SkImageInfo_minRowBytes">SkImageInfo::minRowBytes</a>.
+
+Pixels are copied only if pixel conversion is possible. If this-><a href="#SkPixmap_colorType">colorType</a> is
+<a href="undocumented#SkColorType">kGray 8 SkColorType</a>, or <a href="undocumented#SkColorType">kAlpha 8 SkColorType</a>; <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Type">Color Type</a> must match.
+If this-><a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kGray 8 SkColorType</a>, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match.
+If this-><a href="#SkPixmap_alphaType">alphaType</a> is <a href="undocumented#SkAlphaType">kOpaque SkAlphaType</a>, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Alpha_Type">Alpha Type</a> must
+match. If this-><a href="#SkPixmap_colorSpace">colorSpace</a> is nullptr, <a href="#SkPixmap_scalePixels_dst">dst</a> <a href="undocumented#Color_Space">Color Space</a> must match. Returns
+false if pixel conversion is not possible.
+
+Returns false if this-><a href="#SkPixmap_width">width</a> or this-><a href="#SkPixmap_height">height</a> is zero or negative.
+
+Scales the image, with <a href="#SkPixmap_scalePixels_filterQuality">filterQuality</a>, to match <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_width">width</a> and <a href="#SkPixmap_scalePixels_dst">dst</a>.<a href="#SkPixmap_height">height</a>.
+<a href="#SkPixmap_scalePixels_filterQuality">filterQuality</a> <a href="undocumented#SkFilterQuality">kNone SkFilterQuality</a> is fastest, typically implemented with
+<a href="undocumented#Filter_Quality_Nearest_Neighbor">Filter Quality Nearest Neighbor</a>. <a href="undocumented#SkFilterQuality">kLow SkFilterQuality</a> is typically implemented with
+<a href="undocumented#Filter_Quality_Bilerp">Filter Quality Bilerp</a>. <a href="undocumented#SkFilterQuality">kMedium SkFilterQuality</a> is typically implemented with
+<a href="undocumented#Filter_Quality_Bilerp">Filter Quality Bilerp</a>, and <a href="undocumented#Filter_Quality_MipMap">Filter Quality MipMap</a> when size is reduced.
+<a href="undocumented#SkFilterQuality">kHigh SkFilterQuality</a> is slowest, typically implemented with <a href="undocumented#Filter_Quality_BiCubic">Filter Quality BiCubic</a>.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_scalePixels_dst"> <code><strong>dst </strong></code> </a></td> <td>
+<a href="#Info">Image Info</a> and pixel address to write to</td>
+ </tr> <tr> <td><a name="SkPixmap_scalePixels_filterQuality"> <code><strong>filterQuality </strong></code> </a></td> <td>
+one of: <a href="undocumented#SkFilterQuality">kNone SkFilterQuality</a>, <a href="undocumented#SkFilterQuality">kLow SkFilterQuality</a>,
+<a href="undocumented#SkFilterQuality">kMedium SkFilterQuality</a>, <a href="undocumented#SkFilterQuality">kHigh SkFilterQuality</a></td>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are copied to <a href="#SkPixmap_scalePixels_dst">dst</a>
+
+### Example
+
+<div><fiddle-embed name="8e3c8a9c1d0d2e9b8bf66e24d274f792"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkCanvas_drawBitmap">SkCanvas::drawBitmap</a> <a href="#SkImage_scalePixels">SkImage::scalePixels</a>
+
+---
+
+<a name="SkPixmap_erase"></a>
+## erase
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool erase(SkColor color, const SkIRect& subset) const
+</pre>
+
+Writes <a href="#SkPixmap_erase_color">color</a> to pixels bounded by <a href="#SkPixmap_erase_subset">subset</a>; returns true on success.
+Returns false if <a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>, or if <a href="#SkPixmap_erase_subset">subset</a> does
+not intersect <a href="#SkPixmap_bounds">bounds</a>.
+
+### Parameters
+
+<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>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are changed
+
+### Example
+
+<div><fiddle-embed name="f0a8f4e07fd8b6c48eb52f2238d8f88b"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_clear">SkCanvas::clear</a> <a href="#SkCanvas_drawColor">SkCanvas::drawColor</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool erase(SkColor color) const
+</pre>
+
+Writes <a href="#SkPixmap_erase_2_color">color</a> to pixels inside <a href="#SkPixmap_bounds">bounds</a>; returns true on success.
+Returns false if <a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>, or if <a href="#SkPixmap_bounds">bounds</a>
+is empty.
+
+### Parameters
+
+<table> <tr> <td><a name="SkPixmap_erase_2_color"> <code><strong>color </strong></code> </a></td> <td>
+<a href="#Unpremultiply">Unpremultiplied</a> <a href="undocumented#Color">Color</a> to write</td>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are changed
+
+### Example
+
+<div><fiddle-embed name="ee0bb3f3aae12dbc1c2759349527e9da"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_clear">SkCanvas::clear</a> <a href="#SkCanvas_drawColor">SkCanvas::drawColor</a>
+
+---
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool erase(const SkColor4f& color, const SkIRect* subset = nullptr) const
+</pre>
+
+Writes <a href="#SkPixmap_erase_3_color">color</a> to pixels bounded by <a href="#SkPixmap_erase_3_subset">subset</a>; returns true on success.
+if <a href="#SkPixmap_erase_3_subset">subset</a> is nullptr, writes colors pixels inside <a href="#SkPixmap_bounds">bounds</a>. Returns false if
+<a href="#SkPixmap_colorType">colorType</a> is <a href="undocumented#SkColorType">kUnknown SkColorType</a>, if <a href="#SkPixmap_erase_3_subset">subset</a> is not nullptr and does
+not intersect <a href="#SkPixmap_bounds">bounds</a>, or if <a href="#SkPixmap_erase_3_subset">subset</a> is nullptr and <a href="#SkPixmap_bounds">bounds</a> is empty.
+
+### Parameters
+
+<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>
+ </tr>
+</table>
+
+### Return Value
+
+true if pixels are changed
+
+### Example
+
+<div><fiddle-embed name="da215a59c574d26bc5caf7de630d5966"></fiddle-embed></div>
+
+### See Also
+
+<a href="#SkBitmap_erase">SkBitmap::erase</a> <a href="#SkCanvas_clear">SkCanvas::clear</a> <a href="#SkCanvas_drawColor">SkCanvas::drawColor</a>
+
+---
+
diff --git a/site/user/api/index.md b/site/user/api/index.md
index afab43c834..b2a9c4297e 100644
--- a/site/user/api/index.md
+++ b/site/user/api/index.md
@@ -32,9 +32,10 @@ Using the SkCanvas API:
Reference:
-1. **[SkCanvas Reference](/user/api/SkCanvas_Reference)** - the drawing context.
+1. **[SkCanvas Reference](/user/api/SkCanvas_Reference)** - drawing context
2. **[SkPaint Reference](/user/api/SkPaint_Reference)** - color, stroke, font, effects
3. **[SkPath Reference](/user/api/SkPath_Reference)** - paths
+4. **[SkPixmap Reference](/user/api/SkPixmap_Reference)** - pixel map: image info and pixel address
Autogenerated Doxygen Documentaion
----------------------------------
diff --git a/site/user/api/undocumented.md b/site/user/api/undocumented.md
index cc23a48ef0..6d3dbd70f0 100644
--- a/site/user/api/undocumented.md
+++ b/site/user/api/undocumented.md
@@ -93,6 +93,10 @@ bool equalsWithinTolerance(const SkPoint& p) const
# <a name="SkDumpCanvas"></a> Class SkDumpCanvas
+# <a name="HTML_Canvas"></a> HTML Canvas
+
+## <a name="ArcTo"></a> ArcTo
+
# <a name="Alias"></a> Alias
# <a name="Anti-alias"></a> Anti-alias
@@ -107,6 +111,34 @@ bool equalsWithinTolerance(const SkPoint& p) const
## <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
@@ -233,6 +265,31 @@ int SkColorSetARGB(a, r, g, b)
# <a name="Color_Space"></a> Color Space
+# <a name="SkColorSpace"></a> Class SkColorSpace
+
+<a name="SkColorSpace_MakeSRGBLinear"></a>
+## MakeSRGBLinear
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+static sk_sp<SkColorSpace> MakeSRGBLinear()
+</pre>
+
+---
+
+## <a name="SkTransferFunctionBehavior"></a> Enum SkTransferFunctionBehavior
+
+### Constants
+
+<table>
+ <tr>
+ <td><a name="SkTransferFunctionBehavior_kRespect"> <code><strong>SkTransferFunctionBehavior::kRespect </strong></code> </a></td><td>0</td><td></td>
+ </tr>
+ <tr>
+ <td><a name="SkTransferFunctionBehavior_kIgnore"> <code><strong>SkTransferFunctionBehavior::kIgnore </strong></code> </a></td><td>1</td><td></td>
+ </tr>
+
+</table>
+
# <a name="Core_Graphics"></a> Core Graphics
# <a name="Core_Text"></a> Core Text
@@ -302,6 +359,16 @@ static std::unique_ptr<SkCanvas>
</table>
+## <a name="Nearest_Neighbor"></a> Nearest Neighbor
+
+## <a name="Bilerp"></a> Bilerp
+
+## <a name="MipMap"></a> MipMap
+
+## <a name="BiCubic"></a> BiCubic
+
+# <a name="Left_Side_Bearing"></a> Left Side Bearing
+
# <a name="Font"></a> Font
## <a name="Advance"></a> Advance
@@ -316,10 +383,6 @@ static std::unique_ptr<SkCanvas>
# <a name="GPU_Surface"></a> GPU Surface
-# <a name="HTML_Canvas"></a> HTML Canvas
-
-## <a name="ArcTo"></a> ArcTo
-
# <a name="Image"></a> Image
## <a name="Alpha_Type"></a> Alpha Type
@@ -330,8 +393,17 @@ static std::unique_ptr<SkCanvas>
<table>
<tr>
+ <td><a name="kUnknown_SkAlphaType"> <code><strong>kUnknown_SkAlphaType </strong></code> </a></td><td>0</td><td></td>
+ </tr>
+ <tr>
+ <td><a name="kOpaque_SkAlphaType"> <code><strong>kOpaque_SkAlphaType </strong></code> </a></td><td>1</td><td></td>
+ </tr>
+ <tr>
<td><a name="kPremul_SkAlphaType"> <code><strong>kPremul_SkAlphaType </strong></code> </a></td><td>2</td><td></td>
</tr>
+ <tr>
+ <td><a name="kUnpremul_SkAlphaType"> <code><strong>kUnpremul_SkAlphaType </strong></code> </a></td><td>3</td><td></td>
+ </tr>
</table>
@@ -393,6 +465,42 @@ SkImageInfo()
---
+<a name="SkImageInfo_makeColorSpace"></a>
+## makeColorSpace
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const
+</pre>
+
+---
+
+<a name="SkImageInfo_minRowBytes"></a>
+## minRowBytes
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+size_t minRowBytes() const
+</pre>
+
+---
+
+<a name="SkImageInfo_isOpaque"></a>
+## isOpaque
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool isOpaque() const
+</pre>
+
+---
+
+<a name="SkImageInfo_bytesPerPixel"></a>
+## bytesPerPixel
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+int bytesPerPixel() const
+</pre>
+
+---
+
# <a name="SkImage"></a> Class SkImage
<a name="SkImage_makeShader"></a>
@@ -405,6 +513,35 @@ sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
---
+<a name="SkImage_MakeRasterCopy"></a>
+## MakeRasterCopy
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+static sk_sp<SkImage> MakeRasterCopy(const SkPixmap&)
+</pre>
+
+---
+
+<a name="SkImage_readPixels"></a>
+## readPixels
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool readPixels(const SkPixmap& dst, int srcX, int srcY,
+ CachingHint = kAllow_CachingHint) const
+</pre>
+
+---
+
+<a name="SkImage_scalePixels"></a>
+## scalePixels
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool scalePixels(const SkPixmap& dst, SkFilterQuality,
+ CachingHint = kAllow_CachingHint) const
+</pre>
+
+---
+
# <a name="Image_Filter"></a> Image Filter
## <a name="Scaling"></a> Scaling
@@ -417,16 +554,59 @@ sk_sp<SkShader> makeShader(SkShader::TileMode, SkShader::TileMode,
# <a name="SkIRect"></a> Struct SkIRect
-# <a name="Left_Side_Bearing"></a> Left Side Bearing
+<a name="SkIRect_intersect"></a>
+## intersect
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool intersect(const SkIRect& r)
+</pre>
+
+---
# <a name="Mask"></a> Mask
+# <a name="SkMask"></a> Class SkMask
+
+## <a name="SkMask_Format"></a> Enum SkMask::Format
+
+### Constants
+
+<table>
+ <tr>
+ <td><a name="SkMask_kBW_Format"> <code><strong>SkMask::kBW_Format </strong></code> </a></td><td>0</td><td></td>
+ </tr>
+ <tr>
+ <td><a name="SkMask_kA8_Format"> <code><strong>SkMask::kA8_Format </strong></code> </a></td><td>1</td><td></td>
+ </tr>
+ <tr>
+ <td><a name="SkMask_k3D_Format"> <code><strong>SkMask::k3D_Format </strong></code> </a></td><td>2</td><td></td>
+ </tr>
+ <tr>
+ <td><a name="SkMask_kARGB32_Format"> <code><strong>SkMask::kARGB32_Format </strong></code> </a></td><td>3</td><td></td>
+ </tr>
+k <tr>
+ <td><a name="SkMask_LCD16_Format"> <code><strong>SkMask::LCD16_Format </strong></code> </a></td><td>4</td><td></td>
+ </tr>
+
+</table>
+
# <a name="Mask_Alpha"></a> Mask Alpha
# <a name="Mask_Filter"></a> Mask Filter
# <a name="SkMaskFilter"></a> Class SkMaskFilter
+# <a name="Math"></a> Math
+
+<a name="sk_64_isS32"></a>
+## sk_64_isS32
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+static inline bool sk_64_isS32(int64_t value)
+</pre>
+
+---
+
# <a name="Matrix"></a> Matrix
# <a name="SkMatrix"></a> Struct SkMatrix
@@ -521,9 +701,9 @@ SkCanvas* beginRecording(const SkRect& bounds, SkBBHFactory* bbhFactory = NULL,
## <a name="Storage"></a> Storage
-# <a name="Pixmap"></a> Pixmap
+# <a name="PixelRef"></a> PixelRef
-# <a name="SkPixmap"></a> Class SkPixmap
+# <a name="SkPixelRef"></a> Class SkPixelRef
# <a name="PostScript"></a> PostScript
@@ -628,6 +808,15 @@ static sk_sp<SkSurface> MakeRasterDirect(const SkImageInfo&, void* pixels,
---
+<a name="SkSurface_readPixels"></a>
+## readPixels
+
+<pre style="padding: 1em 1em 1em 1em;width: 50em; background-color: #f0f0f0">
+bool readPixels(const SkPixmap& dst, int srcX, int srcY) ;
+</pre>
+
+---
+
## <a name="Properties"></a> Properties
# <a name="SkSurfaceProps"></a> Class SkSurfaceProps
diff --git a/site/user/api/usingBookmaker.md b/site/user/api/usingBookmaker.md
index d29b86fd99..7a93f7a304 100644
--- a/site/user/api/usingBookmaker.md
+++ b/site/user/api/usingBookmaker.md
@@ -17,14 +17,34 @@ Build <a href="#Bookmaker">Bookmaker</a>.
$ ninja -<a href="undocumented#C">C</a> out/dir bookmaker</pre>
Generate an starter <a href="#Bookmaker">Bookmaker</a> file from an existing include.
-This writes <a href="usingBookmaker#SkXXX">SkXXX</a>.bmh in the current directory, which is
-out/dir/obj/ from an IDE.
<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
-$ ./out/dir/bookmaker -t -i include/core/<a href="usingBookmaker#SkXXX">SkXXX</a>.h</pre>
+$ ./out/dir/bookmaker -i include/core/<a href="undocumented#SkXXX.h">SkXXX.h</a> -t docs</pre>
-Copy <a href="usingBookmaker#SkXXX">SkXXX</a>.bmh to docs.
-Use your favorite editor to fill out docs/<a href="usingBookmaker#SkXXX">SkXXX</a>.bmh.
+If a method or function has an unnamed parameter, bookmaker generates an error:
+
+<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
+<a href="undocumented#C">C</a>:/puregit/include/core/<a href="SkPixmap_Reference#SkPixmap">SkPixmap</a>.h(208): error: # missing param name
+bool erase(const SkColor4f&, const SkIRect* subset = nullptr) const
+^
+</pre>
+
+All parameters require names to allow markdown and doxygen documents to refer to
+them. After naming all parameters, check in the include before continuing.
+
+A successful run generates
+
+<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
+docs/<a href="undocumented#SkXXX_Reference">SkXXX Reference</a>.bmh</pre>
+
+.
+
+Next, use your favorite editor to fill out
+
+<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
+docs/<a href="undocumented#SkXXX_Reference">SkXXX Reference</a>.bmh</pre>
+
+.
## <a name="Style"></a> Style
@@ -86,12 +106,13 @@ This reports if a method no longer exists or its parameters have changed.
<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
$ ./out/dir/bookmaker -x -b docs/<a href="usingBookmaker#SkXXX">SkXXX</a>.bmh -i include/core/<a href="usingBookmaker#SkXXX">SkXXX</a>.h</pre>
-Generate an updated include header.
-This writes the updated <a href="undocumented#SkXXX.h">SkXXX.h</a> to the current directory.
+Generate an updated include header. Run:
<pre style="padding: 1em 1em 1em 1em;width: 44em; background-color: #f0f0f0">
$ ./out/dir/bookmaker -p -b docs -i include/core/<a href="usingBookmaker#SkXXX">SkXXX</a>.h</pre>
+to write the updated <a href="undocumented#SkXXX.h">SkXXX.h</a> to the current directory.
+
## <a name="Bugs"></a> Bugs
<a href="#Bookmaker">Bookmaker</a> bugs are trackedhere.
diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp
index ac8f04da9f..1df8d42e9c 100644
--- a/tools/bookmaker/bookmaker.cpp
+++ b/tools/bookmaker/bookmaker.cpp
@@ -938,6 +938,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
definition->fFiddle = normalized_name(name);
}
definition->fMarkType = markType;
+ definition->fAnonymous = fAnonymous;
this->setAsParent(definition);
}
} break;
@@ -1078,9 +1079,6 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
fMarkup.emplace_front(markType, defStart, fLineCount, fParent);
definition = &fMarkup.front();
definition->fContentStart = fChar;
- if (MarkType::kFormula == markType && MarkType::kRow == definition->fParent->fMarkType) {
- SkDebugf("");
- }
definition->fName = typeNameBuilder[0];
definition->fFiddle = fParent->fFiddle;
char suffix = '\0';
@@ -1383,6 +1381,7 @@ bool BmhParser::dumpExamples(const char* fiddleJsonFileName) const {
}
fprintf(fiddleOut, "\n}\n");
fclose(fiddleOut);
+ SkDebugf("wrote %s\n", fiddleJsonFileName);
return true;
}
@@ -1525,10 +1524,6 @@ bool BmhParser::findDefinitions() {
}
}
} else if (TableState::kNone == fTableState) {
- bool parentIsList = MarkType::kList == fParent->fMarkType;
- if (parentIsList && fLineCount > 1230) {
- SkDebugf("");
- }
// fixme? no nested tables for now
fColStart = fChar - 1;
fMarkup.emplace_front(MarkType::kRow, fColStart, fLineCount, fParent);
@@ -1627,6 +1622,7 @@ bool HackParser::hackFiles() {
} while (!this->eof());
fprintf(out, "%.*s", (int) (fEnd - start), start);
fclose(out);
+ SkDebugf("wrote %s\n", filename.c_str());
return true;
}
@@ -2143,15 +2139,16 @@ string BmhParser::word(const string& prefix, const string& delimiter) {
// pass one: parse text, collect definitions
// pass two: lookup references
-DEFINE_string2(bmh, b, "", "A path to a *.bmh file or a directory.");
+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, "", "A path to a *.h file or a directory.");
+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, mispellings]. (Requires -b)");
-DEFINE_bool2(tokens, t, false, "Output include tokens. (Requires -i)");
+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) {
@@ -2220,7 +2217,6 @@ int main(int argc, char** const argv) {
SkDebugf("hack failed\n");
return -1;
}
- SkDebugf("hack success\n");
return 0;
}
if ((FLAGS_include.isEmpty() || FLAGS_bmh.isEmpty()) && FLAGS_populate) {
@@ -2238,7 +2234,7 @@ int main(int argc, char** const argv) {
SkCommandLineFlags::PrintUsage();
return 1;
}
- if (FLAGS_include.isEmpty() && FLAGS_tokens) {
+ if (FLAGS_include.isEmpty() && !FLAGS_tokens.isEmpty()) {
SkDebugf("-t requires -i\n");
SkCommandLineFlags::PrintUsage();
return 1;
@@ -2255,14 +2251,16 @@ int main(int argc, char** const argv) {
}
bool done = false;
if (!FLAGS_include.isEmpty()) {
- if (FLAGS_tokens || FLAGS_crosscheck) {
+ if (!FLAGS_tokens.isEmpty() || FLAGS_crosscheck) {
IncludeParser includeParser;
includeParser.validate();
if (!includeParser.parseFile(FLAGS_include[0], ".h")) {
return -1;
}
- if (FLAGS_tokens) {
- includeParser.dumpTokens();
+ if (!FLAGS_tokens.isEmpty()) {
+ if (includeParser.dumpTokens(FLAGS_tokens[0])) {
+ bmhParser.fWroteOut = true;
+ }
done = true;
} else if (FLAGS_crosscheck) {
if (!includeParser.crossCheck(bmhParser)) {
@@ -2276,9 +2274,11 @@ int main(int argc, char** const argv) {
if (!includeWriter.parseFile(FLAGS_include[0], ".h")) {
return -1;
}
+ includeWriter.fDebugOut = FLAGS_stdout;
if (!includeWriter.populate(bmhParser)) {
return -1;
}
+ bmhParser.fWroteOut = true;
done = true;
}
}
@@ -2290,7 +2290,9 @@ int main(int argc, char** const argv) {
}
if (!done && !FLAGS_ref.isEmpty() && FLAGS_examples.isEmpty()) {
MdOut mdOut(bmhParser);
- mdOut.buildReferences(FLAGS_bmh[0], FLAGS_ref[0]);
+ if (mdOut.buildReferences(FLAGS_bmh[0], FLAGS_ref[0])) {
+ bmhParser.fWroteOut = true;
+ }
}
if (!done && !FLAGS_spellcheck.isEmpty() && FLAGS_examples.isEmpty()) {
bmhParser.spellCheck(FLAGS_bmh[0], FLAGS_spellcheck);
@@ -2307,18 +2309,21 @@ int main(int argc, char** const argv) {
if (!bmhParser.dumpExamples(FLAGS_examples[0])) {
return -1;
}
+ return 0;
}
- for (const auto& topic : bmhParser.fTopicMap) {
- if (topic.second->fParent) {
- continue;
+ if (!bmhParser.fWroteOut) {
+ for (const auto& topic : bmhParser.fTopicMap) {
+ if (topic.second->fParent) {
+ continue;
+ }
+ examples += count_children(*topic.second, MarkType::kExample);
+ methods += count_children(*topic.second, MarkType::kMethod);
+ topics += count_children(*topic.second, MarkType::kSubtopic);
+ topics += count_children(*topic.second, MarkType::kTopic);
}
- examples += count_children(*topic.second, MarkType::kExample);
- methods += count_children(*topic.second, MarkType::kMethod);
- topics += count_children(*topic.second, MarkType::kSubtopic);
- topics += count_children(*topic.second, MarkType::kTopic);
+ SkDebugf("topics=%d classes=%d methods=%d examples=%d\n",
+ bmhParser.fTopicMap.size(), bmhParser.fClassMap.size(),
+ methods, examples);
}
- SkDebugf("topics=%d classes=%d methods=%d examples=%d\n",
- bmhParser.fTopicMap.size(), bmhParser.fClassMap.size(),
- methods, examples);
return 0;
}
diff --git a/tools/bookmaker/bookmaker.h b/tools/bookmaker/bookmaker.h
index 503db20f24..1d95f13453 100644
--- a/tools/bookmaker/bookmaker.h
+++ b/tools/bookmaker/bookmaker.h
@@ -8,8 +8,6 @@
#ifndef bookmaker_DEFINED
#define bookmaker_DEFINED
-#define STDOUT_TO_IDE_OUT 0
-
#include "SkCommandLineFlags.h"
#include "SkData.h"
@@ -71,7 +69,10 @@ enum class KeyWord {
kStruct,
kTemplate,
kTypedef,
+ kUint16_t,
kUint32_t,
+ kUint64_t,
+ kUint8_t,
kUnion,
kUnsigned,
kVoid,
@@ -161,6 +162,24 @@ enum class Punctuation { // catch-all for misc symbols tracked in C
kColon, // for foo() : bar(1), baz(2) {}
};
+enum class KeyProperty {
+ kNone,
+ kClassSection,
+ kFunction,
+ kModifier,
+ kNumber,
+ kObject,
+ kPreprocessor,
+};
+
+struct IncludeKey {
+ const char* fName;
+ KeyWord fKeyWord;
+ KeyProperty fProperty;
+};
+
+extern const IncludeKey kKeyWords[];
+
static inline bool has_nonwhitespace(const string& s) {
bool nonwhite = false;
for (const char& c : s) {
@@ -449,7 +468,9 @@ public:
bool skipName(const char* word) {
size_t len = strlen(word);
if (len <= (size_t) (fEnd - fChar) && !strncmp(word, fChar, len)) {
- fChar += len;
+ for (size_t i = 0; i < len; ++i) {
+ this->next();
+ }
}
return this->eof() || ' ' >= fChar[0];
}
@@ -890,6 +911,7 @@ public:
bool fPrivate = false;
bool fShort = false;
bool fMemberStart = false;
+ bool fAnonymous = false;
mutable bool fVisited = false;
};
@@ -959,6 +981,7 @@ public:
ParserCommon() : TextParser()
, fParent(nullptr)
+ , fDebugOut(false)
{
}
@@ -972,9 +995,9 @@ public:
void indentToColumn(int column) {
SkASSERT(column >= fColumn);
-#if STDOUT_TO_IDE_OUT
- SkDebugf("%*s", column - fColumn, "");
-#endif
+ if (fDebugOut) {
+ SkDebugf("%*s", column - fColumn, "");
+ }
fprintf(fOut, "%*s", column - fColumn, "");
fColumn = column;
fSpaces += column - fColumn;
@@ -1068,10 +1091,13 @@ public:
fPendingSpace = false;
}
writePending();
-#if STDOUT_TO_IDE_OUT
- string check(data, size);
- SkDebugf("%s", check.c_str());
-#endif
+ if (fDebugOut) {
+ if (!strncmp("SK_SUPPORT", data, 10)) {
+ SkDebugf("");
+ }
+ string check(data, size);
+ SkDebugf("%s", check.c_str());
+ }
fprintf(fOut, "%.*s", size, data);
int added = 0;
while (size > 0 && '\n' != data[--size]) {
@@ -1109,9 +1135,6 @@ public:
}
void writeString(const char* str) {
- if (!strcmp("utf-8", str)) {
- SkDebugf("");
- }
SkASSERT(strlen(str) > 0);
SkASSERT(' ' < str[0]);
SkASSERT(' ' < str[strlen(str) - 1]);
@@ -1119,9 +1142,12 @@ public:
fPendingSpace = false;
}
writePending();
-#if STDOUT_TO_IDE_OUT
- SkDebugf("%s", str);
-#endif
+ if (fDebugOut) {
+ if (!strncmp("SK_SUPPORT", str, 10)) {
+ SkDebugf("");
+ }
+ SkDebugf("%s", str);
+ }
SkASSERT(!strchr(str, '\n'));
fprintf(fOut, "%s", str);
fColumn += strlen(str);
@@ -1134,9 +1160,9 @@ public:
fPendingLF = SkTMin(fPendingLF, fMaxLF);
bool wroteLF = false;
while (fLinefeeds < fPendingLF) {
-#if STDOUT_TO_IDE_OUT
- SkDebugf("\n");
-#endif
+ if (fDebugOut) {
+ SkDebugf("\n");
+ }
fprintf(fOut, "\n");
++fLinefeeds;
wroteLF = true;
@@ -1145,17 +1171,17 @@ public:
if (wroteLF) {
SkASSERT(0 == fColumn);
SkASSERT(fIndent >= fSpaces);
- #if STDOUT_TO_IDE_OUT
- SkDebugf("%*s", fIndent - fSpaces, "");
- #endif
+ if (fDebugOut) {
+ SkDebugf("%*s", fIndent - fSpaces, "");
+ }
fprintf(fOut, "%*s", fIndent - fSpaces, "");
fColumn = fIndent;
fSpaces = fIndent;
}
if (fPendingSpace) {
- #if STDOUT_TO_IDE_OUT
- SkDebugf(" ");
- #endif
+ if (fDebugOut) {
+ SkDebugf(" ");
+ }
fprintf(fOut, " ");
++fColumn;
fPendingSpace = false;
@@ -1173,6 +1199,7 @@ public:
int fColumn; // current column; number of chars past last linefeed
int fIndent; // desired indention
bool fPendingSpace; // a space should preceed the next string or block
+ bool fDebugOut; // set true to write to std out
private:
typedef TextParser INHERITED;
};
@@ -1231,7 +1258,7 @@ public:
, { "Alias", nullptr, MarkType::kAlias, R_N, E_N, 0 }
, { "Bug", nullptr, MarkType::kBug, R_N, E_N, 0 }
, { "Class", &fClassMap, MarkType::kClass, R_Y, E_O, M_CSST | M(Root) }
-, { "Code", nullptr, MarkType::kCode, R_Y, E_N, M_CSST | M_E }
+, { "Code", nullptr, MarkType::kCode, R_O, E_N, M_CSST | M_E }
, { "", nullptr, MarkType::kColumn, R_Y, E_N, M(Row) }
, { "", nullptr, MarkType::kComment, R_N, E_N, 0 }
, { "Const", &fConstMap, MarkType::kConst, R_Y, E_N, M_E | M_ST }
@@ -1396,7 +1423,7 @@ public:
bool fInComment;
bool fInString;
bool fCheckMethods;
-
+ bool fWroteOut = false;
private:
typedef ParserCommon INHERITED;
};
@@ -1489,7 +1516,7 @@ public:
IClassDefinition* defineClass(const Definition& includeDef, const string& className);
void dumpClassTokens(IClassDefinition& classDef);
void dumpComment(Definition* token);
- void dumpTokens();
+ bool dumpTokens(const string& directory);
bool findComments(const Definition& includeDef, Definition* markupDef);
Definition* findIncludeObject(const Definition& includeDef, MarkType markType,
@@ -1651,6 +1678,11 @@ public:
kMixed,
};
+ enum class Phrase {
+ kNo,
+ kYes,
+ };
+
enum class PunctuationState {
kStart,
kDelimiter,
@@ -1721,11 +1753,12 @@ public:
fAttrDeprecated = nullptr;
fAnonymousEnumCount = 1;
fInStruct = false;
+ fWroteMethod = false;
}
string resolveMethod(const char* start, const char* end, bool first);
string resolveRef(const char* start, const char* end, bool first, RefType* refType);
- Wrote rewriteBlock(int size, const char* data);
+ Wrote rewriteBlock(int size, const char* data, Phrase phrase);
Definition* structMemberOut(const Definition* memberStart, const Definition& child);
void structOut(const Definition* root, const Definition& child,
const char* commentStart, const char* commentEnd);
@@ -1748,6 +1781,7 @@ private:
int fStructValueTab;
int fStructCommentTab;
bool fInStruct;
+ bool fWroteMethod;
typedef IncludeParser INHERITED;
};
@@ -1822,6 +1856,7 @@ private:
bool buildRefFromFile(const char* fileName, const char* outDir);
bool checkParamReturnBody(const Definition* def) const;
void childrenOut(const Definition* def, const char* contentStart);
+ const Definition* findParamType();
const Definition* isDefined(const TextParser& parser, const string& ref, bool report) const;
string linkName(const Definition* ) const;
string linkRef(const string& leadingSpaces, const Definition*, const string& ref) const;
@@ -1837,6 +1872,7 @@ private:
fEnumClass = nullptr;
fMethod = nullptr;
fRoot = nullptr;
+ fLastParam = nullptr;
fTableState = TableState::kNone;
fHasFiddle = false;
fInDescription = false;
@@ -1857,6 +1893,7 @@ private:
const Definition* fEnumClass;
Definition* fMethod;
RootDefinition* fRoot;
+ const Definition* fLastParam;
TableState fTableState;
bool fHasFiddle;
bool fInDescription; // FIXME: for now, ignore unfound camelCase in description since it may
diff --git a/tools/bookmaker/fiddleParser.cpp b/tools/bookmaker/fiddleParser.cpp
index d5cfcf425c..3361543301 100644
--- a/tools/bookmaker/fiddleParser.cpp
+++ b/tools/bookmaker/fiddleParser.cpp
@@ -55,7 +55,6 @@ bool FiddleParser::parseFiddles() {
if (']' != this->peek()) {
// report compiler errors
int brackets = 1;
- const char* errorStart = fChar;
do {
if ('[' == this->peek()) {
++brackets;
@@ -63,8 +62,7 @@ bool FiddleParser::parseFiddles() {
--brackets;
}
} while (!this->eof() && this->next() && brackets > 0);
- SkDebugf("fiddle compile error in %s: %.*s\n", name.c_str(), (int) (fChar - errorStart),
- errorStart);
+ this->reportError("fiddle compile error");
}
if (!this->skipExact("],\n")) {
return false;
@@ -73,12 +71,10 @@ bool FiddleParser::parseFiddles() {
return false;
}
if ('"' != this->peek()) {
- const char* errorStart = fChar;
if (!this->skipToEndBracket('"')) {
return false;
}
- SkDebugf("fiddle runtime error in %s: %.*s\n", name.c_str(), (int) (fChar - errorStart),
- errorStart);
+ this->reportError("fiddle runtime error");
}
if (!this->skipExact("\",\n")) {
return false;
@@ -92,7 +88,7 @@ bool FiddleParser::parseFiddles() {
}
Definition* example = this->findExample(name);
if (!example) {
- SkDebugf("missing example %s\n", name.c_str());
+ this->reportError("missing example");
}
string hash(hashStart, fChar - hashStart);
if (example) {
@@ -141,21 +137,21 @@ bool FiddleParser::parseFiddles() {
SkASSERT(fiddleLen > 0);
if (bmhLen != fiddleLen) {
if (!foundVolatile) {
- SkDebugf("mismatched stdout len in %s\n", name.c_str());
+ bmh.reportError("mismatched stdout len\n");
}
} else if (strncmp(bmh.fChar, fiddle.fChar, fiddleLen)) {
if (!foundVolatile) {
- SkDebugf("mismatched stdout text in %s\n", name.c_str());
+ bmh.reportError("mismatched stdout text\n");
}
}
bmh.skipToLineStart();
fiddle.skipToLineStart();
} while (!bmh.eof() && !fiddle.eof());
if (!foundStdOut) {
- SkDebugf("bmh %s missing stdout\n", name.c_str());
+ bmh.reportError("bmh %s missing stdout\n");
} else if (!bmh.eof() || !fiddle.eof()) {
if (!foundVolatile) {
- SkDebugf("%s mismatched stdout eof\n", name.c_str());
+ bmh.reportError("%s mismatched stdout eof\n");
}
}
}
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index cc7627ac7c..1000a037e7 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -7,22 +7,6 @@
#include "bookmaker.h"
-enum class KeyProperty {
- kNone,
- kClassSection,
- kFunction,
- kModifier,
- kNumber,
- kObject,
- kPreprocessor,
-};
-
-struct IncludeKey {
- const char* fName;
- KeyWord fKeyWord;
- KeyProperty fProperty;
-};
-
const IncludeKey kKeyWords[] = {
{ "", KeyWord::kNone, KeyProperty::kNone },
{ "SK_API", KeyWord::kSK_API, KeyProperty::kModifier },
@@ -55,7 +39,10 @@ const IncludeKey kKeyWords[] = {
{ "struct", KeyWord::kStruct, KeyProperty::kObject },
{ "template", KeyWord::kTemplate, KeyProperty::kObject },
{ "typedef", KeyWord::kTypedef, KeyProperty::kObject },
+ { "uint16_t", KeyWord::kUint16_t, KeyProperty::kNumber },
{ "uint32_t", KeyWord::kUint32_t, KeyProperty::kNumber },
+ { "uint64_t", KeyWord::kUint64_t, KeyProperty::kNumber },
+ { "uint8_t", KeyWord::kUint8_t, KeyProperty::kNumber },
{ "union", KeyWord::kUnion, KeyProperty::kObject },
{ "unsigned", KeyWord::kUnsigned, KeyProperty::kNumber },
{ "void", KeyWord::kVoid, KeyProperty::kNumber },
@@ -417,6 +404,8 @@ bool IncludeParser::crossCheck(BmhParser& bmhParser) {
if (!root->dumpUnVisited()) {
SkDebugf("some struct elements not found; struct finding in includeParser is missing\n");
}
+ SkDebugf("cross-checked %s\n", className.c_str());
+ bmhParser.fWroteOut = true;
return true;
}
@@ -683,13 +672,17 @@ void IncludeParser::dumpComment(Definition* token) {
}
// dump equivalent markup
-void IncludeParser::dumpTokens() {
+bool IncludeParser::dumpTokens(const string& dir) {
string skClassName = this->className();
- string fileName = skClassName + ".bmh";
+ string fileName = dir;
+ if (dir.length() && '/' != dir[dir.length() - 1]) {
+ fileName += '/';
+ }
+ fileName += skClassName + "_Reference.bmh";
fOut = fopen(fileName.c_str(), "wb");
if (!fOut) {
SkDebugf("could not open output file %s\n", fileName.c_str());
- return;
+ return false;
}
string prefixName = skClassName.substr(0, 2);
string topicName = skClassName.length() > 2 && isupper(skClassName[2]) &&
@@ -811,6 +804,8 @@ void IncludeParser::dumpTokens() {
fprintf(fOut, "#Topic %s ##" "\n",
topicName.c_str());
fclose(fOut);
+ SkDebugf("wrote %s\n", fileName.c_str());
+ return true;
}
bool IncludeParser::findComments(const Definition& includeDef, Definition* markupDef) {
@@ -960,7 +955,8 @@ bool IncludeParser::parseComment(const string& filename, const char* start, cons
if (!parser.skipWord(kKeyWords[(int) markupDef->fKeyWord].fName)) {
return reportError<bool>("missing object type");
}
- if (!parser.skipWord(markupDef->fName.c_str())) {
+ if (!parser.skipWord(markupDef->fName.c_str()) &&
+ KeyWord::kEnum != markupDef->fKeyWord) {
return reportError<bool>("missing object name");
}
@@ -1232,6 +1228,9 @@ bool IncludeParser::parseMethod(Definition* child, Definition* markupDef) {
break;
}
}
+ while (end > start && ' ' >= end[-1]) {
+ --end;
+ }
markupDef->fTokens.emplace_back(MarkType::kMethod, start, end, tokenIter->fLineCount,
markupDef);
Definition* markupChild = &markupDef->fTokens.back();
@@ -1404,14 +1403,14 @@ bool IncludeParser::parseChar() {
char test = *fChar;
if ('\\' == fPrev) {
if ('\n' == test) {
- ++fLineCount;
+// ++fLineCount;
fLine = fChar + 1;
}
goto done;
}
switch (test) {
case '\n':
- ++fLineCount;
+// ++fLineCount;
fLine = fChar + 1;
if (fInChar) {
return reportError<bool>("malformed char");
@@ -1777,7 +1776,7 @@ bool IncludeParser::parseChar() {
}
done:
fPrev = test;
- ++fChar;
+ this->next();
return true;
}
diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp
index 78b0364b06..90f0d6c171 100644
--- a/tools/bookmaker/includeWriter.cpp
+++ b/tools/bookmaker/includeWriter.cpp
@@ -79,12 +79,12 @@ void IncludeWriter::enumHeaderOut(const RootDefinition* root,
this->lfcr();
wroteHeader = true;
}
- this->rewriteBlock((int) (commentEnd - commentStart), commentStart);
+ this->rewriteBlock((int) (commentEnd - commentStart), commentStart, Phrase::kNo);
if (MarkType::kAnchor == test->fMarkType) {
commentStart = test->fContentStart;
commentEnd = test->fChildren[0]->fStart;
this->writeSpace();
- this->rewriteBlock((int) (commentEnd - commentStart), commentStart);
+ this->rewriteBlock((int) (commentEnd - commentStart), commentStart, Phrase::kNo);
this->writeSpace();
}
commentStart = test->fTerminator;
@@ -207,7 +207,7 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
this->indentToColumn(fEnumItemCommentTab);
this->writeString("//!<");
this->writeSpace();
- this->rewriteBlock(commentLen, commentStart);
+ this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
}
if (onePast) {
fIndent -= 4;
@@ -274,7 +274,8 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
if (!currentEnumItem->fShort) {
this->writeCommentHeader();
fIndent += 4;
- bool wroteLineFeed = Wrote::kLF == this->rewriteBlock(commentLen, commentStart);
+ bool wroteLineFeed = Wrote::kLF ==
+ this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
fIndent -= 4;
if (wroteLineFeed || fColumn > 100 - 3 /* space * / */ ) {
this->lfcr();
@@ -405,6 +406,9 @@ void IncludeWriter::enumSizeItems(const Definition& child) {
// walk children and output complete method doxygen description
void IncludeWriter::methodOut(const Definition* method, const Definition& child) {
+ if ("SkPath::getGenerationID" == method->fName) {
+ SkDebugf("");
+ }
fBmhMethod = method;
fMethodDef = &child;
fContinuation = nullptr;
@@ -427,14 +431,14 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child)
commentLen = (int) (methodProp->fStart - commentStart);
if (commentLen > 0) {
SkASSERT(commentLen < 1000);
- if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart)) {
+ if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart, Phrase::kNo)) {
this->lfcr();
}
}
commentStart = methodProp->fContentStart;
commentLen = (int) (methodProp->fContentEnd - commentStart);
if (commentLen > 0) {
- if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart)) {
+ if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart, Phrase::kNo)) {
this->lfcr();
}
}
@@ -447,7 +451,7 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child)
commentStart = methodProp->fContentStart;
commentLen = (int) (methodProp->fContentEnd - commentStart);
if (commentLen > 0) {
- if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart)) {
+ if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart, Phrase::kNo)) {
this->lfcr();
}
}
@@ -458,7 +462,7 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child)
commentLen = (int) (methodProp->fStart - commentStart);
if (commentLen > 0) {
SkASSERT(commentLen < 1000);
- if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart)) {
+ if (Wrote::kNone != this->rewriteBlock(commentLen, commentStart, Phrase::kNo)) {
this->lfcr();
}
}
@@ -474,7 +478,7 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child)
}
}
SkASSERT(commentLen > 0 && commentLen < 1500);
- this->rewriteBlock(commentLen, commentStart);
+ this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
// compute indention column
size_t column = 0;
bool hasParmReturn = false;
@@ -513,7 +517,7 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child)
// FIXME : detect this earlier; assert if #Return is empty
SkASSERT(partLen > 0 && partLen < 200);
fIndent = column;
- this->rewriteBlock(partLen, partStart);
+ this->rewriteBlock(partLen, partStart, Phrase::kYes);
fIndent = saveIndent;
this->lfcr();
}
@@ -525,6 +529,7 @@ void IncludeWriter::methodOut(const Definition* method, const Definition& child)
this->writeCommentTrailer();
fBmhMethod = nullptr;
fMethodDef = nullptr;
+ fWroteMethod = true;
}
void IncludeWriter::structOut(const Definition* root, const Definition& child,
@@ -537,15 +542,18 @@ void IncludeWriter::structOut(const Definition* root, const Definition& child,
this->writeString(child.fName.c_str());
fIndent += 4;
this->lfcr();
- this->rewriteBlock((int) (commentEnd - commentStart), commentStart);
+ this->rewriteBlock((int) (commentEnd - commentStart), commentStart, Phrase::kNo);
fIndent -= 4;
this->lfcr();
this->writeCommentTrailer();
}
Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const Definition& child) {
- const char* blockStart = fDeferComment ? fLastComment->fContentEnd : fStart;
- this->writeBlockTrim((int) (memberStart->fStart - blockStart), blockStart);
+ const char* blockStart = !fWroteMethod && fDeferComment ? fLastComment->fContentEnd : fStart;
+ const char* blockEnd = fWroteMethod && fDeferComment ? fDeferComment->fStart - 1 :
+ memberStart->fStart;
+ this->writeBlockTrim((int) (blockEnd - blockStart), blockStart);
+ fWroteMethod = false;
const char* commentStart = nullptr;
ptrdiff_t commentLen = 0;
string name(child.fContentStart, (int) (child.fContentEnd - child.fContentStart));
@@ -567,7 +575,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const
fIndent += 4;
for (auto child : commentBlock->fChildren) {
commentLen = child->fStart - commentStart;
- wroteLineFeed |= Wrote::kLF == this->rewriteBlock(commentLen, commentStart);
+ wroteLineFeed |= Wrote::kLF == this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
if (MarkType::kFormula == child->fMarkType) {
this->writeSpace();
this->writeBlock((int) (child->fContentEnd - child->fContentStart),
@@ -576,7 +584,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const
commentStart = child->fTerminator;
}
commentLen = commentBlock->fContentEnd - commentStart;
- wroteLineFeed |= Wrote::kLF == this->rewriteBlock(commentLen, commentStart);
+ wroteLineFeed |= Wrote::kLF == this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
fIndent -= 4;
if (wroteLineFeed || fColumn > 100 - 3 /* space * / */ ) {
this->lfcr();
@@ -610,7 +618,7 @@ Definition* IncludeWriter::structMemberOut(const Definition* memberStart, const
this->indentToColumn(fStructCommentTab);
this->writeString("//!<");
this->writeSpace();
- this->rewriteBlock(commentLen, commentStart);
+ this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
this->lfcr();
}
return valueEnd;
@@ -652,7 +660,10 @@ void IncludeWriter::structSizeMembers(Definition& child) {
case KeyWord::kConstExpr:
case KeyWord::kStatic:
case KeyWord::kInt:
+ case KeyWord::kUint8_t:
+ case KeyWord::kUint16_t:
case KeyWord::kUint32_t:
+ case KeyWord::kUint64_t:
case KeyWord::kSize_t:
case KeyWord::kFloat:
case KeyWord::kBool:
@@ -768,10 +779,14 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
}
if (fContinuation) {
if (Definition::Type::kKeyWord == child.fType) {
- if (KeyWord::kFriend == child.fKeyWord || KeyWord::kBool == child.fKeyWord ||
+ if (KeyWord::kFriend == child.fKeyWord ||
KeyWord::kSK_API == child.fKeyWord) {
continue;
}
+ const IncludeKey& includeKey = kKeyWords[(int) child.fKeyWord];
+ if (KeyProperty::kNumber == includeKey.fProperty) {
+ continue;
+ }
}
if (Definition::Type::kBracket == child.fType && Bracket::kParen == child.fBracket) {
if (!clonedMethod) {
@@ -832,6 +847,11 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
this->methodOut(method, child);
continue;
}
+ if (Definition::Type::kPunctuation == child.fType &&
+ Punctuation::kAsterisk == child.fPunctuation &&
+ clonedMethod) {
+ continue;
+ }
if (inConstructor) {
continue;
}
@@ -983,7 +1003,10 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
case KeyWord::kConstExpr:
case KeyWord::kStatic:
case KeyWord::kInt:
+ case KeyWord::kUint8_t:
+ case KeyWord::kUint16_t:
case KeyWord::kUint32_t:
+ case KeyWord::kUint64_t:
case KeyWord::kUnsigned:
case KeyWord::kSize_t:
case KeyWord::kFloat:
@@ -1024,6 +1047,8 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
fIndent -= 4;
fContinuation = nullptr;
fDeferComment = nullptr;
+ } else if (KeyWord::kUint8_t == child.fKeyWord) {
+ continue;
} else {
if (fInEnum && KeyWord::kClass == child.fChildren[0]->fKeyWord) {
if (!this->populate(child.fChildren[0], &pair, root)) {
@@ -1039,6 +1064,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
if (KeyWord::kEnum == child.fParent->fKeyWord ||
(KeyWord::kClass == child.fParent->fKeyWord && child.fParent->fParent &&
KeyWord::kEnum == child.fParent->fParent->fKeyWord)) {
+ SkASSERT(Bracket::kBrace == child.fBracket);
this->enumMembersOut(root, child);
this->writeString("};");
this->lf(2);
@@ -1098,6 +1124,9 @@ bool IncludeWriter::populate(BmhParser& bmhParser) {
bool allPassed = true;
for (auto& includeMapper : fIncludeMap) {
size_t lastSlash = includeMapper.first.rfind('/');
+ if (string::npos == lastSlash) {
+ lastSlash = includeMapper.first.rfind('\\');
+ }
if (string::npos == lastSlash || lastSlash >= includeMapper.first.length() - 1) {
return this->reportError<bool>("malformed include name");
}
@@ -1126,6 +1155,7 @@ bool IncludeWriter::populate(BmhParser& bmhParser) {
this->lfcr();
this->writePending();
fclose(fOut);
+ SkDebugf("wrote %s\n", fileName.c_str());
}
return allPassed;
}
@@ -1226,17 +1256,21 @@ string IncludeWriter::resolveRef(const char* start, const char* end, bool first,
(int) (child->fContentEnd - child->fContentStart));
break;
}
- if (MarkType::kClass == child->fMarkType ||
- MarkType::kStruct == child->fMarkType ||
- MarkType::kEnum == child->fMarkType ||
- MarkType::kEnumClass == child->fMarkType) {
- substitute = child->fName;
- if (MarkType::kEnum == child->fMarkType && fInEnum) {
- size_t parentClassEnd = substitute.find("::");
- SkASSERT(string::npos != parentClassEnd);
- substitute = substitute.substr(parentClassEnd + 2);
+ }
+ if (!substitute.length()) {
+ for (auto child : rootDef->fChildren) {
+ if (MarkType::kClass == child->fMarkType ||
+ MarkType::kStruct == child->fMarkType ||
+ (MarkType::kEnum == child->fMarkType && !child->fAnonymous) ||
+ MarkType::kEnumClass == child->fMarkType) {
+ substitute = child->fName;
+ if (MarkType::kEnum == child->fMarkType && fInEnum) {
+ size_t parentClassEnd = substitute.find("::");
+ SkASSERT(string::npos != parentClassEnd);
+ substitute = substitute.substr(parentClassEnd + 2);
+ }
+ break;
}
- break;
}
}
if (!substitute.length()) {
@@ -1244,7 +1278,7 @@ string IncludeWriter::resolveRef(const char* start, const char* end, bool first,
if (parent) {
if (MarkType::kClass == parent->fMarkType ||
MarkType::kStruct == parent->fMarkType ||
- MarkType::kEnum == parent->fMarkType ||
+ (MarkType::kEnum == parent->fMarkType && !parent->fAnonymous) ||
MarkType::kEnumClass == parent->fMarkType) {
if (parent->fParent != fRootTopic) {
substitute = parent->fName;
@@ -1324,7 +1358,7 @@ int IncludeWriter::lookupReference(const PunctuationState punctuation, const Wor
}
/* returns true if rewriteBlock wrote linefeeds */
-IncludeWriter::Wrote IncludeWriter::rewriteBlock(int size, const char* data) {
+IncludeWriter::Wrote IncludeWriter::rewriteBlock(int size, const char* data, Phrase phrase) {
bool wroteLineFeeds = false;
while (size > 0 && data[0] <= ' ') {
--size;
@@ -1338,7 +1372,8 @@ IncludeWriter::Wrote IncludeWriter::rewriteBlock(int size, const char* data) {
}
int run = 0;
Word word = Word::kStart;
- PunctuationState punctuation = PunctuationState::kStart;
+ PunctuationState punctuation = Phrase::kNo == phrase ?
+ PunctuationState::kStart : PunctuationState::kSpace;
int start = 0;
int lastWrite = 0;
int lineFeeds = 0;
diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp
index 0a53fc4147..b0cec6659b 100644
--- a/tools/bookmaker/mdOut.cpp
+++ b/tools/bookmaker/mdOut.cpp
@@ -22,7 +22,9 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
bool lineStart = true;
string ref;
string leadingSpaces;
+ int distFromParam = 99;
do {
+ ++distFromParam;
const char* base = t.fChar;
t.skipWhiteSpace();
const char* wordStart = t.fChar;
@@ -138,6 +140,8 @@ string MdOut::addReferences(const char* refStart, const char* refEnd,
const Definition* def;
if (fMethod && (def = fMethod->hasParam(ref))) {
result += linkRef(leadingSpaces, def, ref);
+ fLastParam = def;
+ distFromParam = 0;
continue;
} else if (!fInDescription && ref[0] != '0'
&& string::npos != ref.find_first_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ")) {
@@ -145,6 +149,23 @@ 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) {
+ const Definition* paramType = this->findParamType();
+ if (paramType) {
+ string fullName = paramType->fName + "::" + ref;
+ bool found = false;
+ for (auto child : paramType->fChildren) {
+ if (fullName == child->fName) {
+ result += linkRef(leadingSpaces, paramType, ref);
+ found = true;
+ break;
+ }
+ }
+ if (found) {
+ continue;
+ }
+ }
+ }
if (BmhParser::Resolvable::kOut != resolvable) {
t.reportError("missed camelCase");
return result;
@@ -242,6 +263,7 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) {
filename = match + ".md";
match += ".bmh";
fOut = nullptr;
+ string fullName;
for (const auto& topic : fBmhParser.fTopicMap) {
Definition* topicDef = topic.second;
if (topicDef->fParent) {
@@ -255,7 +277,7 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) {
continue;
}
if (!fOut) {
- string fullName(outDir);
+ fullName = outDir;
if ('/' != fullName.back()) {
fullName += '/';
}
@@ -279,6 +301,7 @@ bool MdOut::buildRefFromFile(const char* name, const char* outDir) {
if (fOut) {
this->writePending();
fclose(fOut);
+ SkDebugf("wrote %s\n", fullName.c_str());
fOut = nullptr;
}
return true;
@@ -330,6 +353,31 @@ void MdOut::childrenOut(const Definition* def, const char* start) {
}
}
+const Definition* MdOut::findParamType() {
+ SkASSERT(fMethod);
+ TextParser parser(fMethod->fFileName, fMethod->fStart, fMethod->fContentStart,
+ fMethod->fLineCount);
+ string lastFull;
+ do {
+ parser.skipToAlpha();
+ if (parser.eof()) {
+ return nullptr;
+ }
+ const char* word = parser.fChar;
+ parser.skipFullName();
+ SkASSERT(!parser.eof());
+ string name = string(word, parser.fChar - word);
+ if (fLastParam->fName == name) {
+ const Definition* paramType = this->isDefined(parser, lastFull, false);
+ return paramType;
+ }
+ if (isupper(name[0])) {
+ lastFull = name;
+ }
+ } while (true);
+ return nullptr;
+}
+
const Definition* MdOut::isDefined(const TextParser& parser, const string& ref, bool report) const {
auto rootIter = fBmhParser.fClassMap.find(ref);
if (rootIter != fBmhParser.fClassMap.end()) {
diff --git a/tools/bookmaker/spellCheck.cpp b/tools/bookmaker/spellCheck.cpp
index 06a5d2be70..7a45fb04ed 100644
--- a/tools/bookmaker/spellCheck.cpp
+++ b/tools/bookmaker/spellCheck.cpp
@@ -485,9 +485,11 @@ void SpellCheck::report(SkCommandLineFlags::StringArray report) {
}
}
SkDebugf("\n");
+ return;
}
if (report.contains("all")) {
int column = 0;
+ char lastInitial = 'a';
for (auto iter : elems) {
if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
continue;
@@ -509,50 +511,47 @@ void SpellCheck::report(SkCommandLineFlags::StringArray report) {
if (!allLower) {
continue;
}
- if (column + check.length() > 100) {
+ if (column + check.length() > 100 || check[0] != lastInitial) {
SkDebugf("\n");
column = 0;
}
+ if (check[0] != lastInitial) {
+ SkDebugf("\n");
+ lastInitial = check[0];
+ }
SkDebugf("%s ", check.c_str());
column += check.length();
}
SkDebugf("\n\n");
+ return;
}
- if (report.contains("mispellings")) {
- const char* mispelled[] = {
- "decrementing",
- "differentially",
- "incrementing",
- "superset",
- };
- const char** mispellPtr = mispelled;
- const char** mispellEnd = &mispelled[SK_ARRAY_COUNT(mispelled)];
- for (auto iter : elems) {
- if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
- continue;
- }
- if (string::npos != iter.second.fFile.find("markup.bmh")) {
- continue;
- }
- if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) {
- continue;
- }
- string check = iter.first.c_str();
- while (check.compare(*mispellPtr) > 0) {
- SkDebugf("%s not found\n", *mispellPtr);
- if (mispellEnd == ++mispellPtr) {
- break;
- }
- }
- if (mispellEnd == mispellPtr) {
+ int index = 0;
+ const char* mispelled = report[0];
+ for (auto iter : elems) {
+ if (string::npos != iter.second.fFile.find("undocumented.bmh")) {
+ continue;
+ }
+ if (string::npos != iter.second.fFile.find("markup.bmh")) {
+ continue;
+ }
+ if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) {
+ continue;
+ }
+ string check = iter.first.c_str();
+ while (check.compare(mispelled) > 0) {
+ SkDebugf("%s not found\n", mispelled);
+ if (report.count() == ++index) {
break;
}
- if (check.compare(*mispellPtr) == 0) {
- SkDebugf("%s(%d): %s\n", iter.second.fFile.c_str(), iter.second.fLine,
- iter.first.c_str());
- if (mispellEnd == ++mispellPtr) {
- break;
- }
+ }
+ if (report.count() == index) {
+ break;
+ }
+ if (check.compare(mispelled) == 0) {
+ SkDebugf("%s(%d): %s\n", iter.second.fFile.c_str(), iter.second.fLine,
+ iter.first.c_str());
+ if (report.count() == ++index) {
+ break;
}
}
}