feedback

feedback from include review

Docs-Preview: https://skia.org/?cl=49260
Bug: skia: 6898
Change-Id: Ic60980dfe53d14fd8c6973ef2f4dabb6b650cdd8
Reviewed-on: https://skia-review.googlesource.com/49260
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
diff --git a/docs/SkPixmap_Reference.bmh b/docs/SkPixmap_Reference.bmh
index 409090b..521d6de 100644
--- a/docs/SkPixmap_Reference.bmh
+++ b/docs/SkPixmap_Reference.bmh
@@ -98,21 +98,21 @@
 #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);

-    }

+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:  0  height:  0  color: kUnknown_SkColorType  alpha: kUnknown_SkAlphaType
 width: 25  height: 35  color: kRGBA_8888_SkColorType  alpha: kOpaque_SkAlphaType
 ##
 ##
@@ -126,16 +126,13 @@
 #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.
+addr points to pixels, or nullptr. rowBytes should be info.width() times
+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
+The memory lifetime of pixels is 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
@@ -153,14 +150,14 @@
 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("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

+image alpha only = false
 copy alpha only = true
 ##
 ##
@@ -180,22 +177,22 @@
 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();

-    }

-}

+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

+width:  0  height:  0  color: kUnknown_SkColorType  alpha: kUnknown_SkAlphaType
 ##
 ##
 
@@ -209,11 +206,8 @@
 
 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.
+Sets row bytes from rowBytes, which should be info.width() times
+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.  
@@ -228,21 +222,21 @@
 #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;

-    }

+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;
+    }
 }
 ##
 
@@ -257,18 +251,18 @@
 
 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.
+Color_Space 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 ");   

+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
@@ -296,26 +290,26 @@
 #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

-##

+    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()
@@ -340,18 +334,18 @@
 #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);

-    }

+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);
+    }
 }
 ##
 
@@ -367,29 +361,29 @@
 
 #Method const SkImageInfo& info() const 
 
-Returns width, height, SkAlphaType, and SkColorType.
+Returns width, height, Alpha_Type, Color_Type, and Color_Space.
 
 #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

-##

+    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
@@ -419,7 +413,7 @@
        pixmap.info().minRowBytes());
 }
 #StdOut
-rowBytes: 2 minRowBytes: 4

+rowBytes: 2 minRowBytes: 4
 rowBytes: 8 minRowBytes: 4
 ##
 ##
@@ -432,7 +426,7 @@
 
 #Method const void* addr() const 
 
-Returns pixel address, the base corresponding the pixel origin.
+Returns pixel address, the base address corresponding to the pixel origin.
 
 It is up to the Pixmap creator to ensure that pixel address is a useful value.
 
@@ -440,21 +434,21 @@
 
 #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

-##

+    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()
@@ -475,11 +469,11 @@
 
 #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

-##

+    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()
@@ -496,11 +490,11 @@
 
 #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

-##

+    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()
@@ -518,13 +512,13 @@
 #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

+    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()
@@ -541,9 +535,9 @@
 #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()]);

+    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
 ##
@@ -566,16 +560,16 @@
 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

-##

+    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
@@ -595,24 +589,24 @@
 #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);

-    }

+    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: false
+isOpaque: false
+isOpaque: true
 isOpaque: true
 ##
 ##
@@ -636,15 +630,15 @@
 #Example
     for (int width : { 0, 2 } ) {
         for (int height : { 0, 2 } ) {
-             SkPixmap pixmap(SkImageInfo::MakeA8(width, height), nullptr, width);

+             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: 0 height: 0 empty: true
+width: 0 height: 2 empty: true
+width: 2 height: 0 empty: true
 width: 2 height: 2 empty: false
 ##
 ##
@@ -664,15 +658,15 @@
 #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());

-    }

+    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: 4 rowBytesAsPixels: 1
+rowBytes: 5 rowBytesAsPixels: 1
+rowBytes: 6 rowBytesAsPixels: 1
+rowBytes: 7 rowBytesAsPixels: 1
 rowBytes: 8 rowBytesAsPixels: 2
 ##
 ##
@@ -691,26 +685,26 @@
 #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());

-    }

+    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: 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
 ##
 ##
@@ -729,25 +723,25 @@
 #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

-##

+    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
@@ -764,24 +758,24 @@
 #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

+    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
 ##
 ##
@@ -802,26 +796,26 @@
 #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());

-        }

-    }

+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

+#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
 ##
 ##
 
@@ -839,7 +833,7 @@
 
 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
+without alpha in 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
@@ -849,29 +843,29 @@
 For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or
 greater.
 
-Returns false for any other Color_Type. 
+Returns false for kUnknown_SkColorType. 
 
 #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);

+    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: false
+computeIsOpaque: true
+computeIsOpaque: false
 computeIsOpaque: true
 ##
 ##
@@ -896,43 +890,43 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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' : ' ');

-        }

-    }

+    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 

+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 
 ##
 ##
@@ -954,17 +948,17 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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);

+    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
@@ -989,11 +983,11 @@
 #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]));

+    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
@@ -1018,11 +1012,11 @@
 #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]));

+    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
@@ -1047,11 +1041,11 @@
 #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]));

+    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
@@ -1076,11 +1070,11 @@
 #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]));

+    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
@@ -1106,11 +1100,11 @@
 #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]));

+    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
@@ -1134,19 +1128,19 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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] ? '=' : '!');

+    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]
 ##
@@ -1168,17 +1162,17 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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]));

+    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
@@ -1202,17 +1196,17 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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]));

+    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
@@ -1236,17 +1230,17 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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]));

+    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
@@ -1273,21 +1267,21 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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] ? '=' : '!');

+    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]
 ##
@@ -1310,21 +1304,21 @@
 #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",

+    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.writable_addr() == (void *)storage
+pixmap.getColor(0, 1) == 0x00000000
 pixmap.getColor(0, 0) == 0xFFFFFFFF
 ##
 ##
@@ -1342,27 +1336,27 @@
 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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",

+    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.writable_addr() == (void *)storage
+pixmap.getColor(0, 0) == 0x00000000
 pixmap.getColor(1, 2) == 0xFFFFFFFF
 ##
 ##
@@ -1375,14 +1369,14 @@
 
 #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.
+Returns writable pixel address at (x, y). 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and less than height() ##
 
 #Return  writable unsigned 8-bit pointer to pixels ##
 
@@ -1393,21 +1387,21 @@
 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);

+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);
 }
 ##
 
@@ -1419,14 +1413,14 @@
 
 #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.
+Returns writable_addr pixel address at (x, y). 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and less than height() ##
 
 #Return  writable unsigned 16-bit pointer to pixel ##
 
@@ -1436,19 +1430,19 @@
 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);

+    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);
 ##
 
@@ -1460,35 +1454,36 @@
 
 #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.
+Returns writable pixel address at (x, y). 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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);

+    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);
 ##
 
@@ -1500,29 +1495,29 @@
 
 #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.
+Returns writable pixel address at (x, y). 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and 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);

+    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);
 ##
 
@@ -1534,15 +1529,15 @@
 
 #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.
+Returns writable pixel address at (x, y). 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() ##
+#Param x  column index, zero or greater, and less than width() ##
+#Param y  row index, zero or greater, and less than height() ##
 
 #Return  writable unsigned 16-bit pointer to first component of pixel ##
 
@@ -1552,23 +1547,23 @@
 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);

+    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
@@ -1584,12 +1579,13 @@
 #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
+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 
+. 
+
+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.
@@ -1604,7 +1600,11 @@
 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()
+abs(srcX) >= this->width()
+##
+, or if
+#Formula
+abs(srcY) >= this->height()
 ##
 .
 
@@ -1629,17 +1629,17 @@
 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);

+    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} ) {

+    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;
     }
@@ -1663,7 +1663,9 @@
 #Formula
 (this->width(), this->height())
 ##
-. dstInfo specifies width, height, Color_Type, Alpha_Type, and 
+.
+
+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.
@@ -1689,28 +1691,28 @@
 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);

+    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);
 ##
 
@@ -1728,7 +1730,9 @@
 #Formula
 (this->width(), this->height())
 ##
-. dstInfo specifies width, height, Color_Type, Alpha_Type, and 
+.
+
+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.
@@ -1743,7 +1747,11 @@
 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()
+abs(srcX) >= this->width()
+##
+, or if
+#Formula
+abs(srcY) >= this->height()
 ##
 .
 
@@ -1757,23 +1765,23 @@
 
 #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);

-    }

+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);
+    }
 }
 ##
 
@@ -1801,7 +1809,11 @@
 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()
+abs(srcX) >= this->width()
+##
+, or if
+#Formula
+abs(srcY) >= this->height()
 ##
 .
 
@@ -1813,23 +1825,23 @@
 
 #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);

-    }

+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);
+    }
 }
 ##
 
@@ -1861,23 +1873,23 @@
 
 #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);

-    }

+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);
+    }
 }
 ##
 
@@ -1919,25 +1931,25 @@
 
 #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);

-    }

+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);
+    }
 }
 ##
 
@@ -1959,15 +1971,15 @@
 #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);

+    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
@@ -1987,14 +1999,14 @@
 #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);

+    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
@@ -2016,17 +2028,17 @@
 #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);

+    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