aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-05-16 07:07:07 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-16 11:35:24 +0000
commit682c58da482155213e8cd2834b57bc6541e510a0 (patch)
tree63d666ea9ec0c2e765557e61e9ec5fc78ad9747f /docs
parent4c2a34e4804e5affa8447b590578a359bad2caf8 (diff)
Documentation refresh
- add links to types within methods - add check to see that all references and definitions match - add style to tables to make them easier to read - use https everywhere - remove trailing spaces - move overview inside class - split class and struct in summary tables - add missing #Line - clean up SkImageInfo constant documentation - work on SkColor documentation - allow common phrases to take different parameters - add more flexibility to generated tables - tighten token parent requirements - generalize deprecated and example interfaces - detect inner constructors R=caryclark@google.com Docs-Preview: https://skia.org/?cl=121799 Bug: skia:6898 Change-Id: Ia75a23740b80259460916890b310e2a9f024962a Reviewed-on: https://skia-review.googlesource.com/121799 Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/SkAutoCanvasRestore_Reference.bmh10
-rw-r--r--docs/SkBitmap_Reference.bmh223
-rw-r--r--docs/SkCanvas_Reference.bmh192
-rw-r--r--docs/SkColor4f_Reference.bmh26
-rw-r--r--docs/SkColor_Reference.bmh644
-rw-r--r--docs/SkIPoint_Reference.bmh26
-rw-r--r--docs/SkIRect_Reference.bmh62
-rw-r--r--docs/SkImageInfo_Reference.bmh1257
-rw-r--r--docs/SkImage_Reference.bmh94
-rw-r--r--docs/SkMatrix_Reference.bmh145
-rw-r--r--docs/SkPaint_Reference.bmh144
-rw-r--r--docs/SkPath_Reference.bmh600
-rw-r--r--docs/SkPixmap_Reference.bmh160
-rw-r--r--docs/SkPoint_Reference.bmh33
-rw-r--r--docs/SkRect_Reference.bmh94
-rw-r--r--docs/SkSurface_Reference.bmh65
-rw-r--r--docs/catalogHeader.txt2
-rw-r--r--docs/illustrations.bmh10
-rw-r--r--docs/markup.bmh6
-rw-r--r--docs/undocumented.bmh98
-rw-r--r--docs/usingBookmaker.bmh4
21 files changed, 2078 insertions, 1817 deletions
diff --git a/docs/SkAutoCanvasRestore_Reference.bmh b/docs/SkAutoCanvasRestore_Reference.bmh
index fc0f988c2c..5a1e2e05bf 100644
--- a/docs/SkAutoCanvasRestore_Reference.bmh
+++ b/docs/SkAutoCanvasRestore_Reference.bmh
@@ -1,17 +1,15 @@
#Topic Automatic_Canvas_Restore
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkAutoCanvasRestore
Stack helper class calls SkCanvas::restoreToCount when SkAutoCanvasRestore
goes out of scope. Use this to guarantee that the canvas is restored to a known
state.
+#Subtopic Overview
+#Populate
+##
+
#Subtopic Constructor
#Populate
##
diff --git a/docs/SkBitmap_Reference.bmh b/docs/SkBitmap_Reference.bmh
index 4e9e192f72..4d949a5887 100644
--- a/docs/SkBitmap_Reference.bmh
+++ b/docs/SkBitmap_Reference.bmh
@@ -2,12 +2,6 @@
#Alias Bitmaps
#Alias Bitmap_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkBitmap
Bitmap describes a two-dimensional raster pixel array. Bitmap is built on
@@ -17,8 +11,8 @@ Bitmap points to Pixel_Ref, which describes the physical array of pixels.
Image_Info bounds may be located anywhere fully inside Pixel_Ref bounds.
Bitmap can be drawn using Canvas. Bitmap can be a drawing destination for Canvas
-draw methods. Bitmap flexibility as a pixel container limits some optimizations
-available to the target platform.
+draw member functionss. Bitmap flexibility as a pixel container limits some
+optimizations available to the target platform.
If pixel array is primarily read-only, use Image for better performance.
If pixel array is primarily written to, use Surface for better performance.
@@ -39,6 +33,10 @@ number of bytes in a pixel. Row_Bytes may be larger than the row requires. This
is useful to position one or more Bitmaps within a shared pixel array.
##
+#Subtopic Overview
+ #Populate
+##
+
#Subtopic Related_Function
#Populate
##
@@ -47,7 +45,7 @@ is useful to position one or more Bitmaps within a shared pixel array.
#Populate
##
-#Subtopic Class_or_Struct
+#Subtopic Class
#Populate
##
@@ -116,7 +114,7 @@ allocPixels.
# ------------------------------------------------------------------------------
#Method bool allocPixelRef(SkBitmap* bitmap) override
-
+#Line # allocates pixel memory ##
Allocates the pixel memory for the bitmap, given its dimensions and
Color_Type. Returns true on success, where success means either setPixels
or setPixelRef was called.
@@ -153,7 +151,7 @@ pixel address = 0x560ddd0ac670
#Method SkBitmap()
#Line # constructs with default values ##
-Creates an empty Bitmap without pixels, with kUnknown_SkColorType,
+Creates an empty Bitmap without pixels, with kUnknown_SkColorType,
kUnknown_SkAlphaType, and with a width and height of zero. Pixel_Ref origin is
set to (0, 0). Bitmap is not volatile.
@@ -204,7 +202,7 @@ void draw(SkCanvas* canvas) {
if (original.tryAllocPixels(
SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {
SkDebugf("original has pixels before copy: %s\n", original.getPixels() ? "true" : "false");
- SkBitmap copy(original);
+ SkBitmap copy(original);
SkDebugf("original has pixels after copy: %s\n", original.getPixels() ? "true" : "false");
SkDebugf("copy has pixels: %s\n", copy.getPixels() ? "true" : "false");
}
@@ -238,7 +236,7 @@ void draw(SkCanvas* canvas) {
if (original.tryAllocPixels(
SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {
SkDebugf("original has pixels before move: %s\n", original.getPixels() ? "true" : "false");
- SkBitmap copy(std::move(original));
+ SkBitmap copy(std::move(original));
SkDebugf("original has pixels after move: %s\n", original.getPixels() ? "true" : "false");
SkDebugf("copy has pixels: %s\n", copy.getPixels() ? "true" : "false");
}
@@ -286,7 +284,7 @@ void draw(SkCanvas* canvas) {
if (original.tryAllocPixels(
SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {
SkDebugf("original has pixels before copy: %s\n", original.getPixels() ? "true" : "false");
- SkBitmap copy = original;
+ SkBitmap copy = original;
SkDebugf("original has pixels after copy: %s\n", original.getPixels() ? "true" : "false");
SkDebugf("copy has pixels: %s\n", copy.getPixels() ? "true" : "false");
}
@@ -320,7 +318,7 @@ void draw(SkCanvas* canvas) {
if (original.tryAllocPixels(
SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType))) {
SkDebugf("original has pixels before move: %s\n", original.getPixels() ? "true" : "false");
- SkBitmap copy = std::move(original);
+ SkBitmap copy = std::move(original);
SkDebugf("original has pixels after move: %s\n", original.getPixels() ? "true" : "false");
SkDebugf("copy has pixels: %s\n", copy.getPixels() ? "true" : "false");
}
@@ -471,7 +469,7 @@ Returns pixel count in each row. Should be equal or less than:
#Formula
rowBytes() / info().bytesPerPixel()
##
-.
+.
Maybe be less than pixelRef().width(). Will not exceed pixelRef().width() less
pixelRefOrigin().fX.
@@ -581,7 +579,7 @@ SkColorSpace::MakeSRGBLinear creates Color_Space with linear gamma
and an sRGB gamut. This Color_Space gamma is not close to sRGB gamma.
##
SkBitmap bitmap;
- bitmap.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
+ bitmap.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
SkColorSpace::MakeSRGBLinear()));
SkColorSpace* colorSpace = bitmap.colorSpace();
SkDebugf("gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\n",
@@ -612,7 +610,7 @@ The returned Color_Space is immutable.
#Example
SkBitmap bitmap1, bitmap2;
- bitmap1.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
+ bitmap1.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
SkColorSpace::MakeSRGBLinear()));
bitmap2.setInfo(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
bitmap1.refColorSpace()));
@@ -770,7 +768,7 @@ width: 2 height: 2 empty: false
##
##
-#SeeAlso height() width() drawsNothing
+#SeeAlso height() width() drawsNothing
##
@@ -842,7 +840,7 @@ empty:false isNull:false drawsNothing:false
#In Property
#Line # returns interval between rows in bytes ##
Returns row bytes, the interval from one pixel row to the next. Row bytes
-is at least as large as
+is at least as large as
#Formula
width() * info().bytesPerPixel()
##
@@ -892,7 +890,7 @@ If Alpha_Type is kUnknown_SkAlphaType, alphaType is ignored.
If Color_Type is kAlpha_8_SkColorType, returns true unless
alphaType is kUnknown_SkAlphaType and Alpha_Type is not kUnknown_SkAlphaType.
If Alpha_Type is kUnknown_SkAlphaType, alphaType is ignored. If alphaType is
-kUnpremul_SkAlphaType, it is treated as kPremul_SkAlphaType.
+kUnpremul_SkAlphaType, it is treated as kPremul_SkAlphaType.
This changes Alpha_Type in Pixel_Ref; all bitmaps sharing Pixel_Ref
are affected.
@@ -906,7 +904,7 @@ are affected.
void draw(SkCanvas* canvas) {
const char* colors[] = { "Unknown", "Alpha_8", "RGB_565", "ARGB_4444", "RGBA_8888", "RGB_888x",
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16" };
- const char* alphas[] = {"Unknown ", "Opaque ", "Premul ", "Unpremul"};
+ const char* alphas[] = {"Unknown ", "Opaque ", "Premul ", "Unpremul"};
SkBitmap bitmap;
SkAlphaType alphaTypes[] = { #list_of_alpha_types#
};
@@ -1013,12 +1011,12 @@ Most immutable Bitmap checks trigger an assert only on debug builds.
#Return true if pixels are immutable ##
#Example
- SkBitmap original;
+ SkBitmap original;
SkImageInfo info = SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType);
if (original.tryAllocPixels(info)) {
original.setImmutable();
SkBitmap copy;
- original.extractSubset(&copy, {5, 10, 15, 20});
+ original.extractSubset(&copy, {5, 10, 15, 20});
SkDebugf("original is " "%s" "immutable\n", original.isImmutable() ? "" : "not ");
SkDebugf("copy is " "%s" "immutable\n", copy.isImmutable() ? "" : "not ");
}
@@ -1038,11 +1036,11 @@ copy is immutable
#In Set
#Line # marks that pixels will not change ##
Sets internal flag to mark Bitmap as immutable. Once set, pixels can not change.
-Any other bitmap sharing the same Pixel_Ref are also marked as immutable.
+Any other bitmap sharing the same Pixel_Ref are also marked as immutable.
Once Pixel_Ref is marked immutable, the setting cannot be cleared.
Writing to immutable Bitmap pixels triggers an assert on debug builds.
-
+
#Example
#Description
Triggers assert if SK_DEBUG is true, runs fine otherwise.
@@ -1070,7 +1068,7 @@ Triggers assert if SK_DEBUG is true, runs fine otherwise.
Returns true if Alpha_Type is set to hint that all pixels are opaque; their
Color_Alpha value is implicitly or explicitly 1.0. If true, and all pixels are
-not opaque, Skia may draw incorrectly.
+not opaque, Skia may draw incorrectly.
Does not check if Color_Type allows Alpha, or if any pixel value has
transparency.
@@ -1118,12 +1116,12 @@ Volatile state is not shared by other bitmaps sharing the same Pixel_Ref.
#Return true if marked volatile ##
#Example
- SkBitmap original;
+ SkBitmap original;
SkImageInfo info = SkImageInfo::Make(25, 35, kRGBA_8888_SkColorType, kOpaque_SkAlphaType);
if (original.tryAllocPixels(info)) {
original.setIsVolatile(true);
SkBitmap copy;
- original.extractSubset(&copy, {5, 10, 15, 20});
+ original.extractSubset(&copy, {5, 10, 15, 20});
SkDebugf("original is " "%s" "volatile\n", original.isVolatile() ? "" : "not ");
SkDebugf("copy is " "%s" "volatile\n", copy.isImmutable() ? "" : "not ");
}
@@ -1153,7 +1151,7 @@ consumption on Device.
#Example
#Height 20
- SkBitmap bitmap;
+ SkBitmap bitmap;
bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));
bitmap.allocPixels();
bitmap.eraseColor(SK_ColorRED);
@@ -1178,14 +1176,14 @@ consumption on Device.
Resets to its initial state; all fields are set to zero, as if Bitmap had
been initialized by SkBitmap().
-Sets width, height, row bytes to zero; pixel address to nullptr; SkColorType to
+Sets width, height, row bytes to zero; pixel address to nullptr; SkColorType to
kUnknown_SkColorType; and SkAlphaType to kUnknown_SkAlphaType.
If Pixel_Ref is allocated, its reference count is decreased by one, releasing
its memory if Bitmap is the sole owner.
#Example
- SkBitmap bitmap;
+ SkBitmap bitmap;
bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));
bitmap.allocPixels();
SkDebugf("width:%d height:%d isNull:%s\n", bitmap.width(), bitmap.height(),
@@ -1220,7 +1218,7 @@ For Color_Type kARGB_4444_SkColorType: returns true if all pixel Alpha values ar
For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or
greater.
-Returns false for kUnknown_SkColorType.
+Returns false for kUnknown_SkColorType.
#Param bm Bitmap to check ##
@@ -1271,7 +1269,7 @@ Returns Rect { 0, 0, width(), height() }.
canvas->drawBitmap(source, 40, 40);
##
-#SeeAlso bounds()
+#SeeAlso bounds()
##
@@ -1294,7 +1292,7 @@ Returns IRect { 0, 0, width(), height() }.
canvas->drawBitmap(bitmap, 10, 10);
##
-#SeeAlso bounds()
+#SeeAlso bounds()
##
@@ -1319,7 +1317,7 @@ Returns IRect { 0, 0, width(), height() }.
}
##
-#SeeAlso getBounds
+#SeeAlso getBounds
##
@@ -1385,7 +1383,7 @@ Sets width, height, Alpha_Type, Color_Type, Color_Space, and optional
rowBytes. Frees pixels, and returns true if successful.
imageInfo.alphaType may be altered to a value permitted by imageInfo.colorSpace.
-If imageInfo.colorType is kUnknown_SkColorType, imageInfo.alphaType is
+If imageInfo.colorType is kUnknown_SkColorType, imageInfo.alphaType is
set to kUnknown_SkAlphaType.
If imageInfo.colorType is kAlpha_8_SkColorType and imageInfo.alphaType is
kUnpremul_SkAlphaType, imageInfo.alphaType is replaced by kPremul_SkAlphaType.
@@ -1444,7 +1442,8 @@ canvas->drawBitmap(bitmap, 0, 0);
AllocFlags provides the option to zero pixel memory when allocated.
#Const kZeroPixels_AllocFlag 1
- Instructs tryAllocPixelsFlags and allocPixelsFlags to zero pixel memory.
+#Line # zero pixel memory ##
+ Instructs tryAllocPixelsFlags and allocPixelsFlags to zero pixel memory.
##
#NoExample
@@ -1464,7 +1463,7 @@ AllocFlags provides the option to zero pixel memory when allocated.
#In Allocate
#Line # allocates pixels from Image_Info with options if possible ##
Sets Image_Info to info following the rules in setInfo and allocates pixel
-memory. If flags is kZeroPixels_AllocFlag, memory is zeroed.
+memory. If flags is kZeroPixels_AllocFlag, memory is zeroed.
Returns false and calls reset() if Image_Info could not be set, or memory could
not be allocated, or memory could not optionally be zeroed.
@@ -1485,7 +1484,7 @@ subsequently calling eraseColor with SK_ColorTRANSPARENT.
#Example
SkBitmap bitmap;
- if (!bitmap.tryAllocPixelsFlags(SkImageInfo::MakeN32(10000, 10000, kOpaque_SkAlphaType),
+ if (!bitmap.tryAllocPixelsFlags(SkImageInfo::MakeN32(10000, 10000, kOpaque_SkAlphaType),
SkBitmap::kZeroPixels_AllocFlag)) {
SkDebugf("bitmap allocation failed!\n");
} else {
@@ -1506,7 +1505,7 @@ bitmap allocation succeeded!
#In Allocate
#Line # allocates pixels from Image_Info with options, or aborts ##
Sets Image_Info to info following the rules in setInfo and allocates pixel
-memory. If flags is kZeroPixels_AllocFlag, memory is zeroed.
+memory. If flags is kZeroPixels_AllocFlag, memory is zeroed.
Aborts execution if Image_Info could not be set, or memory could
not be allocated, or memory could not optionally
@@ -1533,7 +1532,7 @@ lets the first draw show through.
##
###^
SkBitmap bitmap;
-bitmap.allocPixelsFlags(SkImageInfo::MakeN32(44, 16, kPremul_SkAlphaType),
+bitmap.allocPixelsFlags(SkImageInfo::MakeN32(44, 16, kPremul_SkAlphaType),
SkBitmap::kZeroPixels_AllocFlag);
SkCanvas offscreen(bitmap);
SkPaint paint;
@@ -1639,7 +1638,7 @@ for (int y : { 0, 64, 128, 192 } ) {
#Method bool SK_WARN_UNUSED_RESULT tryAllocPixels(const SkImageInfo& info)
Sets Image_Info to info following the rules in setInfo and allocates pixel
-memory.
+memory.
Returns false and calls reset() if Image_Info could not be set, or memory could
not be allocated.
@@ -1675,7 +1674,7 @@ if (bitmap.tryAllocPixels(SkImageInfo::Make(64, 64, kGray_8_SkColorType, kOpaque
#Method void allocPixels(const SkImageInfo& info)
Sets Image_Info to info following the rules in setInfo and allocates pixel
-memory.
+memory.
Aborts execution if Image_Info could not be set, or memory could
not be allocated. Abort steps may be provided by
@@ -1709,7 +1708,7 @@ for (int y : { 0, 64, 128, 192 } ) {
#Method bool SK_WARN_UNUSED_RESULT tryAllocN32Pixels(int width, int height, bool isOpaque = false)
#In Allocate
#Line # allocates compatible Color_ARGB pixels if possible ##
-Sets Image_Info to width, height, and Native_Color_Type; and allocates
+Sets Image_Info to width, height, and Native_Color_Type; and allocates
pixel memory. If isOpaque is true, sets Image_Info to kOpaque_SkAlphaType;
otherwise, sets to kPremul_SkAlphaType.
@@ -1751,7 +1750,7 @@ the platform. Bitmap drawn to output device skips converting its pixel format.
#Method void allocN32Pixels(int width, int height, bool isOpaque = false)
#In Allocate
#Line # allocates compatible Color_ARGB pixels, or aborts ##
-Sets Image_Info to width, height, and the Native_Color_Type; and allocates
+Sets Image_Info to width, height, and the Native_Color_Type; and allocates
pixel memory. If isOpaque is true, sets Image_Info to kPremul_SkAlphaType;
otherwise, sets to kOpaque_SkAlphaType.
@@ -1796,7 +1795,7 @@ the platform. Bitmap drawn to output device skips converting its pixel format.
#Line # creates Pixel_Ref, with optional release function ##
Sets Image_Info to info following the rules in setInfo, and creates Pixel_Ref
-containing pixels and rowBytes. releaseProc, if not nullptr, is called
+containing pixels and rowBytes. releaseProc, if not nullptr, is called
immediately on failure or when pixels are no longer referenced. context may be
nullptr.
@@ -1825,7 +1824,7 @@ releaseProc is called immediately because rowBytes is too small for Pixel_Ref.
#Function
static void releaseProc(void* addr, void* ) {
SkDebugf("releaseProc called\n");
- delete[] (uint32_t*) addr;
+ delete[] (uint32_t*) addr;
}
##
@@ -1994,10 +1993,10 @@ Returns false if info().colorType is kUnknown_SkColorType, or allocation fails.
#Example
#Height 50
-#Description
+#Description
Bitmap hosts and draws gray values in set1. tryAllocPixels replaces Pixel_Ref
and erases it to black, but does not alter set1. setPixels replaces black
-Pixel_Ref with set1.
+Pixel_Ref with set1.
##
uint8_t set1[5] = { 0xCA, 0xDA, 0xCA, 0xC9, 0xA3 };
SkBitmap bitmap;
@@ -2029,10 +2028,10 @@ time by defining SK_ABORT.
#Example
#Height 50
-#Description
+#Description
Bitmap hosts and draws gray values in set1. allocPixels replaces Pixel_Ref
and erases it to black, but does not alter set1. setPixels replaces black
-Pixel_Ref with set2.
+Pixel_Ref with set2.
##
uint8_t set1[5] = { 0xCA, 0xDA, 0xCA, 0xC9, 0xA3 };
uint8_t set2[5] = { 0xAC, 0xA8, 0x89, 0x47, 0x87 };
@@ -2071,7 +2070,7 @@ Returns false if Allocator::allocPixelRef return false.
#Description
HeapAllocator limits the maximum size of Bitmap to two gigabytes. Using
a custom allocator, this limitation may be relaxed. This example can be
-modified to allocate an eight gigabyte Bitmap on a 64 bit platform with
+modified to allocate an eight gigabyte Bitmap on a 64-bit platform with
sufficient memory.
##
#Function
@@ -2261,10 +2260,10 @@ Color_Type and Alpha_Type in Image_Info.
#Height 140
#Image 5
#Description
-Treating 32 bit data as 8 bit data is unlikely to produce useful results.
+Treating 32-bit data as 8-bit data is unlikely to produce useful results.
##
SkBitmap bitmap;
- bitmap.setInfo(SkImageInfo::Make(source.width() - 5, source.height() - 5,
+ bitmap.setInfo(SkImageInfo::Make(source.width() - 5, source.height() - 5,
kGray_8_SkColorType, kOpaque_SkAlphaType), source.rowBytes());
bitmap.setPixelRef(sk_ref_sp(source.pixelRef()), 5, 5);
canvas->drawBitmap(bitmap, 10, 10);
@@ -2300,7 +2299,7 @@ Returns true if Bitmap is can be drawn.
#Method uint32_t getGenerationID() const
#In Utility
#Line # returns unique ID ##
-Returns a unique value corresponding to the pixels in Pixel_Ref.
+Returns a unique value corresponding to the pixels in Pixel_Ref.
Returns a different value after notifyPixelsChanged has been called.
Returns zero if Pixel_Ref is nullptr.
@@ -2320,7 +2319,7 @@ Determines if pixels have changed since last examined.
empty id 0
alloc id 4
erase id 6
-##
+##
##
#SeeAlso notifyPixelsChanged Pixel_Ref
@@ -2332,12 +2331,12 @@ erase id 6
#Method void notifyPixelsChanged() const
#In Pixels
#Line # marks pixels as changed, altering the unique ID ##
-Marks that pixels in Pixel_Ref have changed. Subsequent calls to
+Marks that pixels in Pixel_Ref have changed. Subsequent calls to
getGenerationID() return a different value.
#Example
#Height 20
- SkBitmap bitmap;
+ SkBitmap bitmap;
bitmap.setInfo(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kOpaque_SkAlphaType));
bitmap.allocPixels();
bitmap.eraseColor(SK_ColorRED);
@@ -2357,7 +2356,7 @@ getGenerationID() return a different value.
# ------------------------------------------------------------------------------
#Subtopic Draw
#Populate
-#Line # set pixels to Color ##
+#Line # sets pixels to Color ##
##
#Method void eraseColor(SkColor c) const
@@ -2372,7 +2371,7 @@ then Color_RGB is ignored.
#Example
#Height 20
- SkBitmap bitmap;
+ SkBitmap bitmap;
bitmap.allocPixels(SkImageInfo::MakeN32(1, 1, kOpaque_SkAlphaType));
bitmap.eraseColor(SK_ColorRED);
canvas->scale(16, 16);
@@ -2401,7 +2400,7 @@ then r, g, and b are ignored.
#Example
#Height 80
- SkBitmap bitmap;
+ SkBitmap bitmap;
bitmap.allocPixels(SkImageInfo::MakeN32(1, 1, kPremul_SkAlphaType));
bitmap.eraseARGB(0x7f, 0xff, 0x7f, 0x3f);
canvas->scale(50, 50);
@@ -2416,7 +2415,7 @@ then r, g, and b are ignored.
# ------------------------------------------------------------------------------
#Method void eraseRGB(U8CPU r, U8CPU g, U8CPU b) const
-#Deprecated
+#Deprecated
##
# ------------------------------------------------------------------------------
@@ -2436,7 +2435,7 @@ then Color_RGB is ignored.
#Example
#Height 70
- SkBitmap bitmap;
+ SkBitmap bitmap;
bitmap.allocPixels(SkImageInfo::MakeN32(2, 2, kPremul_SkAlphaType));
bitmap.erase(0x7fff7f3f, SkIRect::MakeWH(1, 1));
bitmap.erase(0x7f7f3fff, SkIRect::MakeXYWH(0, 1, 1, 1));
@@ -2455,7 +2454,7 @@ then Color_RGB is ignored.
# ------------------------------------------------------------------------------
#Method void eraseArea(const SkIRect& area, SkColor c) const
-#Deprecated
+#Deprecated
##
# ------------------------------------------------------------------------------
@@ -2473,7 +2472,7 @@ 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
+conversion to Unpremultiplied Color; original pixel data may have additional
precision.
#Param x column index, zero or greater, and less than width() ##
@@ -2488,7 +2487,7 @@ precision.
0x00000000, 0x2a0e002a, 0x55380055, 0x7f7f007f,
0x2a000e2a, 0x551c1c55, 0x7f542a7f, 0xaaaa38aa,
0x55003855, 0x7f2a547f, 0xaa7171aa, 0xd4d48dd4,
- 0x7f007f7f, 0xaa38aaaa, 0xd48dd4d4, 0xffffffff,
+ 0x7f007f7f, 0xaa38aaaa, 0xd48dd4d4, 0xffffffff,
};
SkDebugf("Premultiplied:\n");
for (int y = 0; y < h; ++y) {
@@ -2509,15 +2508,15 @@ precision.
}
#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
+(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
+(0, 0) 0x00000000 0x2a5500ff 0x55a800ff 0x7fff00ff
+(0, 1) 0x2a0055ff 0x555454ff 0x7fa954ff 0xaaff54ff
+(0, 2) 0x5500a8ff 0x7f54a9ff 0xaaaaaaff 0xd4ffaaff
+(0, 3) 0x7f00ffff 0xaa54ffff 0xd4aaffff 0xffffffff
##
##
@@ -2536,7 +2535,7 @@ Input is not validated: out of bounds values of x or y, or kUnknown_SkColorType,
trigger an assert() if built with SK_DEBUG defined. Returns nullptr if
Color_Type is kUnknown_SkColorType, or Pixel_Ref is nullptr.
-Performs a lookup of pixel size; for better performance, call
+Performs a lookup of pixel size; for better performance, call
one of: getAddr8, getAddr16, or getAddr32.
#Param x column index, zero or greater, and less than width() ##
@@ -2564,7 +2563,7 @@ addr interval == rowBytes
#Method inline uint32_t* getAddr32(int x, int y) const
#In Property
#Line # returns readable pixel address as 32-bit pointer ##
-Returns address at (x, y).
+Returns address at (x, y).
Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
#List
@@ -2599,7 +2598,7 @@ addr interval == rowBytes
#Method inline uint16_t* getAddr16(int x, int y) const
#In Property
#Line # returns readable pixel address as 16-bit pointer ##
-Returns address at (x, y).
+Returns address at (x, y).
Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
#List
@@ -2617,7 +2616,7 @@ Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
#Example
#Image 3
SkBitmap bitmap16;
- SkImageInfo dstInfo = SkImageInfo::Make(source.width(), source.height(), kARGB_4444_SkColorType,
+ SkImageInfo dstInfo = SkImageInfo::Make(source.width(), source.height(), kARGB_4444_SkColorType,
kPremul_SkAlphaType);
bitmap16.allocPixels(dstInfo);
if (source.readPixels(dstInfo, bitmap16.getPixels(), bitmap16.rowBytes(), 0, 0)) {
@@ -2640,7 +2639,7 @@ addr interval == rowBytes
#Method inline uint8_t* getAddr8(int x, int y) const
#In Property
#Line # returns readable pixel address as 8-bit pointer ##
-Returns address at (x, y).
+Returns address at (x, y).
Input is not validated. Triggers an assert() if built with SK_DEBUG defined and:
#List
@@ -2693,7 +2692,7 @@ Return false if:
# dst is nullptr ##
# Pixel_Ref is nullptr ##
# subset does not intersect bounds() ##
-##
+##
#Param dst Bitmap set to subset ##
@@ -2715,11 +2714,11 @@ Return false if:
SkDebugf("subset: %4d, %4d, %4d, %4d ", b.fLeft, b.fTop, b.fRight, b.fBottom);
SkDebugf("success; %s", success ? "true" : "false");
if (success) {
- subset.getBounds(&s);
+ subset.getBounds(&s);
SkDebugf(" subset: %d, %d, %d, %d", s.fLeft, s.fTop, s.fRight, s.fBottom);
}
SkDebugf("\n");
- }
+ }
}
#StdOut
bounds: 0, 0, 512, 512
@@ -2750,9 +2749,9 @@ subset: 1000, 100, 1000, 200 success; false
#Line # copies and converts pixels ##
Copies Rect of pixels from Bitmap pixels to dstPixels. Copy starts at (srcX, srcY),
-and does not exceed Bitmap (width(), height()).
+and does not exceed Bitmap (width(), 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:
#List
@@ -2767,10 +2766,10 @@ If Bitmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match.
If Bitmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must
match. If Bitmap 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
+false if width() or height() is zero or negative.
+Returns false if
#Formula
abs(srcX) >= Bitmap width()
##
@@ -2791,7 +2790,7 @@ pixels are treated as if they are linear, regardless of how they are encoded.
#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
+ SkTransferFunctionBehavior::kIgnore
##
#Return true if pixels are copied to dstPixels ##
@@ -2835,7 +2834,7 @@ void draw(SkCanvas* canvas) {
int srcX, int srcY) const
Copies a Rect of pixels from Bitmap to dstPixels. Copy starts at (srcX, srcY),
-and does not exceed Bitmap (width(), height()).
+and does not exceed Bitmap (width(), 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.
@@ -2852,10 +2851,10 @@ If Bitmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match.
If Bitmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must
match. If Bitmap 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
+Returns false if
#Formula
abs(srcX) >= Bitmap width()
##
@@ -2910,7 +2909,7 @@ creates visible banding.
#Method bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
Copies a Rect of pixels from Bitmap to dst. Copy starts at (srcX, srcY), and
-does not exceed Bitmap (width(), height()).
+does not exceed Bitmap (width(), height()).
dst specifies width, height, Color_Type, Alpha_Type, Color_Space, pixel storage,
and row bytes of destination. dst.rowBytes specifics the gap from one destination
@@ -2927,10 +2926,10 @@ If Bitmap colorType is kGray_8_SkColorType, dst Color_Space must match.
If Bitmap alphaType is kOpaque_SkAlphaType, dst Alpha_Type must
match. If Bitmap colorSpace is nullptr, dst Color_Space 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
+false if width() or height() is zero or negative.
+Returns false if
#Formula
abs(srcX) >= Bitmap width()
##
@@ -2974,7 +2973,7 @@ abs(srcY) >= Bitmap height()
#Method bool readPixels(const SkPixmap& dst) const
Copies a Rect of pixels from Bitmap to dst. Copy starts at (0, 0), and
-does not exceed Bitmap (width(), height()).
+does not exceed Bitmap (width(), height()).
dst specifies width, height, Color_Type, Alpha_Type, Color_Space, pixel storage,
and row bytes of destination. dst.rowBytes specifics the gap from one destination
@@ -2991,7 +2990,7 @@ If Bitmap colorType is kGray_8_SkColorType, dst Color_Space must match.
If Bitmap alphaType is kOpaque_SkAlphaType, dst Alpha_Type must
match. If Bitmap colorSpace is nullptr, dst Color_Space must match. Returns
false if pixel conversion is not possible.
-
+
#Param dst destination Pixmap: Image_Info, pixels, row bytes ##
#Return true if pixels are copied to dst ##
@@ -3002,7 +3001,7 @@ false if pixel conversion is not possible.
std::vector<int32_t> srcPixels;
srcPixels.resize(source.height() * source.width() * 8);
for (int i = 0; i < 2; ++i) {
- SkPixmap pixmap(SkImageInfo::Make(source.width() * 2, source.height(),
+ SkPixmap pixmap(SkImageInfo::Make(source.width() * 2, source.height(),
i ? kRGBA_8888_SkColorType : kBGRA_8888_SkColorType, kPremul_SkAlphaType),
&srcPixels.front() + i * source.width(), source.rowBytes() * 2);
source.readPixels(pixmap);
@@ -3024,7 +3023,7 @@ false if pixel conversion is not possible.
#In Pixels
#Line # copies and converts pixels ##
Copies a Rect of pixels from src. Copy starts at (dstX, dstY), and does not exceed
-(src.width(), src.height()).
+(src.width(), src.height()).
src specifies width, height, Color_Type, Alpha_Type, Color_Space, pixel storage,
and row bytes of source. src.rowBytes specifics the gap from one source
@@ -3041,10 +3040,10 @@ If Bitmap colorType is kGray_8_SkColorType, src Color_Space must match.
If Bitmap alphaType is kOpaque_SkAlphaType, src Alpha_Type must
match. If Bitmap colorSpace is nullptr, src Color_Space must match. Returns
false if pixel conversion is not possible.
-
+
dstX and dstY may be negative to copy only top or left of source. Returns
false if width() or height() is zero or negative.
-Returns false if
+Returns false if
#Formula
abs(dstX) >= Bitmap width()
##
@@ -3082,7 +3081,7 @@ abs(dstY) >= Bitmap height()
}
##
-#SeeAlso readPixels
+#SeeAlso readPixels
##
@@ -3091,7 +3090,7 @@ abs(dstY) >= Bitmap height()
#Method bool writePixels(const SkPixmap& src)
Copies a Rect of pixels from src. Copy starts at (0, 0), and does not exceed
-(src.width(), src.height()).
+(src.width(), src.height()).
src specifies width, height, Color_Type, Alpha_Type, Color_Space, pixel storage,
and row bytes of source. src.rowBytes specifics the gap from one source
@@ -3134,7 +3133,7 @@ false if pixel conversion is not possible.
#Method bool writePixels(const SkPixmap& src, int x, int y, SkTransferFunctionBehavior behavior)
Copies a Rect of pixels from src. Copy starts at (0, 0), and does not exceed
-(src.width(), src.height()).
+(src.width(), src.height()).
src specifies width, height, Color_Type, Alpha_Type, Color_Space, pixel storage,
and row bytes of source. src.rowBytes specifics the gap from one source
@@ -3162,7 +3161,7 @@ pixels are treated as if they are linear, regardless of how they are encoded.
#Param x column index whose absolute value is less than width() ##
#Param y row index whose absolute value is less than height() ##
#Param behavior one of: SkTransferFunctionBehavior::kRespect,
- SkTransferFunctionBehavior::kIgnore
+ SkTransferFunctionBehavior::kIgnore
##
#Return true if src pixels are copied to Bitmap ##
@@ -3278,7 +3277,7 @@ Uses HeapAllocator to reserve memory for dst Pixel_Ref.
Sets dst to Alpha described by pixels. Returns false if dst cannot be written to
or dst pixels cannot be allocated.
-If paint is not nullptr and contains Mask_Filter, SkMaskFilter
+If paint is not nullptr and contains Mask_Filter, SkMaskFilter
generates Mask_Alpha from Bitmap. Uses HeapAllocator to reserve memory for dst
Pixel_Ref. Sets offset to top-left position for dst for alignment with Bitmap;
(0, 0) unless SkMaskFilter generates mask.
@@ -3327,15 +3326,15 @@ Pixel_Ref. Sets offset to top-left position for dst for alignment with Bitmap;
Sets dst to Alpha described by pixels. Returns false if dst cannot be written to
or dst pixels cannot be allocated.
-If paint is not nullptr and contains Mask_Filter, SkMaskFilter
+If paint is not nullptr and contains Mask_Filter, SkMaskFilter
generates Mask_Alpha from Bitmap. allocator may reference a custom allocation
-class or be set to nullptr to use HeapAllocator. Sets offset to top-left
+class or be set to nullptr to use HeapAllocator. Sets offset to top-left
position for dst for alignment with Bitmap; (0, 0) unless SkMaskFilter generates
mask.
#Param dst holds Pixel_Ref to fill with alpha layer ##
#Param paint holds optional Mask_Filter; may be nullptr ##
-#Param allocator method to reserve memory for Pixel_Ref; may be nullptr ##
+#Param allocator function to reserve memory for Pixel_Ref; may be nullptr ##
#Param offset top-left position for dst; may be nullptr ##
#Return true if Alpha layer was constructed in dst Pixel_Ref ##
@@ -3414,7 +3413,7 @@ x---x-
#StdOut ##
##
-#SeeAlso pixmap() installPixels readPixels writePixels
+#SeeAlso pixmap() installPixels readPixels writePixels
##
@@ -3427,7 +3426,7 @@ x---x-
#Method void validate() const;
#In Utility
#Line # asserts if Bitmap is invalid (debug only) ##
-Asserts if internal values are illegal or inconsistent. Only available if
+Asserts if internal values are illegal or inconsistent. Only available if
SK_DEBUG is defined at compile time.
#NoExample
diff --git a/docs/SkCanvas_Reference.bmh b/docs/SkCanvas_Reference.bmh
index 2f4774f566..063e53ee5d 100644
--- a/docs/SkCanvas_Reference.bmh
+++ b/docs/SkCanvas_Reference.bmh
@@ -1,12 +1,6 @@
#Topic Canvas
#Alias Canvas_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkCanvas
Canvas provides an interface for drawing, and how the drawing is clipped and transformed.
@@ -30,6 +24,10 @@ destination.
Canvas can be constructed to draw to Bitmap without first creating Raster_Surface.
This approach may be deprecated in the future.
+#Subtopic Overview
+#Populate
+##
+
#Subtopic Related_Function
#Populate
##
@@ -38,7 +36,11 @@ This approach may be deprecated in the future.
#Populate
##
-#Subtopic Class_or_Struct
+#Subtopic Struct
+#Populate
+##
+
+#Subtopic Typedef
#Populate
##
@@ -181,7 +183,7 @@ void draw(SkCanvas* ) {
height,
pixels[0], // top-left of the bitmap
sizeof(pixels[0])); // byte width of the each row
- // write a premultiplied value for white into all pixels in the bitmap
+ // write a Premultiplied value for white into all pixels in the bitmap
canvas->clear(SK_ColorWHITE);
SkPMColor pmWhite = pixels[0][0]; // the Premultiplied format may vary
SkPaint paint; // by default, draws black
@@ -262,9 +264,9 @@ void draw(SkCanvas* canvas) {
#Method SkCanvas(int width, int height, const SkSurfaceProps* props = nullptr)
-#Line # no Surface, set dimensions, Surface_Properties ##
+#Line # creates with no Surface, set dimensions, Surface_Properties ##
Creates Canvas of the specified dimensions without a Surface.
-Used by Subclasses with custom implementations for draw methods.
+Used by Subclasses with custom implementations for draw member functions.
If props equals nullptr, Surface_Properties are created with
Surface_Properties_Legacy_Font_Host settings, which choose the pixel striping
@@ -365,7 +367,7 @@ The actual output depends on the installed fonts.
##
#EnumClass ColorBehavior
-#Line # Android framework only ##
+#Line # exists for Android framework only ##
#Private
Android framework only.
##
@@ -376,16 +378,16 @@ Android framework only.
};
##
#Const kLegacy 0
+#Line # placeholder ##
Is a placeholder to allow specialized constructor; has no meaning.
##
##
#Method SkCanvas(const SkBitmap& bitmap, ColorBehavior behavior)
-#Line # Android framework only ##
-#Private
+#Line # exists for Android framework only ##
+
Android framework only.
-##
#Param bitmap specifies a bitmap for the canvas to draw into ##
#Param behavior specializes this constructor; value is unused ##
@@ -1673,11 +1675,6 @@ Call restoreToCount with returned value to restore this and subsequent saves.
##
-#ToDo
-add new markup to associate typedef SaveLayerFlags with Enum so that, for
-documentation purposes, this enum is named rather than anonymous
-##
-
#Enum SaveLayerFlagsSet
#Line # sets SaveLayerRec options ##
#Code
@@ -1691,20 +1688,29 @@ documentation purposes, this enum is named rather than anonymous
typedef uint32_t SaveLayerFlags;
##
+
+#Typedef uint32_t SaveLayerFlags
+#Line # options for SaveLayerRec ##
+
SaveLayerFlags provides options that may be used in any combination in SaveLayerRec,
-defining how Layer allocated by saveLayer operates.
+defining how Layer allocated by saveLayer operates. It may be set to zero,
+kPreserveLCDText_SaveLayerFlag, kInitWithPrevious_SaveLayerFlag, or both flags.
+
+##
#Const kPreserveLCDText_SaveLayerFlag 2
+#Line # creates Layer for LCD text ##
Creates Layer for LCD text. Flag is ignored if Layer Paint contains
Image_Filter or Color_Filter.
##
#Const kInitWithPrevious_SaveLayerFlag 4
+#Line # initializes with previous contents ##
Initializes Layer with the contents of the previous Layer.
##
#Const kMaskAgainstCoverage_EXPERIMENTAL_DONT_USE_SaveLayerFlag 8
- Experimental -- don't use
+#Experimental do not use
##
#Const kDontClipToLayer_Legacy_SaveLayerFlag 0x80000000
@@ -1739,12 +1745,14 @@ void draw(SkCanvas* canvas) {
#Enum ##
-#Typedef uint32_t SaveLayerFlags
-
-##
+#Subtopic SaveLayerRec
+#Line # contains the state used to create the Layer ##
#Struct SaveLayerRec
#Line # contains the state used to create the Layer ##
+
+SaveLayerRec contains the state used to create the Layer.
+
#Code
struct SaveLayerRec {
SaveLayerRec*(...
@@ -1756,38 +1764,50 @@ void draw(SkCanvas* canvas) {
};
##
-SaveLayerRec contains the state used to create the Layer.
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Member
+#Populate
+##
#Member const SkRect* fBounds
+#Line # hints at Layer size limit ##
fBounds is used as a hint to limit the size of Layer; may be nullptr.
fBounds suggests but does not define Layer size. To clip drawing to
a specific rectangle, use clipRect.
##
#Member const SkPaint* fPaint
+#Line # modifies overlay ##
fPaint modifies how Layer overlays the prior Layer; may be nullptr.
Color_Alpha, Blend_Mode, Color_Filter, Draw_Looper, Image_Filter, and
Mask_Filter affect Layer draw.
##
#Member const SkImageFilter* fBackdrop
+#Line # applies Image_Filter to prior Layer ##
fBackdrop applies Image_Filter to the prior Layer when copying to the Layer;
may be nullptr. Use kInitWithPrevious_SaveLayerFlag to copy the
prior Layer without an Image_Filter.
##
#Member const SkImage* fClipMask
+#Line # clips Layer with Mask_Alpha ##
restore() clips Layer by the Color_Alpha channel of fClipMask when
Layer is copied to Device. fClipMask may be nullptr. .
##
#Member const SkMatrix* fClipMatrix
+#Line # transforms Mask_Alpha used to clip ##
fClipMatrix transforms fClipMask before it clips Layer. If
fClipMask describes a translucent gradient, it may be scaled and rotated
without introducing artifacts. fClipMatrix may be nullptr.
##
#Member SaveLayerFlags fSaveLayerFlags
+#Line # preserves LCD Text, creates with prior Layer contents ##
fSaveLayerFlags are used to create Layer without transparency,
create Layer for LCD text, and to create Layer with the
contents of the previous Layer.
@@ -1817,8 +1837,12 @@ void draw(SkCanvas* canvas) {
}
##
-#Method SaveLayerRec()
+#Subtopic Constructor
+#Populate
+##
+#Method SaveLayerRec()
+#Line # constructs SaveLayerRec ##
Sets fBounds, fPaint, and fBackdrop to nullptr. Clears fSaveLayerFlags.
#Return empty SaveLayerRec ##
@@ -1902,9 +1926,7 @@ Sets fBounds, fPaint, fBackdrop, and fSaveLayerFlags.
const SkImage* clipMask, const SkMatrix* clipMatrix,
SaveLayerFlags saveLayerFlags)
-#Experimental
-Not ready for general use.
-##
+#Experimental not ready
Sets fBounds, fPaint, fBackdrop, fClipMask, fClipMatrix, and fSaveLayerFlags.
clipMatrix uses Color_Alpha channel of image, transformed by clipMatrix, to clip
@@ -1933,6 +1955,8 @@ Implementation is not complete; has no effect if Device is GPU-backed.
#Struct ##
+#Subtopic ##
+
#Method int saveLayer(const SaveLayerRec& layerRec)
#In Layer
@@ -2469,7 +2493,7 @@ void draw(SkCanvas* canvas) {
#Method void androidFramework_setDeviceClipRestriction(const SkIRect& rect)
#In Clip
-#Line # for use by Android framework ##
+#Line # exists for use by Android framework ##
Sets the maximum clip rectangle, which can be set by clipRect, clipRRect and
clipPath and intersect the current clip with the specified rect.
The maximum clip affects only future clipping operations; it is not retroactive.
@@ -2700,10 +2724,7 @@ void draw(SkCanvas* canvas) {
#Method void setAllowSimplifyClip(bool allow)
#In Clip
-#Line # experimental ##
-#Experimental
-Only used for testing.
-##
+#Experimental testing
Set to simplify clip stack using PathOps.
@@ -3116,15 +3137,15 @@ Selects if an array of points are drawn as discrete points, as lines, or as
an open polygon.
#Const kPoints_PointMode 0
- Draw each point separately.
+#Line # draw each point separately ##
##
#Const kLines_PointMode 1
- Draw each pair of points as a line segment.
+#Line # draw each pair of points as a line segment ##
##
#Const kPolygon_PointMode 2
- Draw the array of points as a open polygon.
+#Line # draw the array of points as a open polygon ##
##
#Example
@@ -3931,12 +3952,14 @@ it cannot read outside the bounds, when sampling near the edge of source Rect.
SrcRectConstraint specifies whether an Image_Filter is allowed to read pixels
outside source Rect.
-#Const kStrict_SrcRectConstraint
+#Const kStrict_SrcRectConstraint 0
+#Line # sample only inside bounds; slower ##
Requires Image_Filter to respect source Rect,
sampling only inside of its bounds, possibly with a performance penalty.
##
-#Const kFast_SrcRectConstraint
+#Const kFast_SrcRectConstraint 1
+#Line # sample outside bounds; faster ##
Permits Image_Filter to sample outside of source Rect
by half the width of Image_Filter, permitting it to run faster but with
error at the image edges.
@@ -4313,9 +4336,7 @@ are larger than dst; center and four sides are scaled to fit remaining space, if
Additionally transform draw using Clip, Matrix, and optional Paint paint.
-If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
-Blend_Mode, and Draw_Looper. If image is kAlpha_8_SkColorType, apply Shader.
-If paint contains Mask_Filter, generate mask from image bounds.
+#paint_as_used_by_draw_lattice_or_draw_nine(image)#
If generated mask extends beyond image bounds, replicate image edge colors, just
as Shader made from SkImage::makeShader with SkShader::kClamp_TileMode set
@@ -4663,6 +4684,14 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
+#PhraseDef paint_as_used_by_draw_lattice_or_draw_nine(bitmap_or_image)
+If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
+Blend_Mode, and Draw_Looper. If #bitmap_or_image# is kAlpha_8_SkColorType, apply Shader.
+If paint contains Mask_Filter, generate mask from #bitmap_or_image# bounds. If paint
+Filter_Quality set to kNone_SkFilterQuality, disable pixel filtering. For all
+other values of paint Filter_Quality, use kLow_SkFilterQuality to filter pixels.
+##
+
#Method void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst,
const SkPaint* paint = nullptr)
#In Draw_Image
@@ -4677,9 +4706,7 @@ space, if any.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
-If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
-Blend_Mode, and Draw_Looper. If bitmap is kAlpha_8_SkColorType, apply Shader.
-If paint contains Mask_Filter, generate mask from bitmap bounds.
+#paint_as_used_by_draw_lattice_or_draw_nine(bitmap)#
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
just as Shader made from SkShader::MakeBitmapShader with
@@ -4733,8 +4760,20 @@ void draw(SkCanvas* canvas) {
##
# ------------------------------------------------------------------------------
+#Subtopic Lattice
+#Line # divides Bitmap or Image into a rectangular grid ##
+
#Struct Lattice
#Line # divides Bitmap or Image into a rectangular grid ##
+
+Lattice divides Bitmap or Image into a rectangular grid.
+Grid entries on even columns and even rows are fixed; these entries are
+always drawn at their original size if the destination is large enough.
+If the destination side is too small to hold the fixed entries, all fixed
+entries are proportionately scaled down to fit.
+The grid entries not on even columns and rows are scaled to fit the
+remaining space, if any.
+
#Code
struct Lattice {
enum RectType ...
@@ -4749,15 +4788,16 @@ void draw(SkCanvas* canvas) {
};
##
- Lattice divides Bitmap or Image into a rectangular grid.
- Grid entries on even columns and even rows are fixed; these entries are
- always drawn at their original size if the destination is large enough.
- If the destination side is too small to hold the fixed entries, all fixed
- entries are proportionately scaled down to fit.
- The grid entries not on even columns and rows are scaled to fit the
- remaining space, if any.
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constant
+#Populate
+##
#Enum RectType
+ #Line # optional setting per rectangular grid entry ##
#Code
enum RectType : uint8_t {
kDefault = 0,
@@ -4770,19 +4810,24 @@ void draw(SkCanvas* canvas) {
or to fill the grid entry with a color.
#Const kDefault 0
- Draws Bitmap into lattice rectangle.
+ #Line # draws Bitmap into lattice rectangle ##
##
#Const kTransparent 1
- Skips lattice rectangle by making it transparent.
+ #Line # skips lattice rectangle by making it transparent ##
##
#Const kFixedColor 2
- Draws one of fColors into lattice rectangle.
+ #Line # draws one of fColors into lattice rectangle ##
##
##
+#Subtopic Member
+#Populate
+##
+
#Member const int* fXDivs
+ #Line # x-coordinates dividing bitmap ##
Array of x-coordinates that divide the bitmap vertically.
Array entries must be unique, increasing, greater than or equal to
fBounds left edge, and less than fBounds right edge.
@@ -4791,6 +4836,7 @@ void draw(SkCanvas* canvas) {
##
#Member const int* fYDivs
+ #Line # y-coordinates dividing bitmap ##
Array of y-coordinates that divide the bitmap horizontally.
Array entries must be unique, increasing, greater than or equal to
fBounds top edge, and less than fBounds bottom edge.
@@ -4799,6 +4845,7 @@ void draw(SkCanvas* canvas) {
##
#Member const RectType* fRectTypes
+ #Line # array of fill types ##
Optional array of fill types, one per rectangular grid entry:
array length must be
#Formula
@@ -4813,21 +4860,25 @@ void draw(SkCanvas* canvas) {
##
#Member int fXCount
+ #Line # number of x-coordinates ##
Number of entries in fXDivs array; one less than the number of
horizontal divisions.
##
#Member int fYCount
+ #Line # number of y-coordinates ##
Number of entries in fYDivs array; one less than the number of vertical
divisions.
##
#Member const SkIRect* fBounds
+ #Line # source bounds to draw from ##
Optional subset IRect source to draw from.
If nullptr, source bounds is dimensions of Bitmap or Image.
##
#Member const SkColor* fColors
+ #Line # array of colors ##
Optional array of colors, one per rectangular grid entry.
Array length must be
#Formula
@@ -4857,9 +4908,7 @@ dimension. All other grid elements scale to fill the available space, if any.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
-If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
-Blend_Mode, and Draw_Looper. If bitmap is kAlpha_8_SkColorType, apply Shader.
-If paint contains Mask_Filter, generate mask from bitmap bounds.
+#paint_as_used_by_draw_lattice_or_draw_nine(bitmap)#
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
just as Shader made from SkShader::MakeBitmapShader with
@@ -4938,9 +4987,7 @@ dimension. All other grid elements scale to fill the available space, if any.
Additionally transform draw using Clip, Matrix, and optional Paint paint.
-If Paint paint is supplied, apply Color_Filter, Color_Alpha, Image_Filter,
-Blend_Mode, and Draw_Looper. If bitmap is kAlpha_8_SkColorType, apply Shader.
-If paint contains Mask_Filter, generate mask from bitmap bounds.
+#paint_as_used_by_draw_lattice_or_draw_nine(image)#
If generated mask extends beyond bitmap bounds, replicate bitmap edge colors,
just as Shader made from SkShader::MakeBitmapShader with
@@ -4993,6 +5040,8 @@ void draw(SkCanvas* canvas) {
##
+#Subtopic Lattice ##
+
#Subtopic Draw_Image ##
# ------------------------------------------------------------------------------
@@ -5063,9 +5112,8 @@ void draw(SkCanvas* canvas) {
#In Draw_Text
#In Draw
#Line # draws null terminated string at (x, y) using font advance ##
-Draw null terminated string, with origin at (x, y), using Clip, Matrix, and
-Paint paint. Note that this per-glyph xform does not affect the shader (if present)
-on the paint, just the glyph's geometry.
+Draws null terminated string, with origin at (x, y), using Clip, Matrix, and
+Paint paint.
string meaning depends on Paint_Text_Encoding; by default, strings are encoded
as UTF-8. Other values of Paint_Text_Encoding are unlikely to produce the desired
@@ -5281,20 +5329,22 @@ filled 12 point black Glyphs.
Draw text on Path path, using Clip, Matrix, and Paint paint.
-Origin of text is at beginning of path offset by matrix, if provided, before it
-is mapped to path. If the path section corresponding the glyph advance is
-curved, the glyph is drawn curved to match; control points in the glyph are
-mapped to projected points parallel to the path. If the text advance is larger
-than the path length, the excess text is clipped.
+Origin of text is at beginning of path offset by matrix, if not nullptr.
+matrix also transforms text before text is mapped to path. If the path section
+corresponding the glyph advance is curved, the glyph is drawn curved to match;
+control points in the glyph are mapped to projected points parallel to the path.
+If the text advance is larger than the path length, the excess text is clipped.
text meaning depends on Paint_Text_Encoding; by default, text is encoded as
UTF-8. Origin meaning depends on Paint_Text_Align and Paint_Vertical_Text; by
default text positions the first glyph left side bearing at origin x and its
-baseline at origin y. Text size is affected by Matrix and Paint_Text_Size.
+baseline at origin y. Text size is affected by matrix parameter, Canvas_Matrix,
+and Paint_Text_Size.
All elements of paint: Path_Effect, Mask_Filter, Shader,
Color_Filter, Image_Filter, and Draw_Looper; apply to text. By default, draws
-filled 12 point black Glyphs.
+filled 12 point black Glyphs. Canvas Matrix does effect paint Shader, but
+matrix parameter does not.
#Param text character code points or Glyphs drawn ##
#Param byteLength byte length of text array ##
diff --git a/docs/SkColor4f_Reference.bmh b/docs/SkColor4f_Reference.bmh
index 71bdb76d1c..eaf762d2e3 100644
--- a/docs/SkColor4f_Reference.bmh
+++ b/docs/SkColor4f_Reference.bmh
@@ -3,12 +3,10 @@
#Struct SkColor4f
-The float values are 0...1 unpremultiplied
+The float values are 0...1 Unpremultiplied
#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
+#Populate
##
#Subtopic Operator
@@ -20,15 +18,19 @@ The float values are 0...1 unpremultiplied
##
#Member float fR
+#Line # incomplete ##
##
#Member float fG
+#Line # incomplete ##
##
#Member float fB
+#Line # incomplete ##
##
#Member float fA
+#Line # incomplete ##
##
# ------------------------------------------------------------------------------
@@ -175,19 +177,13 @@ Convert to SkColor4f, assuming SkColor is sRGB
# ------------------------------------------------------------------------------
#Method SkPM4f premul() const
-#In incomplete
-#Line # incomplete ##
-
-#Return incomplete ##
-
-#Example
-// incomplete
-##
-
-#SeeAlso incomplete
-
+#Deprecated
#Method ##
#Struct SkColor4f ##
+#Struct SkPM4f
+#Deprecated
+##
+
#Topic Color4f ##
diff --git a/docs/SkColor_Reference.bmh b/docs/SkColor_Reference.bmh
index 7d174e7fec..349de3803d 100644
--- a/docs/SkColor_Reference.bmh
+++ b/docs/SkColor_Reference.bmh
@@ -2,15 +2,21 @@
#Alias Color_Reference
#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
+#Populate
##
#Subtopic Define
#Populate
##
+Color constants can be helpful to write code, documenting the meaning of values
+the represent transparency and color values. The use of Color constants is not
+required.
+
+#Subtopic Constant
+#Populate
+##
+
#Subtopic Function
#Populate
##
@@ -19,9 +25,6 @@
#Populate
##
- #Subtopic Alpha
- #Alias Alpha
- #Subtopic ##
#Subtopic RGB
#Substitute RGB
@@ -54,44 +57,70 @@
# ------------------------------------------------------------------------------
+#Subtopic Alpha
+
+Alpha represents the transparency of Color. Color with Alpha of zero is fully
+transparent. Color with Alpha of 255 is fully opaque. Some, but not all pixel
+formats contain Alpha. Pixels with Alpha may store it as unsigned integers or
+floating point values. Unsigned integer Alpha ranges from zero, fully
+transparent, to all bits set, fully opaque. Floating point Alpha ranges from
+zero, fully transparent, to one, fully opaque.
+
+#Alias Alpha
+
#Typedef uint8_t SkAlpha
+#Line # defines Alpha as eight bits ##
-Types and macros for colors
8-bit type for an alpha value. 0xFF is 100% opaque, 0x00 is 100% transparent.
#Typedef ##
+#Subtopic ##
+
# ------------------------------------------------------------------------------
#Typedef uint32_t SkColor
+#Line # defines Color as 32 bits ##
-32 bit ARGB color value, not premultiplied. The color components are always in
+32-bit ARGB Color value, Unpremultiplied. Color components are always in
a known order. This is different from SkPMColor, which has its bytes in a configuration
dependent order, to match the format of kBGRA_8888_SkColorType bitmaps. SkColor
is the type used to specify colors in SkPaint and in gradients.
+Color that is Premultiplied has the same component values as Color
+that is Unpremultiplied if Alpha is 255, fully opaque, although may have the
+component values in a different order.
+
+#SeeAlso SkPMColor
+
#Typedef ##
# ------------------------------------------------------------------------------
#Method static constexpr inline SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
#In Function
-#Line # incomplete ##
+#Line # returns Color_Alpha and Color_RGB combined ##
-Return a SkColor value from 8 bit component values
+Returns Color value from 8-bit component values. Asserts if SK_DEBUG is defined
+if a, r, g, or b exceed 255. Since Color is Unpremultiplied, a may be smaller
+than the largest of r, g, and b.
-#Param a incomplete ##
-#Param r incomplete ##
-#Param g incomplete ##
-#Param b incomplete ##
+#Param a amount of Alpha, from fully transparent (0) to fully opaque (255) ##
+#Param r amount of RGB_Red, from no red (0) to full red (255) ##
+#Param g amount of RGB_Green, from no green (0) to full green (255) ##
+#Param b amount of RGB_Blue, from no blue (0) to full blue (255) ##
-#Return incomplete ##
+#Return color and alpha, Unpremultiplied ##
#Example
-// incomplete
+ canvas->drawColor(SK_ColorRED);
+ canvas->clipRect(SkRect::MakeWH(150, 150));
+ canvas->drawColor(SkColorSetARGB(0x80, 0x00, 0xFF, 0x00));
+ canvas->clipRect(SkRect::MakeWH(75, 75));
+ canvas->drawColor(SkColorSetARGB(0x80, 0x00, 0x00, 0xFF));
##
-#SeeAlso incomplete
+#SeeAlso SkColorSetRGB SkPaint::setARGB SkPaint::setColor
#Method ##
@@ -105,12 +134,7 @@ Return a SkColor value from 8 bit component values
$$$#
##
-Legacy aliases.
-
-#NoExample
-##
-
-#SeeAlso incomplete
+#Deprecated soon
#Define ##
@@ -124,17 +148,14 @@ Legacy aliases.
$$$#
##
-#NoExample
-##
-
-#SeeAlso incomplete
+#Deprecated soon
#Define ##
# ------------------------------------------------------------------------------
#Define SkColorSetRGB
-#Line # incomplete ##
+#Line # returns opaque Color ##
#Code
###$
@@ -142,15 +163,21 @@ $$$#
$$$#
##
-Return a SkColor value from 8 bit component values, with an implied value
-of 0xFF for alpha (fully opaque)
+Returns Color value from 8-bit component values, with Alpha set
+fully opaque to 255.
+
+#Param r amount of RGB_Red, from no red (0) to full red (255) ##
+#Param g amount of RGB_Green, from no green (0) to full green (255) ##
+#Param b amount of RGB_Blue, from no blue (0) to full blue (255) ##
-#Param r incomplete ##
-#Param g incomplete ##
-#Param b incomplete ##
+#Return color with opaque alpha ##
#Example
-// incomplete
+ canvas->drawColor(SK_ColorRED);
+ canvas->clipRect(SkRect::MakeWH(150, 150));
+ canvas->drawColor(SkColorSetRGB(0x00, 0xFF, 0x00));
+ canvas->clipRect(SkRect::MakeWH(75, 75));
+ canvas->drawColor(SkColorSetRGB(0x00, 0x00, 0xFF));
##
#SeeAlso incomplete
@@ -160,7 +187,7 @@ of 0xFF for alpha (fully opaque)
# ------------------------------------------------------------------------------
#Define SkColorGetA
-#Line # incomplete ##
+#Line # returns Alpha component ##
#Code
###$
@@ -168,9 +195,9 @@ of 0xFF for alpha (fully opaque)
$$$#
##
-return the alpha byte from a SkColor value
+Returns Alpha byte from Color value.
-#Param color incomplete ##
+#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
#Example
// incomplete
@@ -191,9 +218,10 @@ return the alpha byte from a SkColor value
$$$#
##
-return the red byte from a SkColor value
+Returns red component of Color, from zero to 255.
-#Param color incomplete ##
+#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
+#Return red byte ##
#Example
// incomplete
@@ -214,9 +242,10 @@ return the red byte from a SkColor value
$$$#
##
-return the green byte from a SkColor value
+Returns green component of Color, from zero to 255.
-#Param color incomplete ##
+#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
+#Return green byte ##
#Example
// incomplete
@@ -237,9 +266,10 @@ return the green byte from a SkColor value
$$$#
##
-return the blue byte from a SkColor value
+Returns blue component of Color, from zero to 255.
-#Param color incomplete ##
+#Param color SkColor, a 32-bit unsigned int, in 0xAARRGGBB format ##
+#Return blue byte ##
#Example
// incomplete
@@ -255,7 +285,9 @@ return the blue byte from a SkColor value
#In Function
#Line # incomplete ##
-#Param c incomplete ##
+Returns Color with red, blue, and green set from c; and alpha set from a.
+
+#Param c Unpremultiplied Color_ARGB ##
#Param a incomplete ##
#Return incomplete ##
@@ -270,284 +302,307 @@ return the blue byte from a SkColor value
# ------------------------------------------------------------------------------
-#Define SK_AlphaTRANSPARENT
+#Subtopic Alpha_Constants
+#In Constant
+#Line # constants for Alpha ##
#Code
-###$
- #define SK_AlphaTRANSPARENT static_cast<SkAlpha>(0x00)
-$$$#
+ constexpr SkAlpha SK_AlphaTRANSPARENT = 0x00;
+ constexpr SkAlpha SK_AlphaOPAQUE = 0xFF;
##
-common colors
-transparent SkAlpha value
+Alpha constants are conveniences to represent fully transparent and fully
+opaque colors and masks. Their use is not required.
-#Example
-// incomplete
+#Const SK_AlphaTRANSPARENT 0x00
+#Line # fully transparent SkAlpha ##
+#Details Transparent
+Represents fully transparent SkAlpha value. SkAlpha ranges from zero,
+fully transparent; to 255, fully opaque.
##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_AlphaOPAQUE
-
-#Code
-###$
- #define SK_AlphaOPAQUE static_cast<SkAlpha>(0xFF)
-$$$#
+#Const SK_AlphaOPAQUE 0xFF
+#Line # fully opaque SkAlpha ##
+#Details Opaque
+Represents fully opaque SkAlpha value. SkAlpha ranges from zero,
+fully transparent; to 255, fully opaque.
##
-opaque SkAlpha value
+#Subtopic Transparent
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_ColorTRANSPARENT
-
-#Code
-###$
- #define SK_ColorTRANSPARENT static_cast<SkColor>(0x00000000)
-$$$#
-##
-
-transparent SkColor value
+#Image 1
+#Height 128
+#Description
+Color the parts of the bitmap red if they mostly contain transparent pixels.
+##
+ std::vector<int32_t> srcPixels;
+ srcPixels.resize(source.height() * source.rowBytes());
+ SkPixmap pixmap(SkImageInfo::MakeN32Premul(source.width(), source.height()),
+ &srcPixels.front(), source.rowBytes());
+ source.readPixels(pixmap, 0, 0);
+ for (int y = 0; y < 16; ++y) {
+ for (int x = 0; x < 16; ++x) {
+ int32_t* blockStart = &srcPixels.front() + y * source.width() * 16 + x * 16;
+ size_t transparentCount = 0;
+ for (int fillY = 0; fillY < source.height() / 16; ++fillY) {
+ for (int fillX = 0; fillX < source.width() / 16; ++fillX) {
+ const SkColor color = SkUnPreMultiply::PMColorToColor(blockStart[fillX]);
+ transparentCount += SkColorGetA(color) == SK_AlphaTRANSPARENT;
+ }
+ blockStart += source.width();
+ }
+ if (transparentCount > 200) {
+ blockStart = &srcPixels.front() + y * source.width() * 16 + x * 16;
+ for (int fillY = 0; fillY < source.height() / 16; ++fillY) {
+ for (int fillX = 0; fillX < source.width() / 16; ++fillX) {
+ blockStart[fillX] = SK_ColorRED;
+ }
+ blockStart += source.width();
+ }
+ }
+ }
+ }
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+##
+
+#SeeAlso SkAlpha SK_ColorTRANSPARENT SK_AlphaOPAQUE
+
+#Subtopic Transparent ##
+
+# ------------------------------------------------------------------------------
+
+#Subtopic Opaque
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
-
-#Define ##
+#Image 1
+#Height 128
+ std::vector<int32_t> srcPixels;
+ srcPixels.resize(source.height() * source.rowBytes());
+ SkPixmap pixmap(SkImageInfo::MakeN32Premul(source.width(), source.height()),
+ &srcPixels.front(), source.rowBytes());
+ source.readPixels(pixmap, 0, 0);
+ for (int y = 0; y < source.height(); ++y) {
+ for (int x = 0; x < source.width(); ++x) {
+ SkPMColor pixel = srcPixels[y * source.width() + x];
+ const SkColor color = SkUnPreMultiply::PMColorToColor(pixel);
+ if (SkColorGetA(color) == SK_AlphaOPAQUE) {
+ srcPixels[y * source.width() + x] = SK_ColorGREEN;
+ }
+ }
+ }
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+##
+
+#SeeAlso SkAlpha SK_AlphaTRANSPARENT
+
+#Subtopic Opaque ##
+#Subtopic Alpha_Constants ##
+
+#Subtopic Color_Constants
+#In Constant
+#Line # constants for Color ##
# ------------------------------------------------------------------------------
-
-#Define SK_ColorBLACK
-
#Code
-###$
- #define SK_ColorBLACK static_cast<SkColor>(0xFF000000)
-$$$#
-##
-
-black SkColor value
+ constexpr SkColor SK_ColorTRANSPARENT = SkColorSetARGB(0x00, 0x00, 0x00, 0x00);
+ constexpr SkColor SK_ColorBLACK = SkColorSetARGB(0xFF, 0x00, 0x00, 0x00);
+ constexpr SkColor SK_ColorDKGRAY = SkColorSetARGB(0xFF, 0x44, 0x44, 0x44);
+ constexpr SkColor SK_ColorGRAY = SkColorSetARGB(0xFF, 0x88, 0x88, 0x88);
+ constexpr SkColor SK_ColorLTGRAY = SkColorSetARGB(0xFF, 0xCC, 0xCC, 0xCC);
+ constexpr SkColor SK_ColorWHITE = SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF);
+ constexpr SkColor SK_ColorRED = SkColorSetARGB(0xFF, 0xFF, 0x00, 0x00);
+ constexpr SkColor SK_ColorGREEN = SkColorSetARGB(0xFF, 0x00, 0xFF, 0x00);
+ constexpr SkColor SK_ColorBLUE = SkColorSetARGB(0xFF, 0x00, 0x00, 0xFF);
+ constexpr SkColor SK_ColorYELLOW = SkColorSetARGB(0xFF, 0xFF, 0xFF, 0x00);
+ constexpr SkColor SK_ColorCYAN = SkColorSetARGB(0xFF, 0x00, 0xFF, 0xFF);
+ constexpr SkColor SK_ColorMAGENTA = SkColorSetARGB(0xFF, 0xFF, 0x00, 0xFF);
+##
+
+Color names are provided as conveniences, but are not otherwise special.
+The values chosen for names may not be the same as values used by
+SVG, HTML, CSS, or colors named by a platform.
#Example
-// incomplete
-##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_ColorDKGRAY
-
-#Code
###$
- #define SK_ColorDKGRAY static_cast<SkColor>(0xFF444444)
+$Function
+#define SKIA_COLOR_PAIR(name) "SK_Color" #name, SK_Color##name
+$$
+void draw(SkCanvas* canvas) {
+ struct ColorCompare {
+ const char* fSVGName;
+ SkColor fSVGColor;
+ const char* fSkiaName;
+ SkColor fSkiaColor;
+ } colorCompare[] = { // see https://www.w3.org/TR/SVG/types.html#ColorKeywords
+ {"black", SkColorSetRGB( 0, 0, 0), SKIA_COLOR_PAIR(BLACK) },
+ {"darkgray", SkColorSetRGB(169, 169, 169), SKIA_COLOR_PAIR(DKGRAY) },
+ {"gray", SkColorSetRGB(128, 128, 128), SKIA_COLOR_PAIR(GRAY) },
+ {"lightgray", SkColorSetRGB(211, 211, 211), SKIA_COLOR_PAIR(LTGRAY) },
+ {"white", SkColorSetRGB(255, 255, 255), SKIA_COLOR_PAIR(WHITE) },
+ {"red", SkColorSetRGB(255, 0, 0), SKIA_COLOR_PAIR(RED) },
+ {"green", SkColorSetRGB( 0, 128, 0), SKIA_COLOR_PAIR(GREEN) },
+ {"blue", SkColorSetRGB( 0, 0, 255), SKIA_COLOR_PAIR(BLUE) },
+ {"yellow", SkColorSetRGB(255, 255, 0), SKIA_COLOR_PAIR(YELLOW) },
+ {"aqua", SkColorSetRGB( 0, 255, 255), SKIA_COLOR_PAIR(CYAN) },
+ {"fuchsia", SkColorSetRGB(255, 0, 255), SKIA_COLOR_PAIR(MAGENTA) },
+ };
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setTextSize(14);
+ for (auto compare : colorCompare) {
+ paint.setStyle(SkPaint::kFill_Style);
+ paint.setColor(compare.fSVGColor);
+ canvas->drawRect({5, 5, 15, 15}, paint);
+ paint.setColor(SK_ColorBLACK);
+ canvas->drawString(compare.fSVGName, 20, 16, paint);
+ paint.setColor(compare.fSkiaColor);
+ canvas->drawRect({105, 5, 115, 15}, paint);
+ paint.setColor(SK_ColorBLACK);
+ canvas->drawString(compare.fSkiaName, 120, 16, paint);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->drawRect({5, 5, 15, 15}, paint);
+ canvas->drawRect({105, 5, 115, 15}, paint);
+ canvas->translate(0, 20);
+ }
+}
$$$#
##
-dark gray SkColor value
-
-#Example
-// incomplete
-##
-
-#SeeAlso incomplete
-
-#Define ##
-
# ------------------------------------------------------------------------------
-#Define SK_ColorGRAY
-
-#Code
-###$
- #define SK_ColorGRAY static_cast<SkColor>(0xFF888888)
-$$$#
+#Const SK_ColorTRANSPARENT 0x00000000
+#Line # transparent Color ##
+#Details Transparent
+ Represents fully transparent SkColor. May be used to initialize a destination
+ containing a mask or a non-rectangular image.
##
-
-gray SkColor value
-
-#Example
-// incomplete
+#Const SK_ColorBLACK 0xFF000000
+#Line # black Color ##
+#Details Black
+ Represents fully opaque black.
##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_ColorLTGRAY
-
-#Code
-###$
- #define SK_ColorLTGRAY static_cast<SkColor>(0xFFCCCCCC)
-$$$#
+#Const SK_ColorDKGRAY 0xFF444444
+#Line # dark gray Color ##
+ Represents fully opaque dark gray.
+ Note that SVG_darkgray is equivalent to 0xFFA9A9A9.
##
-
-light gray SkColor value
-
-#Example
-// incomplete
+#Const SK_ColorGRAY 0xFF888888
+#Line # gray Color ##
+ Represents fully opaque gray.
+ Note that HTML_Gray is equivalent to 0xFF808080.
##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_ColorWHITE
-
-#Code
-###$
- #define SK_ColorWHITE static_cast<SkColor>(0xFFFFFFFF)
-$$$#
+#Const SK_ColorLTGRAY 0xFFCCCCCC
+#Line # light gray Color ##
+ Represents fully opaque light gray. HTML_Silver is equivalent to 0xFFC0C0C0.
+ Note that SVG_lightgray is equivalent to 0xFFD3D3D3.
##
-
-white SkColor value
-
-#Example
-// incomplete
+#Const SK_ColorWHITE 0xFFFFFFFF
+#Line # white Color ##
+ Represents fully opaque white.
##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_ColorRED
-
-#Code
-###$
- #define SK_ColorRED static_cast<SkColor>(0xFFFF0000)
-$$$#
+#Const SK_ColorRED 0xFFFF0000
+#Line # red Color ##
+ Represents fully opaque red.
##
-
-red SkColor value
-
-#Example
-// incomplete
+#Const SK_ColorGREEN 0xFF00FF00
+#Line # green Color ##
+ Represents fully opaque green. HTML_Lime is equivalent.
+ Note that HTML_Green is equivalent to 0xFF008000.
##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_ColorGREEN
-
-#Code
-###$
- #define SK_ColorGREEN static_cast<SkColor>(0xFF00FF00)
-$$$#
+#Const SK_ColorBLUE 0xFF0000FF
+#Line # blue Color ##
+ Represents fully opaque blue.
##
-
-green SkColor value
-
-#Example
-// incomplete
+#Const SK_ColorYELLOW 0xFFFFFF00
+#Line # yellow Color ##
+ Represents fully opaque yellow.
##
-
-#SeeAlso incomplete
-
-#Define ##
-
-# ------------------------------------------------------------------------------
-
-#Define SK_ColorBLUE
-
-#Code
-###$
- #define SK_ColorBLUE static_cast<SkColor>(0xFF0000FF)
-$$$#
+#Const SK_ColorCYAN 0xFF00FFFF
+#Line # cyan Color ##
+ Represents fully opaque cyan. HTML_Aqua is equivalent.
##
-
-blue SkColor value
-
-#Example
-// incomplete
+#Const SK_ColorMAGENTA 0xFFFF00FF
+#Line # magenta Color ##
+ Represents fully opaque magenta. HTML_Fuchsia is equivalent.
##
-#SeeAlso incomplete
-
-#Define ##
-
# ------------------------------------------------------------------------------
-#Define SK_ColorYELLOW
-
-#Code
-###$
- #define SK_ColorYELLOW static_cast<SkColor>(0xFFFFFF00)
-$$$#
-##
-
-yellow SkColor value
+#Subtopic Transparent
#Example
-// incomplete
+ std::vector<uint32_t> srcPixels;
+ constexpr int width = 256;
+ constexpr int height = 256;
+ srcPixels.resize(width * height);
+ SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);
+ SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());
+ pixmap.erase(SK_ColorTRANSPARENT);
+ pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );
+ pixmap.erase(SK_ColorTRANSPARENT, { 48, 48, 168, 168 } );
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+ canvas->drawBitmap(bitmap, 48, 48);
##
-#SeeAlso incomplete
+#SeeAlso SK_AlphaTRANSPARENT SkCanvas::clear
-#Define ##
+##
# ------------------------------------------------------------------------------
-#Define SK_ColorCYAN
-
-#Code
-###$
- #define SK_ColorCYAN static_cast<SkColor>(0xFF00FFFF)
-$$$#
-##
-
-cyan SkColor value
+#Subtopic Black
#Example
-// incomplete
+ std::vector<uint32_t> srcPixels;
+ constexpr int width = 256;
+ constexpr int height = 256;
+ srcPixels.resize(width * height);
+ SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);
+ SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());
+ pixmap.erase(SK_ColorTRANSPARENT);
+ pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );
+ pixmap.erase(SK_ColorBLACK, { 48, 48, 168, 168 } );
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+ canvas->drawBitmap(bitmap, 48, 48);
##
-#SeeAlso incomplete
+#SeeAlso SK_ColorTRANSPARENT
-#Define ##
+##
# ------------------------------------------------------------------------------
-#Define SK_ColorMAGENTA
+#Subtopic White
-#Code
-###$
- #define SK_ColorMAGENTA static_cast<SkColor>(0xFFFF00FF)
-$$$#
+#Example
+ std::vector<uint32_t> srcPixels;
+ constexpr int width = 256;
+ constexpr int height = 256;
+ srcPixels.resize(width * height);
+ SkImageInfo imageInfo = SkImageInfo::MakeN32Premul(width, height);
+ SkPixmap pixmap(imageInfo, &srcPixels.front(), imageInfo.minRowBytes());
+ pixmap.erase(SK_ColorTRANSPARENT);
+ pixmap.erase(SK_ColorRED, { 24, 24, 192, 192 } );
+ pixmap.erase(SK_ColorWHITE, { 48, 48, 168, 168 } );
+ SkBitmap bitmap;
+ bitmap.installPixels(pixmap);
+ canvas->drawBitmap(bitmap, 0, 0);
+ canvas->drawBitmap(bitmap, 48, 48);
##
-magenta SkColor value
+#SeeAlso SK_ColorTRANSPARENT
-#Example
-// incomplete
##
-#SeeAlso incomplete
-
-#Define ##
+#Subtopic Color_Constants ##
# ------------------------------------------------------------------------------
@@ -568,18 +623,15 @@ modulo 360, where zero degrees is red.
#In Function
#Line # incomplete ##
-Convert RGB components to HSV.
-hsv[0] is Hue [0 .. 360)
-hsv[1] is Saturation [0...1]
-hsv[2] is Value [0...1]
+Converts RGB components to HSV.
+hsv[0] contains Hue, a value from zero to less than 360.
+hsv[1] contains Saturation, a value from zero to one.
+hsv[2] contains Value, a value from zero to one.
-#Param red red component value [0..255]
-##
-#Param green green component value [0..255]
-##
-#Param blue blue component value [0..255]
-##
-#Param hsv 3 element array which holds the resulting HSV components.
+#Param red red component value from zero to 255 ##
+#Param green green component value from zero to 255 ##
+#Param blue blue component value from zero to 255 ##
+#Param hsv three element array which holds the resulting HSV components
##
#Return incomplete ##
@@ -596,16 +648,16 @@ hsv[2] is Value [0...1]
#Method static inline void SkColorToHSV(SkColor color, SkScalar hsv[3])
#In Function
-#Line # incomplete ##
+#Line # converts RGB to HSV ##
-Convert the argb color to its HSV components.
-hsv[0] represents Hue, and is assigned a value from zero to less than 360.
-hsv[1] is Saturation [0...1]
-hsv[2] is Value [0...1]
+Converts ARGB to its HSV components. Alpha in ARGB is ignored.
+hsv[0] contains Hue, and is assigned a value from zero to less than 360.
+hsv[1] contains Saturation, a value from zero to one.
+hsv[2] contains Value, a value from zero to one.
-#Param color the argb color to convert. Note: the alpha component is ignored.
+#Param color ARGB color to convert
##
-#Param hsv 3 element array which holds the resulting HSV components.
+#Param hsv three element array which holds the resulting HSV components
##
#Return incomplete ##
@@ -622,21 +674,21 @@ hsv[2] is Value [0...1]
#Method SK_API SkColor SkHSVToColor(U8CPU alpha, const SkScalar hsv[3])
#In Function
-#Line # incomplete ##
+#Line # converts HSV with Alpha to RGB ##
-Convert HSV components to an ARGB color. The alpha component is passed through unchanged.
+Converts HSV components to an ARGB color. The alpha component is passed through unchanged.
hsv[0] represents Hue, an angle from zero to less than 360.
hsv[1] represents Saturation, and varies from zero to one.
hsv[2] represents Value, and varies from zero to one.
If hsv values are out of range, they are pinned.
-#Param alpha the alpha component of the returned argb color.
+#Param alpha Alpha component of the returned ARGB color
##
-#Param hsv 3 element array which holds the input HSV components.
+#Param hsv three element array which holds the input HSV components
##
-#Return the resulting argb color
+#Return ARGB equivalent to HSV
##
#Example
@@ -663,7 +715,7 @@ If hsv values are out of range, they are pinned.
#Param hsv 3 element array which holds the input HSV components.
##
-#Return the resulting argb color
+#Return the resulting ARGB color
##
#Example
@@ -678,11 +730,14 @@ If hsv values are out of range, they are pinned.
# ------------------------------------------------------------------------------
+#Subtopic PMColor
+
#Typedef uint32_t SkPMColor
+#Line # defines Premultiplied Color as 32 bits ##
-32 bit ARGB color value, premultiplied. The byte order for this value is
+32-bit ARGB color value, Premultiplied. The byte order for this value is
configuration dependent, matching the format of kBGRA_8888_SkColorType bitmaps.
-This is different from SkColor, which is nonpremultiplied, and is always in the
+This is different from SkColor, which is Unpremultiplied, and is always in the
same byte order.
#Typedef ##
@@ -691,9 +746,9 @@ same byte order.
#Method SK_API SkPMColor SkPreMultiplyARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
#In Function
-#Line # incomplete ##
+#Line # converts Unpremultiplied ARGB to Premultiplied PMColor ##
-Return a SkPMColor value from unpremultiplied 8 bit component values
+Return a SkPMColor value from Unpremultiplied 8-bit component values
#Param a incomplete ##
#Param r incomplete ##
@@ -714,11 +769,10 @@ Return a SkPMColor value from unpremultiplied 8 bit component values
#Method SK_API SkPMColor SkPreMultiplyColor(SkColor c)
#In Function
-#Line # incomplete ##
+#Line # converts Unpremultiplied Color to Premultiplied PMColor ##
-Return a SkPMColor value from a SkColor value. This is done by multiplying the color
-components by the color's alpha, and by arranging the bytes in a configuration
-dependent order, to match the format of kBGRA_8888_SkColorType bitmaps.
+Returns PMColor closest to Color c. Multiplies c RGB components by the c Alpha,
+and arranges the bytes to match the format of kN32_SkColorType.
#Param c incomplete ##
@@ -732,4 +786,6 @@ dependent order, to match the format of kBGRA_8888_SkColorType bitmaps.
#Method ##
+#Subtopic PMColor ##
+
#Topic Color ##
diff --git a/docs/SkIPoint_Reference.bmh b/docs/SkIPoint_Reference.bmh
index 9c018d3b25..61c7394aeb 100644
--- a/docs/SkIPoint_Reference.bmh
+++ b/docs/SkIPoint_Reference.bmh
@@ -2,15 +2,13 @@
#Alias IPoints
#Alias IPoint_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Struct SkIPoint
-SkIPoint holds two 32 bit integer coordinates.
+SkIPoint holds two 32-bit integer coordinates.
+
+#Subtopic Overview
+#Populate
+##
#Subtopic Related_Function
#Populate
@@ -453,10 +451,20 @@ Can also be used to add IVector to IVector, returning IVector.
#Struct SkIPoint ##
-#Topic IPoint ##
-#Topic IVector
+#Subtopic IVector
+#Line # alias for IPoint ##
+ #Alias IVector
#Alias IVectors
#Typedef SkIPoint SkIVector
+ #Line # alias for IPoint ##
+ #Code
+ typedef SkIPoint SkIVector;
+ ##
+ SkIVector provides an alternative name for SkIPoint. SkIVector and SkIPoint
+ can be used interchangably for all purposes.
#Typedef ##
##
+
+#Topic IPoint ##
+
diff --git a/docs/SkIRect_Reference.bmh b/docs/SkIRect_Reference.bmh
index 578949a3b1..4fcb26a48c 100644
--- a/docs/SkIRect_Reference.bmh
+++ b/docs/SkIRect_Reference.bmh
@@ -2,19 +2,17 @@
#Alias IRects
#Alias IRect_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Struct SkIRect
-SkIRect holds four 32 bit integer coordinates describing the upper and
-lower bounds of a rectangle. SkIRect may be created from outer bounds or
+SkIRect holds four 32-bit integer coordinates describing the upper and
+lower bounds of a rectangle. SkIRect may be created from outer bounds or
from position, width, and height. SkIRect describes an area; if its right
is less than or equal to its left, or if its bottom is less than or equal to
-its top, it is considered empty.
+its top, it is considered empty.
+
+#Subtopic Overview
+#Populate
+##
#Subtopic Related_Function
#Populate
@@ -126,7 +124,7 @@ all equal
#In Constructor
#Line # constructs from ISize returning (0, 0, width, height) ##
-Returns constructed IRect set to (0, 0, size.width(), size.height()).
+Returns constructed IRect set to (0, 0, size.width(), size.height()).
Does not validate input; size.width() or size.height() may be negative.
#Param size values for IRect width and height ##
@@ -145,7 +143,7 @@ floor width: 25 height: 35
##
##
-#SeeAlso MakeWH MakeXYWH SkRect::Make SkRect::MakeIWH
+#SeeAlso MakeWH MakeXYWH SkRect::Make SkRect::MakeIWH
##
@@ -590,7 +588,7 @@ sorted: {20, 40, 20, 50} is empty
#In Operator
#Line # returns true if members are equal ##
-Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
+Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
identical to corresponding members in b.
#Param a IRect to compare ##
@@ -617,7 +615,7 @@ test == sorted
#In Operator
#Line # returns true if members are unequal ##
-Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not
+Returns true if any member in a: fLeft, fTop, fRight, and fBottom; is not
identical to the corresponding member in b.
#Param a IRect to compare ##
@@ -787,7 +785,7 @@ Returns IRect offset by (dx, dy).
If dx is negative, IRect returned is moved to the left.
If dx is positive, IRect returned is moved to the right.
If dy is negative, IRect returned is moved upward.
-If dy is positive, IRect returned is moved downward.
+If dy is positive, IRect returned is moved downward.
#Param dx offset added to fLeft and fRight ##
#Param dy offset added to fTop and fBottom ##
@@ -822,7 +820,7 @@ Returns IRect, inset by (dx, dy).
If dx is negative, IRect returned is wider.
If dx is positive, IRect returned is narrower.
If dy is negative, IRect returned is taller.
-If dy is positive, IRect returned is shorter.
+If dy is positive, IRect returned is shorter.
#Param dx offset added to fLeft and subtracted from fRight ##
#Param dy offset added to fTop and subtracted from fBottom ##
@@ -857,7 +855,7 @@ Returns IRect, outset by (dx, dy).
If dx is negative, IRect returned is narrower.
If dx is positive, IRect returned is wider.
If dy is negative, IRect returned is shorter.
-If dy is positive, IRect returned is taller.
+If dy is positive, IRect returned is taller.
#Param dx offset subtracted to fLeft and added from fRight ##
#Param dy offset subtracted to fTop and added from fBottom ##
@@ -892,7 +890,7 @@ Offsets IRect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
If dx is negative, moves IRect returned to the left.
If dx is positive, moves IRect returned to the right.
If dy is negative, moves IRect returned upward.
-If dy is positive, moves IRect returned downward.
+If dy is positive, moves IRect returned downward.
#Param dx offset added to fLeft and fRight ##
#Param dy offset added to fTop and fBottom ##
@@ -921,7 +919,7 @@ fTop, fBottom.
If delta.fX is negative, moves IRect returned to the left.
If delta.fX is positive, moves IRect returned to the right.
If delta.fY is negative, moves IRect returned upward.
-If delta.fY is positive, moves IRect returned downward.
+If delta.fY is positive, moves IRect returned downward.
#Param delta offset added to IRect ##
@@ -1024,9 +1022,9 @@ rect: 5, 1, 55, 86
#Subtopic Inset_Outset_Offset ##
#Subtopic Intersection
-#Line # set to shared bounds ##
+#Line # sets to shared bounds ##
-IRects intersect when they enclose a common area. To intersect, each of the pair
+IRects intersect when they enclose a common area. To intersect, each of the pair
must describe area; fLeft is less than fRight, and fTop is less than fBottom;
empty() returns false. The intersection of IRect pair can be described by:
@@ -1295,11 +1293,11 @@ be before or after the call to intersect.
SkIRect leftRect = { 10, 40, 50, 80 };
SkIRect rightRect = { 30, 60, 70, 90 };
SkDebugf("%s intersection: ", leftRect.intersect(rightRect) ? "" : "no ");
- SkDebugf("%d, %d, %d, %d\n", leftRect.left(), leftRect.top(),
+ SkDebugf("%d, %d, %d, %d\n", leftRect.left(), leftRect.top(),
leftRect.right(), leftRect.bottom());
#StdOut
intersection: 30, 60, 50, 80
-##
+##
##
#SeeAlso Intersects intersectNoEmptyCheck join SkRect::intersect
@@ -1328,7 +1326,7 @@ Returns false if either a or b is empty, leaving IRect unchanged.
result.left(), result.top(), result.right(), result.bottom());
#StdOut
intersection: 30, 60, 50, 80
-##
+##
##
#SeeAlso Intersects intersectNoEmptyCheck join SkRect::intersect
@@ -1359,7 +1357,7 @@ Asserts if either a or b is empty, and if SK_DEBUG is defined.
}
#StdOut
intersection: 30, 60, 50, 80
-##
+##
##
#SeeAlso Intersects intersect join SkRect::intersect
@@ -1394,11 +1392,11 @@ be before or after the call to intersect.
##
SkIRect leftRect = { 10, 40, 50, 80 };
SkDebugf("%s intersection: ", leftRect.intersect(30, 60, 70, 90) ? "" : "no ");
- SkDebugf("%d, %d, %d, %d\n", leftRect.left(), leftRect.top(),
+ SkDebugf("%d, %d, %d, %d\n", leftRect.left(), leftRect.top(),
leftRect.right(), leftRect.bottom());
#StdOut
intersection: 30, 60, 50, 80
-##
+##
##
#SeeAlso intersectNoEmptyCheck Intersects join SkRect::intersect
@@ -1423,7 +1421,7 @@ Returns false if either a or b is empty, or do not intersect.
SkDebugf("%s intersection", SkIRect::Intersects({10, 40, 50, 80}, {30, 60, 70, 90}) ? "" : "no ");
#StdOut
intersection
-##
+##
##
#SeeAlso IntersectsNoEmptyCheck intersect SkRect::intersect
@@ -1449,7 +1447,7 @@ Asserts if either a or b is empty, and if SK_DEBUG is defined.
{10, 40, 50, 80}, {30, 60, 70, 90}) ? "" : "no ");
#StdOut
intersection
-##
+##
##
#SeeAlso Intersects intersect SkRect::intersect
@@ -1461,7 +1459,7 @@ Asserts if either a or b is empty, and if SK_DEBUG is defined.
# ------------------------------------------------------------------------------
#Subtopic Join
-#Line # set to union of bounds ##
+#Line # sets to union of bounds ##
#Populate
##
@@ -1488,7 +1486,7 @@ IRect to construction.
SkDebugf("join: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
#StdOut
join: 10, 20, 55, 65
-##
+##
##
#SeeAlso set SkRect::join
@@ -1512,7 +1510,7 @@ Has no effect if r is empty. Otherwise, if IRect is empty, sets IRect to r.
SkDebugf("join: %d, %d, %d, %d\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
#StdOut
join: 10, 20, 55, 65
-##
+##
##
#SeeAlso set SkRect::join
@@ -1555,7 +1553,7 @@ sorted: 20, 10, 30, 50
#In Sorting
#In Constructor
-#Line # constructs, ordering sides from smaller to larger ##
+#Line # constructs IRect, ordering sides from smaller to larger ##
Returns IRect with fLeft and fRight swapped if fLeft is greater than fRight; and
with fTop and fBottom swapped if fTop is greater than fBottom. Result may be empty;
and width() and height() will be zero or positive.
diff --git a/docs/SkImageInfo_Reference.bmh b/docs/SkImageInfo_Reference.bmh
index 8023847794..861dabbdee 100644
--- a/docs/SkImageInfo_Reference.bmh
+++ b/docs/SkImageInfo_Reference.bmh
@@ -12,9 +12,7 @@ destinations on the GPU. Image and Surface may be specified by Image_Info,
but Image and Surface may not contain Image_Info.
#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
+#Populate
##
#Subtopic Constant
@@ -51,7 +49,7 @@ be opaque, or Color_Alpha, describing multiple levels of transparency.
In simple blending, Color_Alpha weights the draw color and the destination
color to create a new color. If alpha describes a weight from zero to one:
-#Formula
+#Code
new color = draw color * alpha + destination color * (1 - alpha)
##
@@ -62,21 +60,32 @@ value is the original Color_RGB multiplied by Color_Alpha. Premultiplied color
components improve performance.
#Const kUnknown_SkAlphaType 0
-Alpha_Type is uninitialized.
+#Line # uninitialized ##
+ Alpha_Type is uninitialized.
##
#Const kOpaque_SkAlphaType 1
-Pixels are opaque. The Color_Type must have no explicit alpha
-component, or all alpha components must be set to their maximum value.
+#Line # pixel is opaque ##
+#Details Opaque
+ Pixels are opaque. The Color_Type must have no explicit alpha
+ component, or all alpha components must be set to their maximum value.
##
#Const kPremul_SkAlphaType 2
-Pixels have alpha premultiplied into color components.
-Surface pixels must be premultiplied.
+#Line # pixel components are Premultiplied by Alpha ##
+#Details Premul
+ Pixels have Alpha Premultiplied into color components.
+ Surface pixels must be Premultiplied.
##
#Const kUnpremul_SkAlphaType 3
-Pixel color component values are independent of alpha value.
-Images generated from encoded data like PNG do not premultiply pixel color
-components. kUnpremul_SkAlphaType is supported for Image pixels, but not for
-Surface pixels.
+#Line # pixel components are independent of Alpha ##
+#Details Unpremul
+ Pixel color component values are independent of alpha value.
+ Images generated from encoded data like PNG do not Premultiply pixel color
+ components. kUnpremul_SkAlphaType is supported for Image pixels, but not for
+ Surface pixels.
+##
+#Const kLastEnum_SkAlphaType 3
+#Line # last valid value ##
+ Used by tests to iterate through all valid values.
##
#NoExample
@@ -87,18 +96,18 @@ Surface pixels.
#Enum SkAlphaType ##
#Subtopic Opaque
-
-Use Opaque as a hint to optimize drawing when alpha component
+#Line # hints all pixels are opaque ##
+Use kOpaque_SkAlphaType as a hint to optimize drawing when Alpha component
of all pixel is set to its maximum value of 1.0; all alpha component bits are set.
-If Image_Info is set to Opaque but all alpha values are not 1.0, results are
-undefined.
+If Image_Info is set to kOpaque_SkAlphaType but all alpha values are not 1.0,
+results are undefined.
#Example
#Height 64
#Description
SkPreMultiplyARGB parameter a is set to 255, its maximum value, and is interpreted
as Color_Alpha of 1.0. kOpaque_SkAlphaType may be set to improve performance.
-If SkPreMultiplyARGB parameter a is set to a value smaller than 255,
+If SkPreMultiplyARGB parameter a is set to a value smaller than 255,
kPremul_SkAlphaType must be used instead to avoid undefined results.
The four displayed values are the original component values, though not necessarily
in the same order.
@@ -121,12 +130,12 @@ in the same order.
#Subtopic Opaque ##
#Subtopic Premul
+#Line # stores components scaled by Alpha ##
+Use kPremul_SkAlphaType when stored color components are the original color
+multiplied by the alpha component. The alpha component range of 0.0 to 1.0 is
+achieved by dividing the integer bit value by the maximum bit value.
-Use Premul when stored color components are the original color multiplied by the
-alpha component. The alpha component range of 0.0 to 1.0 is achieved by dividing
-the integer bit value by the maximum bit value.
-
-#Formula
+#Code
stored color = original color * alpha / max alpha
##
@@ -137,7 +146,7 @@ or the results are undefined.
#Description
SkPreMultiplyARGB parameter a is set to 150, less than its maximum value, and is
interpreted as Color_Alpha of about 0.6. kPremul_SkAlphaType must be set, since
-SkPreMultiplyARGB parameter a is set to a value smaller than 255,
+SkPreMultiplyARGB parameter a is set to a value smaller than 255,
to avoid undefined results.
The four displayed values reflect that the alpha component has been multiplied
by the original color.
@@ -161,16 +170,17 @@ by the original color.
#Subtopic Premul ##
#Subtopic Unpremul
-
-Use Unpremul if stored color components are not divided by the alpha component.
-Some drawing destinations may not support Unpremul.
+#Line # stores components without Alpha scaling ##
+Use kUnpremul_SkAlphaType if stored color components are not divided by the
+alpha component. Some drawing destinations may not support
+kUnpremul_SkAlphaType.
#Bug 7079
#Example
#Height 64
#Description
SkColorSetARGB parameter a is set to 150, less than its maximum value, and is
-interpreted as Color_Alpha of about 0.6. color is not premultiplied;
+interpreted as Color_Alpha of about 0.6. color is not Premultiplied;
color components may have values greater than color alpha.
The four displayed values are the original component values, though not necessarily
in the same order.
@@ -224,11 +234,6 @@ kBGRA_8888_SkColorType, kRGBA_1010102_SkColorType, kRGB_101010x_SkColorType,
kGray_8_SkColorType, kRGBA_F16_SkColorType
##
-#Subtopic Native
-#Alias Native_Color_Type
-#Substitute native SkColorType
-##
-
#Enum SkColorType
#Line # encoding for pixel color ##
@@ -260,7 +265,7 @@ $$$#
#Code ##
Describes how pixel bits encode color. A pixel may be an alpha mask, a
-gray level, Color_RGB, or Color_ARGB.
+gray level, Color_RGB, or Color_ARGB.
kN32_SkColorType selects the native 32-bit Color_ARGB format. On Little_Endian
processors, pixels containing 8-bit Color_ARGB components pack into 32-bit
@@ -268,43 +273,93 @@ kBGRA_8888_SkColorType. On Big_Endian processors, pixels pack into 32-bit
kRGBA_8888_SkColorType.
#Const kUnknown_SkColorType 0
- Color_Type is uninitialized; encoding format and size is unknown.
+#Line # uninitialized ##
+ Color_Type is set to kUnknown_SkColorType by default. If set,
+ encoding format and size is unknown.
##
+
#Const kAlpha_8_SkColorType 1
- Encodes Color_Alpha as Alpha_8 pixel in an 8-bit byte.
+#Line # pixel with Alpha in 8-bit byte ##
+#Details Alpha_8
+ Stores 8-bit byte pixel encoding that represents transparency. Value of zero
+ is completely transparent; a value of 255 is completely opaque.
##
+
#Const kRGB_565_SkColorType 2
- Encodes Color_RGB as BGR_565 pixel in a 16-bit word.
+#Line # pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word ##
+#Details RGB_565
+ Stores 16-bit word pixel encoding that contains five bits of blue,
+ six bits of green, and five bits of red.
##
+
#Const kARGB_4444_SkColorType 3
- Encodes Color_ARGB as ABGR_4444 pixel in a 16-bit word.
+#Line # pixel with 4 bits for alpha, red, green, blue; in 16-bit word ##
+#Details ARGB_4444
+ Stores 16-bit word pixel encoding that contains four bits of alpha,
+ four bits of blue, four bits of green, and four bits of red.
##
+
#Const kRGBA_8888_SkColorType 4
- Encodes Color_ARGB as RGBA_8888 pixel in a 32-bit word.
+#Line # pixel with 8 bits for red, green, blue, alpha; in 32-bit word ##
+#Details RGBA_8888
+ Stores 32-bit word pixel encoding that contains eight bits of red,
+ eight bits of green, eight bits of blue, and eight bits of alpha.
##
+
#Const kRGB_888x_SkColorType 5
- Encodes Color_RGB as RGB_888x pixel in a 32-bit word.
+#Line # pixel with 8 bits each for red, green, blue; in 32-bit word ##
+#Details RGB_888
+ Stores 32-bit word pixel encoding that contains eight bits of red,
+ eight bits of green, eight bits of blue, and eight unused bits.
##
+
#Const kBGRA_8888_SkColorType 6
- Encodes Color_ARGB as BGRA_8888 pixel in a 32-bit word.
+#Line # pixel with 8 bits for blue, green, red, alpha; in 32-bit word ##
+#Details BGRA_8888
+ Stores 32-bit word pixel encoding that contains eight bits of blue,
+ eight bits of green, eight bits of red, and eight bits of alpha.
##
+
#Const kRGBA_1010102_SkColorType 7
- Encodes Color_ARGB as RGBA_1010102 pixel in a 32-bit word.
+#Line # 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word ##
+#Details RGBA_1010102
+ Stores 32-bit word pixel encoding that contains ten bits of red,
+ ten bits of green, ten bits of blue, and two bits of alpha.
##
+
#Const kRGB_101010x_SkColorType 8
- Encodes Color_RGB as RGB_101010x pixel in a 32-bit word.
+#Line # pixel with 10 bits each for red, green, blue; in 32-bit word ##
+#Details RGB_101010
+ Stores 32-bit word pixel encoding that contains ten bits of red,
+ ten bits of green, ten bits of blue, and two unused bits.
##
+
#Const kGray_8_SkColorType 9
- Encodes Color_Gray as Gray_8 in an 8-bit byte.
+#Line # pixel with Color_Gray level in 8-bit byte ##
+#Details Gray_8
+ Stores 8-bit byte pixel encoding that equivalent to equal values for red,
+ blue, and green, representing colors from black to white.
##
+
#Const kRGBA_F16_SkColorType 10
- Encodes Color_ARGB as RGBA_F16 in a 64-bit word.
+#Line # pixel with half floats for red, green, blue, alpha; in 64-bit word ##
+#Details RGBA_F16
+ Stores 64-bit word pixel encoding that contains 16 bits of blue,
+ 16 bits of green, 16 bits of red, and 16 bits of alpha.
##
-#ToDo can be 4 or 6; how to document? ##
-#Const kN32_SkColorType 4
- Encodes Color_ARGB as either RGBA_8888 or BGRA_8888, whichever
- is native to the platform.
+#Const kLastEnum_SkColorType 10
+#NoJustify
+#Line # last valid value ##
+ Used by tests to iterate through all valid values.
+##
+
+#Const kN32_SkColorType 4 or 6
+#Alias Native_Color_Type
+#NoJustify
+#Line # native Color_ARGB 32-bit encoding ##
+ Encodes Color_ARGB as either kRGBA_8888_SkColorType or
+ kBGRA_8888_SkColorType, whichever is native to the platform.
##
#NoExample
@@ -315,448 +370,478 @@ kRGBA_8888_SkColorType.
#Enum SkColorType ##
#Subtopic Alpha_8
-
-Alpha_8 is an 8-bit byte pixel encoding that represents transparency. A value of zero is
-completely transparent; a value of 255 is completely opaque. Bitmap with Alpha_8
-pixels does not visibly draw, because its pixels have no color information.
-The paired SkAlphaType is ignored.
-
-#Example
-#Description
-Alpha_8 pixels can modify another draw. orangePaint fills the bounds of bitmap,
-with its transparency set to alpha8 pixel value.
-##
-#Height 64
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kAlpha_8_SkColorType, kOpaque_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- SkPaint orangePaint;
- orangePaint.setARGB(0xFF, 0xFF, 0xA5, 0x00);
- canvas->drawBitmap(bitmap, 0, 0, &orangePaint);
- uint8_t alpha8[] = { 0xFF, 0xBB, 0x77, 0x33 };
- SkPixmap alphaPixmap(imageInfo, &alpha8, imageInfo.minRowBytes());
- if (bitmap.writePixels(alphaPixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 2, 2, &orangePaint);
- }
-##
-##
-
-#Subtopic BGR_565
-
-BGR_565 is a 16-bit word pixel encoding that contains five bits of blue,
-six bits of green, and five bits of red. BGR_565 is fully opaque as if its
-Color_Alpha was set to one, and should always be paired with kOpaque_SkAlphaType.
-
-#Illustration
-
-#Example
-#Height 96
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_565_SkColorType, kOpaque_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto pack565 = [](unsigned r, unsigned g, unsigned b) -> uint16_t {
- return (b << 0) | (g << 5) | (r << 11);
- };
- uint16_t red565[] = { pack565(0x1F, 0x00, 0x00), pack565(0x17, 0x00, 0x00),
- pack565(0x0F, 0x00, 0x00), pack565(0x07, 0x00, 0x00) };
- uint16_t blue565[] = { pack565(0x00, 0x00, 0x1F), pack565(0x00, 0x00, 0x17),
- pack565(0x00, 0x00, 0x0F), pack565(0x00, 0x00, 0x07) };
- SkPixmap redPixmap(imageInfo, &red565, imageInfo.minRowBytes());
- if (bitmap.writePixels(redPixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
- SkPixmap bluePixmap(imageInfo, &blue565, imageInfo.minRowBytes());
- if (bitmap.writePixels(bluePixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 4, 4);
- }
-##
+#Line # encodes transparency only ##
+ Alpha pixels encode transparency without color information. Value of zero is
+ completely transparent; a value of 255 is completely opaque. Bitmap
+ pixels do not visibly draw, because its pixels have no color information.
+ When SkColorType is set to kAlpha_8_SkColorType, the paired SkAlphaType is
+ ignored.
+
+ #Example
+ #Description
+ Alpha pixels can modify another draw. orangePaint fills the bounds of bitmap,
+ with its transparency set to alpha8 pixel value.
+ ##
+ #Height 64
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kAlpha_8_SkColorType, kOpaque_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ SkPaint orangePaint;
+ orangePaint.setARGB(0xFF, 0xFF, 0xA5, 0x00);
+ canvas->drawBitmap(bitmap, 0, 0, &orangePaint);
+ uint8_t alpha8[] = { 0xFF, 0xBB, 0x77, 0x33 };
+ SkPixmap alphaPixmap(imageInfo, &alpha8, imageInfo.minRowBytes());
+ if (bitmap.writePixels(alphaPixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 2, 2, &orangePaint);
+ }
+ ##
+ #SeeAlso incomplete
+##
+
+#Subtopic RGB_565
+#Line # encodes Color_RGB in 16 bits ##
+ kRGB_565_SkColorType encodes Color_RGB to fit in a 16-bit word. Red and Blue
+ components use five bits describing 32 levels. Green components, more sensitive
+ to the eye, use six bits describing 64 levels. kRGB_565_SkColorType has no
+ bits for Alpha.
+
+ Pixels are fully opaque as if its Color_Alpha was set to one, and should
+ always be paired with kOpaque_SkAlphaType.
+
+ #Illustration
+
+ #Example
+ #Height 96
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_565_SkColorType, kOpaque_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto pack565 = [](unsigned r, unsigned g, unsigned b) -> uint16_t {
+ return (b << 0) | (g << 5) | (r << 11);
+ };
+ uint16_t red565[] = { pack565(0x1F, 0x00, 0x00), pack565(0x17, 0x00, 0x00),
+ pack565(0x0F, 0x00, 0x00), pack565(0x07, 0x00, 0x00) };
+ uint16_t blue565[] = { pack565(0x00, 0x00, 0x1F), pack565(0x00, 0x00, 0x17),
+ pack565(0x00, 0x00, 0x0F), pack565(0x00, 0x00, 0x07) };
+ SkPixmap redPixmap(imageInfo, &red565, imageInfo.minRowBytes());
+ if (bitmap.writePixels(redPixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ SkPixmap bluePixmap(imageInfo, &blue565, imageInfo.minRowBytes());
+ if (bitmap.writePixels(bluePixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
+ ##
+ #SeeAlso incomplete
##
-#Subtopic ABGR_4444
-
-ABGR_4444 is a 16-bit word pixel encoding that contains four bits of alpha,
-four bits of blue, four bits of green, and four bits of red.
+#Subtopic ARGB_4444
+#Line # encodes Color_ARGB in 16 bits ##
+ kARGB_4444_SkColorType encodes Color_ARGB to fit in 16-bit word. Each
+ component: alpha, blue, green, and red; use four bits, describing 16 levels.
+ Note that kARGB_4444_SkColorType is misnamed; the acronym does not
+ describe the actual component order.
-#Illustration
+ #Illustration
-If paired with kPremul_SkAlphaType: blue, green, and red components are
-premultiplied by the alpha value. If blue, green, or red is greater than alpha,
-the drawn result is undefined.
+ If paired with kPremul_SkAlphaType: blue, green, and red components are
+ Premultiplied by the alpha value. If blue, green, or red is greater than alpha,
+ the drawn result is undefined.
-If paired with kUnpremul_SkAlphaType: alpha, blue, green, and red components
-may have any value. There may be a performance penalty with unpremultipled
-pixels.
+ If paired with kUnpremul_SkAlphaType: alpha, blue, green, and red components
+ may have any value. There may be a performance penalty with Unpremultipled
+ pixels.
-If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
-blue, green, and red components are fully opaque. If any alpha component is
-less than 15, the drawn result is undefined.
+ If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
+ blue, green, and red components are fully opaque. If any alpha component is
+ less than 15, the drawn result is undefined.
-#Bug 7648
+ #Bug 7648
-#Example
-#Height 96
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, kPremul_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto pack4444 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint16_t {
- return (a << 0) | (b << 4) | (g << 8) | (r << 12);
- };
- uint16_t red4444[] = { pack4444(0xF, 0xF, 0x0, 0x0), pack4444(0xF, 0xb, 0x0, 0x0),
- pack4444(0xF, 0x7, 0x0, 0x0), pack4444(0xF, 0x3, 0x0, 0x0) };
- uint16_t blue4444[] = { pack4444(0xF, 0x0, 0x0, 0xF), pack4444(0xF, 0x0, 0x0, 0xb),
- pack4444(0xF, 0x0, 0x0, 0x7), pack4444(0xF, 0x0, 0x0, 0x3) };
- SkPixmap redPixmap(imageInfo, &red4444, imageInfo.minRowBytes());
- if (bitmap.writePixels(redPixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
- SkPixmap bluePixmap(imageInfo, &blue4444, imageInfo.minRowBytes());
- if (bitmap.writePixels(bluePixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 4, 4);
- }
-##
+ #Example
+ #Height 96
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, kPremul_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto pack4444 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint16_t {
+ return (a << 0) | (b << 4) | (g << 8) | (r << 12);
+ };
+ uint16_t red4444[] = { pack4444(0xF, 0xF, 0x0, 0x0), pack4444(0xF, 0xb, 0x0, 0x0),
+ pack4444(0xF, 0x7, 0x0, 0x0), pack4444(0xF, 0x3, 0x0, 0x0) };
+ uint16_t blue4444[] = { pack4444(0xF, 0x0, 0x0, 0xF), pack4444(0xF, 0x0, 0x0, 0xb),
+ pack4444(0xF, 0x0, 0x0, 0x7), pack4444(0xF, 0x0, 0x0, 0x3) };
+ SkPixmap redPixmap(imageInfo, &red4444, imageInfo.minRowBytes());
+ if (bitmap.writePixels(redPixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ SkPixmap bluePixmap(imageInfo, &blue4444, imageInfo.minRowBytes());
+ if (bitmap.writePixels(bluePixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
+ ##
+ #SeeAlso incomplete
##
#Subtopic RGBA_8888
-
-RGBA_8888 is a 32-bit word pixel encoding that contains eight bits of red,
-eight bits of green, eight bits of blue, and eight bits of alpha.
-
-#Illustration
-
-If paired with kPremul_SkAlphaType: red, green, and blue components are
-premultiplied by the alpha value. If red, green, or blue is greater than alpha,
-the drawn result is undefined.
-
-If paired with kUnpremul_SkAlphaType: alpha, red, green, and blue components
-may have any value. There may be a performance penalty with unpremultipled
-pixels.
-
-If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
-red, green, and blue components are fully opaque. If any alpha component is
-less than 255, the drawn result is undefined.
-
-On Big_Endian platforms, RGBA_8888 is the native Color_Type, and will have
-the best performance. Use kN32_SkColorType to choose the best Color_Type for
-the platform at compile time.
-
-#Example
-#Height 96
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {
- return (r << 0) | (g << 8) | (b << 16) | (a << 24);
- };
- uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0),
- pack8888(0xFF, 0x77, 0x0, 0x0), pack8888(0xFF, 0x33, 0x0, 0x0) };
- uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),
- pack8888(0xFF, 0x0, 0x0, 0x077), pack8888(0xFF, 0x0, 0x0, 0x033) };
- SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());
- if (bitmap.writePixels(redPixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
- SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());
- if (bitmap.writePixels(bluePixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 4, 4);
- }
-##
-##
-
-#Subtopic RGB_888x
-
-RGB_888x is a 32-bit word pixel encoding that contains eight bits of red,
-eight bits of green, eight bits of blue, and eight unused bits. RGB_888x is fully
-opaque as if its Color_Alpha was set to one, and should always be paired with
-kOpaque_SkAlphaType.
-
-#Illustration
-
-#Example
-#Bug 7645
-#Height 96
-#Platform cpu
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_888x_SkColorType, kOpaque_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto pack888 = [](unsigned r, unsigned g, unsigned b) -> uint32_t {
- return (r << 0) | (g << 8) | (b << 16);
- };
- uint32_t red888[] = { pack888(0xFF, 0x00, 0x00), pack888(0xbb, 0x00, 0x00),
- pack888(0x77, 0x00, 0x00), pack888(0x33, 0x00, 0x00) };
- uint32_t blue888[] = { pack888(0x00, 0x00, 0xFF), pack888(0x00, 0x00, 0xbb),
- pack888(0x00, 0x00, 0x77), pack888(0x00, 0x00, 0x33) };
- if (bitmap.installPixels(imageInfo, (void*) red888, imageInfo.minRowBytes())) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
- if (bitmap.installPixels(imageInfo, (void*) blue888, imageInfo.minRowBytes())) {
- canvas->drawBitmap(bitmap, 4, 4);
- }
-##
+#Line # encodes Color_ARGB Big_Endian in 32 bits ##
+ kRGBA_8888_SkColorType encodes Color_ARGB into a 32-bit word. Each component:
+ red, green, blue, alpha; use eight bits, describing 256 levels.
+
+ #Illustration
+
+ If paired with kPremul_SkAlphaType: red, green, and blue components are
+ Premultiplied by the alpha value. If red, green, or blue is greater than alpha,
+ the drawn result is undefined.
+
+ If paired with kUnpremul_SkAlphaType: alpha, red, green, and blue components
+ may have any value. There may be a performance penalty with Unpremultipled
+ pixels.
+
+ If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
+ red, green, and blue components are fully opaque. If any alpha component is
+ less than 255, the drawn result is undefined.
+
+ On Big_Endian platforms, kRGBA_8888_SkColorType is the native Color_Type, and
+ will have the best performance. Use kN32_SkColorType to choose the best
+ Color_Type for the platform at compile time.
+
+ #Example
+ #Height 96
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {
+ return (r << 0) | (g << 8) | (b << 16) | (a << 24);
+ };
+ uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0),
+ pack8888(0xFF, 0x77, 0x0, 0x0), pack8888(0xFF, 0x33, 0x0, 0x0) };
+ uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),
+ pack8888(0xFF, 0x0, 0x0, 0x077), pack8888(0xFF, 0x0, 0x0, 0x033) };
+ SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());
+ if (bitmap.writePixels(redPixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());
+ if (bitmap.writePixels(bluePixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
+ ##
+ #SeeAlso incomplete
+##
+
+#Subtopic RGB_888
+#Line # encodes Color_RGB in 32 bits ##
+ kRGB_888x_SkColorType encodes Color_RGB into a 32-bit word. Each component:
+ red, green, blue; use eight bits, describing 256 levels. Eight bits are
+ unused. Pixels described by kRGB_888x_SkColorType are fully opaque as if
+ their Color_Alpha was set to one, and should always be paired with
+ kOpaque_SkAlphaType.
+
+ #Illustration
+
+ #Example
+ #Bug 7645
+ #Height 96
+ #Platform cpu
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_888x_SkColorType, kOpaque_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto pack888 = [](unsigned r, unsigned g, unsigned b) -> uint32_t {
+ return (r << 0) | (g << 8) | (b << 16);
+ };
+ uint32_t red888[] = { pack888(0xFF, 0x00, 0x00), pack888(0xbb, 0x00, 0x00),
+ pack888(0x77, 0x00, 0x00), pack888(0x33, 0x00, 0x00) };
+ uint32_t blue888[] = { pack888(0x00, 0x00, 0xFF), pack888(0x00, 0x00, 0xbb),
+ pack888(0x00, 0x00, 0x77), pack888(0x00, 0x00, 0x33) };
+ if (bitmap.installPixels(imageInfo, (void*) red888, imageInfo.minRowBytes())) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ if (bitmap.installPixels(imageInfo, (void*) blue888, imageInfo.minRowBytes())) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
+ ##
##
#Subtopic BGRA_8888
-
-BGRA_8888 is a 32-bit word pixel encoding that contains eight bits of blue,
-eight bits of green, eight bits of red, and eight bits of alpha.
-
-#Illustration
-
-If paired with kPremul_SkAlphaType: blue, green, and red components are
-premultiplied by the alpha value. If blue, green, or red is greater than alpha,
-the drawn result is undefined.
-
-If paired with kUnpremul_SkAlphaType: blue, green, red, and alpha components
-may have any value. There may be a performance penalty with unpremultipled
-pixels.
-
-If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
-blue, green, and red components are fully opaque. If any alpha component is
-less than 255, the drawn result is undefined.
-
-On Little_Endian platforms, BGRA_8888 is the native Color_Type, and will have
-the best performance. Use kN32_SkColorType to choose the best Color_Type for
-the platform at compile time.
-
-#Example
-#Height 96
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kBGRA_8888_SkColorType, kPremul_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {
- return (b << 0) | (g << 8) | (r << 16) | (a << 24);
- };
- uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0),
- pack8888(0xFF, 0x99, 0x0, 0x0), pack8888(0xFF, 0x55, 0x0, 0x0) };
- uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),
- pack8888(0xFF, 0x0, 0x0, 0x099), pack8888(0xFF, 0x0, 0x0, 0x055) };
- SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());
- if (bitmap.writePixels(redPixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
- SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());
- if (bitmap.writePixels(bluePixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 4, 4);
- }
-##
+#Line # encodes Color_ARGB Little_Endian in 32 bits ##
+ kBGRA_8888_SkColorType encodes Color_ARGB into a 32-bit word. Each component:
+ blue, green, red, and alpha; use eight bits, describing 256 levels.
+
+ #Illustration
+
+ If paired with kPremul_SkAlphaType: blue, green, and red components are
+ Premultiplied by the alpha value. If blue, green, or red is greater than alpha,
+ the drawn result is undefined.
+
+ If paired with kUnpremul_SkAlphaType: blue, green, red, and alpha components
+ may have any value. There may be a performance penalty with Unpremultiplied
+ pixels.
+
+ If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
+ blue, green, and red components are fully opaque. If any alpha component is
+ less than 255, the drawn result is undefined.
+
+ On Little_Endian platforms, kBGRA_8888_SkColorType is the native Color_Type,
+ and will have the best performance. Use kN32_SkColorType to choose the best
+ Color_Type for the platform at compile time.
+
+ #Example
+ #Height 96
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kBGRA_8888_SkColorType, kPremul_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t {
+ return (b << 0) | (g << 8) | (r << 16) | (a << 24);
+ };
+ uint32_t red8888[] = { pack8888(0xFF, 0xFF, 0x0, 0x0), pack8888(0xFF, 0xbb, 0x0, 0x0),
+ pack8888(0xFF, 0x99, 0x0, 0x0), pack8888(0xFF, 0x55, 0x0, 0x0) };
+ uint32_t blue8888[] = { pack8888(0xFF, 0x0, 0x0, 0x0FF), pack8888(0xFF, 0x0, 0x0, 0x0bb),
+ pack8888(0xFF, 0x0, 0x0, 0x099), pack8888(0xFF, 0x0, 0x0, 0x055) };
+ SkPixmap redPixmap(imageInfo, &red8888, imageInfo.minRowBytes());
+ if (bitmap.writePixels(redPixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ SkPixmap bluePixmap(imageInfo, &blue8888, imageInfo.minRowBytes());
+ if (bitmap.writePixels(bluePixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
+ ##
+ #SeeAlso RGBA_8888
##
#Subtopic RGBA_1010102
-
-RGBA_1010102 is a 32-bit word pixel encoding that contains ten bits of red,
-ten bits of green, ten bits of blue, and two bits of alpha. Possible alpha
-values are zero: fully transparent; one: 33% opaque; two: 67% opaque;
-three: fully opaque.
-
-#Illustration
-
-If paired with kPremul_SkAlphaType: red, green, and blue components are
-premultiplied by the alpha value. If red, green, or blue is greater than the
-alpha replicated to ten bits, the drawn result is undefined.
-
-If paired with kUnpremul_SkAlphaType: alpha, red, green, and blue components
-may have any value. There may be a performance penalty with unpremultipled
-pixels.
-
-If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
-red, green, and blue components are fully opaque. If any alpha component is
-less than 3, the drawn result is undefined.
-
-#Example
-#Bug 7645
-#Height 96
-#Platform cpu
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_1010102_SkColorType, kOpaque_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto pack1010102 = [](unsigned r, unsigned g, unsigned b, unsigned a) -> uint32_t {
- return (r << 0) | (g << 10) | (b << 20) | (a << 30);
- };
- uint32_t redBits[] = { pack1010102(0x3FF, 0x000, 0x000, 0x3),
- pack1010102(0x2ff, 0x000, 0x000, 0x3),
- pack1010102(0x1ff, 0x000, 0x000, 0x3),
- pack1010102(0x0ff, 0x000, 0x000, 0x3) };
- uint32_t blueBits[] = { pack1010102(0x000, 0x000, 0x3FF, 0x3),
- pack1010102(0x000, 0x000, 0x2ff, 0x3),
- pack1010102(0x000, 0x000, 0x1ff, 0x3),
- pack1010102(0x000, 0x000, 0x0ff, 0x3) };
- if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
- SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());
- if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {
- canvas->drawBitmap(bitmap, 4, 4);
- }
-##
-##
-
-#Subtopic RGB_101010x
-
-RGB_101010x is a 32-bit word pixel encoding that contains ten bits of red,
-ten bits of green, ten bits of blue, and two unused bits. RGB_101010x is fully
-opaque as if its Color_Alpha was set to one, and should always be paired with
-kOpaque_SkAlphaType.
-
-#Illustration
-
-#Example
-#Bug 7645
-#Height 96
-#Platform cpu
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_101010x_SkColorType, kOpaque_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto pack101010x = [](unsigned r, unsigned g, unsigned b) -> uint32_t {
- return (r << 0) | (g << 10) | (b << 20);
- };
- uint32_t redBits[] = { pack101010x(0x3FF, 0x000, 0x000), pack101010x(0x2ff, 0x000, 0x000),
- pack101010x(0x1ff, 0x000, 0x000), pack101010x(0x0ff, 0x000, 0x000) };
- uint32_t blueBits[] = { pack101010x(0x000, 0x000, 0x3FF), pack101010x(0x000, 0x000, 0x2ff),
- pack101010x(0x000, 0x000, 0x1ff), pack101010x(0x000, 0x000, 0x0ff) };
- if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
- SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());
- if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {
- canvas->drawBitmap(bitmap, 4, 4);
- }
-##
+#Line # encodes Color_ARGB ten bits per color component ##
+ kRGBA_1010102_SkColorType encodes Color_ARGB into a 32-bit word. Each
+ Color component: red, green, and blue; use ten bits, describing 1024 levels.
+ Two bits contain alpha, describing four levels. Possible alpha
+ values are zero: fully transparent; one: 33% opaque; two: 67% opaque;
+ three: fully opaque.
+
+ At present, Color in Paint does not provide enough precision to
+ draw all colors possible to a kRGBA_1010102_SkColorType Surface.
+
+ #Illustration
+
+ If paired with kPremul_SkAlphaType: red, green, and blue components are
+ Premultiplied by the alpha value. If red, green, or blue is greater than the
+ alpha replicated to ten bits, the drawn result is undefined.
+
+ If paired with kUnpremul_SkAlphaType: alpha, red, green, and blue components
+ may have any value. There may be a performance penalty with Unpremultiplied
+ pixels.
+
+ If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
+ red, green, and blue components are fully opaque. If any alpha component is
+ less than three, the drawn result is undefined.
+
+ #Example
+ #Bug 7645
+ #Height 96
+ #Platform cpu
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_1010102_SkColorType, kOpaque_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto pack1010102 = [](unsigned r, unsigned g, unsigned b, unsigned a) -> uint32_t {
+ return (r << 0) | (g << 10) | (b << 20) | (a << 30);
+ };
+ uint32_t redBits[] = { pack1010102(0x3FF, 0x000, 0x000, 0x3),
+ pack1010102(0x2ff, 0x000, 0x000, 0x3),
+ pack1010102(0x1ff, 0x000, 0x000, 0x3),
+ pack1010102(0x0ff, 0x000, 0x000, 0x3) };
+ uint32_t blueBits[] = { pack1010102(0x000, 0x000, 0x3FF, 0x3),
+ pack1010102(0x000, 0x000, 0x2ff, 0x3),
+ pack1010102(0x000, 0x000, 0x1ff, 0x3),
+ pack1010102(0x000, 0x000, 0x0ff, 0x3) };
+ if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());
+ if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
+ ##
+ #SeeAlso incomplete
+##
+
+#Subtopic RGB_101010
+#Line # encodes Color_RGB ten bits per color component ##
+ kRGB_101010x_SkColorType encodes Color_RGB into a 32-bit word. Each
+ Color component: red, green, and blue; use ten bits, describing 1024 levels.
+ Two bits are unused. Pixels described by kRGB_101010x_SkColorType are fully
+ opaque as if its Color_Alpha was set to one, and should always be paired
+ with kOpaque_SkAlphaType.
+
+ At present, Color in Paint does not provide enough precision to
+ draw all colors possible to a kRGB_101010x_SkColorType Surface.
+
+ #Illustration
+
+ #Example
+ #Bug 7645
+ #Height 96
+ #Platform cpu
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGB_101010x_SkColorType, kOpaque_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto pack101010x = [](unsigned r, unsigned g, unsigned b) -> uint32_t {
+ return (r << 0) | (g << 10) | (b << 20);
+ };
+ uint32_t redBits[] = { pack101010x(0x3FF, 0x000, 0x000), pack101010x(0x2ff, 0x000, 0x000),
+ pack101010x(0x1ff, 0x000, 0x000), pack101010x(0x0ff, 0x000, 0x000) };
+ uint32_t blueBits[] = { pack101010x(0x000, 0x000, 0x3FF), pack101010x(0x000, 0x000, 0x2ff),
+ pack101010x(0x000, 0x000, 0x1ff), pack101010x(0x000, 0x000, 0x0ff) };
+ if (bitmap.installPixels(imageInfo, (void*) redBits, imageInfo.minRowBytes())) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ SkPixmap bluePixmap(imageInfo, &blueBits, imageInfo.minRowBytes());
+ if (bitmap.installPixels(imageInfo, (void*) blueBits, imageInfo.minRowBytes())) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
+ ##
+ #SeeAlso incomplete
##
#Subtopic Gray_8
-
-Gray_8 is an 8-bit byte pixel encoding that represents equal values for red,
-blue, and green, reprsenting colors from black to white. Gray_8 is fully
-opaque as if its Color_Alpha was set to one, and should always be paired with
-kOpaque_SkAlphaType.
-
-#Example
-#Height 64
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kGray_8_SkColorType, kOpaque_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- uint8_t gray8[] = { 0xFF, 0xBB, 0x77, 0x33 };
- SkPixmap grayPixmap(imageInfo, &gray8, imageInfo.minRowBytes());
- if (bitmap.writePixels(grayPixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 2, 2);
- }
-##
+#Line # encodes level of Color_Gray in 8 bits ##
+ kGray_8_SkColorType encodes Color_Gray level in eight bits that is equivalent
+ to equal values for red, blue, and green, representing colors from black to
+ white. Pixels described by kGray_8_SkColorType are fully
+ opaque as if its Color_Alpha was set to one, and should always be paired with
+ kOpaque_SkAlphaType.
+
+ #Example
+ #Height 64
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kGray_8_SkColorType, kOpaque_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ uint8_t gray8[] = { 0xFF, 0xBB, 0x77, 0x33 };
+ SkPixmap grayPixmap(imageInfo, &gray8, imageInfo.minRowBytes());
+ if (bitmap.writePixels(grayPixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ ##
+ #SeeAlso incomplete
##
#Subtopic RGBA_F16
+#Line # encodes Color_ARGB as half floats ##
+ kRGBA_F16_SkColorType encodes Color_ARGB into a 64-bit word. Each component:
+ blue, green, red, and alpha; use 16 bits, describing a floating point value.
+ from -65500 to 65000 with 3.31 decimal digits of precision.
-RGBA_F16 is a 64-bit word pixel encoding that contains sixteen bits of blue,
-sixteen bits of green, sixteen bits of red, and sixteen bits of alpha.
+ At present, Color in Paint does not provide enough precision or range to
+ draw all colors possible to a kRGBA_F16_SkColorType Surface.
-Each component encodes a floating point value using
-#A Half floats # https://www.khronos.org/opengl/wiki/Small_Float_Formats ##
-. Meaningful colors are represented by the range 0.0 to 1.0, although smaller
-and larger values may be useful when used in combination with Transfer_Mode.
+ Each component encodes a floating point value using
+ #A Half floats # https://www.khronos.org/opengl/wiki/Small_Float_Formats ##
+ . Meaningful colors are represented by the range 0.0 to 1.0, although smaller
+ and larger values may be useful when used in combination with Transfer_Mode.
-#Illustration
+ #Illustration
-If paired with kPremul_SkAlphaType: blue, green, and red components are
-premultiplied by the alpha value. If blue, green, or red is greater than alpha,
-the drawn result is undefined.
+ If paired with kPremul_SkAlphaType: blue, green, and red components are
+ Premultiplied by the alpha value. If blue, green, or red is greater than alpha,
+ the drawn result is undefined.
-If paired with kUnpremul_SkAlphaType: blue, green, red, and alpha components
-may have any value. There may be a performance penalty with unpremultipled
-pixels.
+ If paired with kUnpremul_SkAlphaType: blue, green, red, and alpha components
+ may have any value. There may be a performance penalty with Unpremultiplied
+ pixels.
-If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
-blue, green, and red components are fully opaque. If any alpha component is
-less than 255, the drawn result is undefined.
+ If paired with kOpaque_SkAlphaType: all alpha component values are at the maximum;
+ blue, green, and red components are fully opaque. If any alpha component is
+ less than 255, the drawn result is undefined.
-#ToDo
-FloatToHalf should be replaced with SkFloatToHalf if/when that's made public
-##
+ #ToDo
+ FloatToHalf should be replaced with SkFloatToHalf if/when that's made public
+ ##
-#Example
-#Height 96
-#Function
-union FloatUIntUnion {
- uint32_t fUInt;
- float fFloat;
-};
-
-uint16_t FloatToHalf(float f) {
- static const FloatUIntUnion magic = { 15 << 23 };
- static const uint32_t round_mask = ~0xfffu;
- FloatUIntUnion floatUnion;
- floatUnion.fFloat = f;
- uint32_t sign = floatUnion.fUInt & 0x80000000u;
- floatUnion.fUInt ^= sign;
- floatUnion.fUInt &= round_mask;
- floatUnion.fFloat *= magic.fFloat;
- floatUnion.fUInt -= round_mask;
- return (floatUnion.fUInt >> 13) | (sign >> 16);
-}
-##
-
-void draw(SkCanvas* canvas) {
- canvas->scale(16, 16);
- SkBitmap bitmap;
- SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F16_SkColorType, kPremul_SkAlphaType);
- bitmap.allocPixels(imageInfo);
- SkCanvas offscreen(bitmap);
- offscreen.clear(SK_ColorGREEN);
- canvas->drawBitmap(bitmap, 0, 0);
- auto H = [](float c) -> uint16_t {
- return FloatToHalf(c);
+ #Example
+ #Height 96
+ #Function
+ union FloatUIntUnion {
+ uint32_t fUInt;
+ float fFloat;
};
- // R G B A
- uint16_t red_f16[][4] = { { H(1.0f), H(0.0f), H(0.0f), H(1.0f) },
- { H(.75f), H(0.0f), H(0.0f), H(1.0f) },
- { H(.50f), H(0.0f), H(0.0f), H(1.0f) },
- { H(.25f), H(0.0f), H(0.0f), H(1.0f) } };
- uint16_t blue_f16[][4] = { { H(0.0f), H(0.0f), H(1.0f), H(1.0f) },
- { H(0.0f), H(0.0f), H(.75f), H(1.0f) },
- { H(0.0f), H(0.0f), H(.50f), H(1.0f) },
- { H(0.0f), H(0.0f), H(.25f), H(1.0f) } };
- SkPixmap redPixmap(imageInfo, red_f16, imageInfo.minRowBytes());
- if (bitmap.writePixels(redPixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 2, 2);
+
+ uint16_t FloatToHalf(float f) {
+ static const FloatUIntUnion magic = { 15 << 23 };
+ static const uint32_t round_mask = ~0xfffu;
+ FloatUIntUnion floatUnion;
+ floatUnion.fFloat = f;
+ uint32_t sign = floatUnion.fUInt & 0x80000000u;
+ floatUnion.fUInt ^= sign;
+ floatUnion.fUInt &= round_mask;
+ floatUnion.fFloat *= magic.fFloat;
+ floatUnion.fUInt -= round_mask;
+ return (floatUnion.fUInt >> 13) | (sign >> 16);
}
- SkPixmap bluePixmap(imageInfo, blue_f16, imageInfo.minRowBytes());
- if (bitmap.writePixels(bluePixmap, 0, 0)) {
- canvas->drawBitmap(bitmap, 4, 4);
+ ##
+
+ void draw(SkCanvas* canvas) {
+ canvas->scale(16, 16);
+ SkBitmap bitmap;
+ SkImageInfo imageInfo = SkImageInfo::Make(2, 2, kRGBA_F16_SkColorType, kPremul_SkAlphaType);
+ bitmap.allocPixels(imageInfo);
+ SkCanvas offscreen(bitmap);
+ offscreen.clear(SK_ColorGREEN);
+ canvas->drawBitmap(bitmap, 0, 0);
+ auto H = [](float c) -> uint16_t {
+ return FloatToHalf(c);
+ };
+ // R G B A
+ uint16_t red_f16[][4] = { { H(1.0f), H(0.0f), H(0.0f), H(1.0f) },
+ { H(.75f), H(0.0f), H(0.0f), H(1.0f) },
+ { H(.50f), H(0.0f), H(0.0f), H(1.0f) },
+ { H(.25f), H(0.0f), H(0.0f), H(1.0f) } };
+ uint16_t blue_f16[][4] = { { H(0.0f), H(0.0f), H(1.0f), H(1.0f) },
+ { H(0.0f), H(0.0f), H(.75f), H(1.0f) },
+ { H(0.0f), H(0.0f), H(.50f), H(1.0f) },
+ { H(0.0f), H(0.0f), H(.25f), H(1.0f) } };
+ SkPixmap redPixmap(imageInfo, red_f16, imageInfo.minRowBytes());
+ if (bitmap.writePixels(redPixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 2, 2);
+ }
+ SkPixmap bluePixmap(imageInfo, blue_f16, imageInfo.minRowBytes());
+ if (bitmap.writePixels(bluePixmap, 0, 0)) {
+ canvas->drawBitmap(bitmap, 4, 4);
+ }
}
-}
-##
+ ##
+ #SeeAlso incomplete
##
#Subtopic Color_Type ##
@@ -847,7 +932,7 @@ kUnknown_SkColorType, and Color_Type is not always opaque. If false is returned,
canonical is ignored.
For kUnknown_SkColorType: set canonical to kUnknown_SkAlphaType and return true.
-For kAlpha_8_SkColorType: set canonical to kPremul_SkAlphaType or
+For kAlpha_8_SkColorType: set canonical to kPremul_SkAlphaType or
kOpaque_SkAlphaType and return true if alphaType is not kUnknown_SkAlphaType.
For kRGB_565_SkColorType, kRGB_888x_SkColorType, kRGB_101010x_SkColorType, and
kGray_8_SkColorType: set canonical to kOpaque_SkAlphaType and return true.
@@ -893,6 +978,7 @@ and return true if alphaType is not kUnknown_SkAlphaType.
# ------------------------------------------------------------------------------
#Subtopic YUV_ColorSpace
+#Line # color range of YUV pixels ##
#Alias YUV_ColorSpace
#Enum SkYUVColorSpace
#Line # color range of YUV pixels ##
@@ -913,25 +999,32 @@ YUV and RGB.
JPEG YUV values encode the full range of 0 to 255 for all three components.
Video YUV values range from 16 to 235 for all three components. Details of
-encoding and conversion to RGB are described in
+encoding and conversion to RGB are described in
#A YCbCr color space # https://en.wikipedia.org/wiki/YCbCr ##
.
#Const kJPEG_SkYUVColorSpace 0
-Describes standard JPEG color space;
+#Line # describes full range ##
+Describes standard JPEG color space;
#A CCIR 601 # https://en.wikipedia.org/wiki/Rec._601 ##
with full range of 0 to 255 for components.
##
#Const kRec601_SkYUVColorSpace 1
-Describes standard used by SDTV;
+#Line # describes SDTV range ##
+Describes standard used by standard definition television;
#A CCIR 601 # https://en.wikipedia.org/wiki/Rec._601 ##
with studio range of 16 to 235 range for components.
##
#Const kRec709_SkYUVColorSpace 2
-Describes standard used by HDTV;
-#A Rec. 709 # http://en.wikipedia.org/wiki/Rec._709 ##
+#Line # describes HDTV range ##
+Describes standard used by high definition television;
+#A Rec. 709 # https://en.wikipedia.org/wiki/Rec._709 ##
with studio range of 16 to 235 range for components.
##
+#Const kLastEnum_SkYUVColorSpace 2
+#Line # last valid value ##
+ Used by tests to iterate through all valid values.
+##
#NoExample
##
@@ -945,7 +1038,7 @@ with studio range of 16 to 235 range for components.
#Struct SkImageInfo
-Describes pixel dimensions and encoding. Bitmap, Image, PixMap, and Surface
+Describes pixel dimensions and encoding. Bitmap, Image, PixMap, and Surface
can be created from Image_Info. Image_Info can be retrieved from Bitmap and
Pixmap, but not from Image and Surface. For example, Image and Surface
implementations may defer pixel depth, so may not completely specify Image_Info.
@@ -1104,8 +1197,8 @@ combination is supported.
#Set sRGB
#Height 128
#Description
-Top gradient is drawn to offscreen without Color_Space. It is darker than middle
-gradient, drawn to offscreen with sRGB Color_Space. Bottom gradient shares bits
+Top gradient is drawn to offScreen without Color_Space. It is darker than middle
+gradient, drawn to offScreen with sRGB Color_Space. Bottom gradient shares bits
with middle, but does not specify the Color_Space in noColorSpaceBitmap. A source
without Color_Space is treated as sRGB; the bottom gradient is identical to the
middle gradient.
@@ -1120,8 +1213,8 @@ middle gradient.
SK_ARRAY_COUNT(gradColors), SkShader::kClamp_TileMode));
SkBitmap bitmap;
bitmap.allocPixels(SkImageInfo::MakeN32(width, height, kPremul_SkAlphaType));
- SkCanvas offscreen(bitmap);
- offscreen.drawRect(SkRect::MakeWH(width, height), gradPaint);
+ SkCanvas offScreen(bitmap);
+ offScreen.drawRect(SkRect::MakeWH(width, height), gradPaint);
canvas->drawBitmap(bitmap, 0, 0);
bitmap.allocPixels(SkImageInfo::MakeS32(width, height, kPremul_SkAlphaType));
SkCanvas sRGBOffscreen(bitmap);
@@ -1208,7 +1301,7 @@ combination is supported.
canvas->drawBitmap(bitmap, 0, 0);
##
-#SeeAlso MakeN32 MakeS32 MakeA8 Make
+#SeeAlso MakeN32 MakeS32 MakeA8 Make
#Method ##
@@ -1396,7 +1489,7 @@ color type: kAlpha_8_SkColorType
#Method SkAlphaType alphaType() const
#In Property
-#Line # Returns Alpha_Type ##
+#Line # returns Alpha_Type ##
Returns Alpha_Type, one of: #list_of_alpha_types#.
#Return Alpha_Type ##
@@ -1429,7 +1522,7 @@ Color_Space is unchanged. The returned Color_Space is immutable.
SkColorSpace::MakeSRGBLinear creates Color_Space with linear gamma
and an sRGB gamut. This Color_Space gamma is not close to sRGB gamma.
##
- SkImageInfo info = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
+ SkImageInfo info = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
SkColorSpace::MakeSRGBLinear());
SkColorSpace* colorSpace = info.colorSpace();
SkDebugf("gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\n",
@@ -1450,7 +1543,7 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
#Method sk_sp<SkColorSpace> refColorSpace() const
#In Property
#Line # returns Color_Space ##
-Returns smart pointer to Color_Space, the range of colors. The smart pointer
+Returns smart pointer to Color_Space, the range of colors. The smart pointer
tracks the number of objects sharing this Color_Space reference so the memory
is released when the owners destruct.
@@ -1459,7 +1552,7 @@ The returned Color_Space is immutable.
#Return Color_Space wrapped in a smart pointer ##
#Example
- SkImageInfo info1 = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
+ SkImageInfo info1 = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
SkColorSpace::MakeSRGBLinear());
SkImageInfo info2 = SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
info1.refColorSpace());
@@ -1513,7 +1606,7 @@ width: 2 height: 2 empty: false
Returns true if Alpha_Type is set to hint that all pixels are opaque; their
Color_Alpha value is implicitly or explicitly 1.0. If true, and all pixels are
-not opaque, Skia may draw incorrectly.
+not opaque, Skia may draw incorrectly.
Does not check if Color_Type allows Alpha, or if any pixel value has
transparency.
@@ -1604,11 +1697,11 @@ Returns IRect { 0, 0, width(), height() }.
#Method bool gammaCloseToSRGB() const
#In Property
-#Line # Returns if Color_Space gamma is approximately the same as sRGB ##
+#Line # returns if Color_Space gamma is approximately the same as sRGB ##
Returns true if associated Color_Space is not nullptr, and Color_Space gamma
-is approximately the same as sRGB.
-This includes the
+is approximately the same as sRGB.
+This includes the
###$
$A sRGB transfer function $ https://en.wikipedia.org/wiki/SRGB#The_sRGB_transfer_function_(%22gamma%22) $$
$$$#
@@ -1668,7 +1761,7 @@ with dimensions set to width and height.
SkImageInfo canvasImageInfo = canvas->imageInfo();
SkRect canvasBounds = SkRect::Make(canvasImageInfo.bounds());
canvas->drawBitmapRect(source, source.bounds(), canvasBounds, nullptr);
- SkImageInfo insetImageInfo =
+ SkImageInfo insetImageInfo =
canvasImageInfo.makeWH(canvasBounds.width() / 2, canvasBounds.height() / 2);
SkBitmap inset;
inset.allocPixels(insetImageInfo);
@@ -1677,7 +1770,7 @@ with dimensions set to width and height.
canvas->drawBitmap(inset, canvasBounds.width() / 4, canvasBounds.height() / 4);
##
-#SeeAlso Make makeAlphaType makeColorSpace makeColorType
+#SeeAlso Make makeAlphaType makeColorSpace makeColorType
#Method ##
@@ -1687,7 +1780,7 @@ with dimensions set to width and height.
#In Constructor
#Line # creates Image_Info with changed Alpha_Type ##
Creates Image_Info with same Color_Type, Color_Space, width, and height,
-with Alpha_Type set to newAlphaType.
+with Alpha_Type set to newAlphaType.
Created Image_Info contains newAlphaType even if it is incompatible with
Color_Type, in which case Alpha_Type in Image_Info is ignored.
@@ -1704,11 +1797,11 @@ Color_Type, in which case Alpha_Type in Image_Info is ignored.
SkColor pixels[height][width];
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
- int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f)));
- int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f)));
+ int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f)));
+ int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f)));
int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f)));
int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f)));
- pixels[y][x] =
+ pixels[y][x] =
SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255);
}
}
@@ -1745,11 +1838,11 @@ with Color_Type set to newColorType.
SkColor pixels[height][width];
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
- int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f)));
- int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f)));
+ int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f)));
+ int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f)));
int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f)));
int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f)));
- pixels[y][x] =
+ pixels[y][x] =
SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255);
}
}
@@ -1905,20 +1998,20 @@ color: kRGBA_F16_SkColorType shiftPerPixel: 3
#Line # returns width() times bytesPerPixel in 64 bits ##
Returns minimum bytes per row, computed from pixel width() and Color_Type, which
-specifies bytesPerPixel(). Bitmap maximum value for row bytes must be representable
-as a positive value in a 32-bit signed integer.
+specifies bytesPerPixel(). Bitmap maximum value for row bytes must fit
+in 31 bits.
#Return width() times bytesPerPixel as unsigned 64-bit integer ##
#Example
for (int shift = 24; shift < 32; ++shift) {
int width = 1 << shift;
- SkImageInfo imageInfo =
+ SkImageInfo imageInfo =
SkImageInfo::Make(width, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType);
uint64_t minRowBytes = imageInfo.minRowBytes64();
bool widthTooLarge = (uint64_t) (int32_t) minRowBytes != minRowBytes;
SkDebugf("RGBA_F16 width %d (0x%08x) %s\n",
- width, width, widthTooLarge ? "too large" : "OK");
+ width, width, widthTooLarge ? "too large" : "OK");
}
#StdOut
RGBA_F16 width 16777216 (0x01000000) OK
@@ -1943,20 +2036,20 @@ RGBA_F16 width -2147483648 (0x80000000) too large
#Line # returns width() times bytesPerPixel in 32 bits ##
Returns minimum bytes per row, computed from pixel width() and Color_Type, which
-specifies bytesPerPixel(). Bitmap maximum value for row bytes must be representable
-as a positive value in a 32-bit signed integer.
+specifies bytesPerPixel(). Bitmap maximum value for row bytes must fit
+in 31 bits.
#Return width() times bytesPerPixel as signed 32-bit integer ##
#Example
for (int shift = 24; shift < 32; ++shift) {
int width = 1 << shift;
- SkImageInfo imageInfo =
+ SkImageInfo imageInfo =
SkImageInfo::Make(width, 1, kRGBA_F16_SkColorType, kPremul_SkAlphaType);
size_t minRowBytes = imageInfo.minRowBytes();
bool widthTooLarge = !minRowBytes;
SkDebugf("RGBA_F16 width %d (0x%08x) %s\n",
- width, width, widthTooLarge ? "too large" : "OK");
+ width, width, widthTooLarge ? "too large" : "OK");
}
#StdOut
RGBA_F16 width 16777216 (0x01000000) OK
@@ -2035,21 +2128,21 @@ Alpha_Type, and Color_Space are equivalent.
#Return true if Image_Info equals other ##
#Example
- SkImageInfo info1 = SkImageInfo::Make(10, 20, kGray_8_SkColorType, kPremul_SkAlphaType);
- SkImageInfo info2 = SkImageInfo::Make(20, 10, kAlpha_8_SkColorType, kUnpremul_SkAlphaType);
- SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
- info2 = info2.makeWH(10, 20);
- SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
- info2 = info2.makeColorType(kGray_8_SkColorType);
- SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
- info2 = info2.makeAlphaType(kPremul_SkAlphaType);
- SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
-#StdOut
-info1 != info2
-info1 != info2
-info1 != info2
-info1 == info2
-##
+ SkImageInfo info1 = SkImageInfo::Make(10, 20, kGray_8_SkColorType, kPremul_SkAlphaType);
+ SkImageInfo info2 = SkImageInfo::Make(20, 10, kAlpha_8_SkColorType, kUnpremul_SkAlphaType);
+ SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
+ info2 = info2.makeWH(10, 20);
+ SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
+ info2 = info2.makeColorType(kGray_8_SkColorType);
+ SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
+ info2 = info2.makeAlphaType(kPremul_SkAlphaType);
+ SkDebugf("info1 %c= info2\n", info1 == info2 ? '=' : '!');
+#StdOut
+info1 != info2
+info1 != info2
+info1 != info2
+info1 == info2
+##
##
#SeeAlso operator!=(const SkImageInfo& other)_const SkColorSpace::Equals
@@ -2069,21 +2162,21 @@ Alpha_Type, and Color_Space are equivalent.
#Return true if Image_Info is not equal to other ##
#Example
- SkImageInfo info1 = SkImageInfo::Make(10, 20, kGray_8_SkColorType, kPremul_SkAlphaType);
- SkImageInfo info2 = SkImageInfo::Make(20, 10, kAlpha_8_SkColorType, kUnpremul_SkAlphaType);
- SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
- info2 = info2.makeWH(10, 20);
- SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
- info2 = info2.makeColorType(kGray_8_SkColorType);
- SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
- info2 = info2.makeAlphaType(kPremul_SkAlphaType);
- SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
-#StdOut
-info1 != info2
-info1 != info2
-info1 != info2
-info1 == info2
-##
+ SkImageInfo info1 = SkImageInfo::Make(10, 20, kGray_8_SkColorType, kPremul_SkAlphaType);
+ SkImageInfo info2 = SkImageInfo::Make(20, 10, kAlpha_8_SkColorType, kUnpremul_SkAlphaType);
+ SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
+ info2 = info2.makeWH(10, 20);
+ SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
+ info2 = info2.makeColorType(kGray_8_SkColorType);
+ SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
+ info2 = info2.makeAlphaType(kPremul_SkAlphaType);
+ SkDebugf("info1 %c= info2\n", info1 != info2 ? '!' : '=');
+#StdOut
+info1 != info2
+info1 != info2
+info1 != info2
+info1 == info2
+##
##
#SeeAlso operator==(const SkImageInfo& other)_const SkColorSpace::Equals
@@ -2094,7 +2187,7 @@ info1 == info2
#Method size_t computeByteSize(size_t rowBytes) const
#In Utility
-#Line # memory required by pixel buffer with given row bytes ##
+#Line # returns memory required by pixel buffer with given row bytes ##
Returns storage required by pixel array, given Image_Info dimensions, Color_Type,
and rowBytes. rowBytes is assumed to be at least as large as minRowBytes().
@@ -2107,16 +2200,16 @@ Returns SK_MaxSizeT if answer exceeds the range of size_t.
#Example
#Height 130
- SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2);
- const size_t size = info.computeByteSize(100000);
- SkAutoTMalloc<SkPMColor> storage(size);
- SkPMColor* pixels = storage.get();
- SkBitmap bitmap;
- bitmap.setInfo(info);
- bitmap.setPixels(pixels);
- bitmap.eraseColor(SK_ColorRED);
- canvas->scale(50, 50);
- canvas->rotate(8);
+ SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2);
+ const size_t size = info.computeByteSize(100000);
+ SkAutoTMalloc<SkPMColor> storage(size);
+ SkPMColor* pixels = storage.get();
+ SkBitmap bitmap;
+ bitmap.setInfo(info);
+ bitmap.setPixels(pixels);
+ bitmap.eraseColor(SK_ColorRED);
+ canvas->scale(50, 50);
+ canvas->rotate(8);
canvas->drawBitmap(bitmap, 2, 0);
##
@@ -2128,8 +2221,8 @@ Returns SK_MaxSizeT if answer exceeds the range of size_t.
#Method size_t computeMinByteSize() const
#In Utility
-#Line # least memory required by pixel buffer ##
-Returns storage required by pixel array, given Image_Info dimensions, and
+#Line # returns least memory required by pixel buffer ##
+Returns storage required by pixel array, given Image_Info dimensions, and
Color_Type. Uses minRowBytes() to compute bytes for pixel row.
Returns zero if height is zero.
@@ -2139,16 +2232,16 @@ Returns SK_MaxSizeT if answer exceeds the range of size_t.
#Example
#Height 130
- SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2);
- const size_t size = info.computeMinByteSize();
- SkAutoTMalloc<SkPMColor> storage(size);
- SkPMColor* pixels = storage.get();
- SkBitmap bitmap;
- bitmap.setInfo(info);
- bitmap.setPixels(pixels);
- bitmap.eraseColor(SK_ColorRED);
- canvas->scale(50, 50);
- canvas->rotate(8);
+ SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2);
+ const size_t size = info.computeMinByteSize();
+ SkAutoTMalloc<SkPMColor> storage(size);
+ SkPMColor* pixels = storage.get();
+ SkBitmap bitmap;
+ bitmap.setInfo(info);
+ bitmap.setPixels(pixels);
+ bitmap.eraseColor(SK_ColorRED);
+ canvas->scale(50, 50);
+ canvas->rotate(8);
canvas->drawBitmap(bitmap, 2, 0);
##
@@ -2169,19 +2262,19 @@ computeMinByteSize return SK_MaxSizeT if size_t can not hold buffer size.
#Return true if computeByteSize or computeMinByteSize result exceeds size_t ##
#Example
- SkImageInfo info = SkImageInfo::MakeN32Premul(2, 1000000000);
- for (size_t rowBytes = 100000000; rowBytes < 10000000000000LL; rowBytes *= 10) {
- const size_t size = info.computeByteSize(rowBytes);
- SkDebugf("rowBytes:%llu size:%llu overflowed:%s\n", rowBytes, size,
- SkImageInfo::ByteSizeOverflowed(size) ? "true" : "false");
- }
-#StdOut
-rowBytes:100000000 size:99999999900000008 overflowed:false
-rowBytes:1000000000 size:999999999000000008 overflowed:false
-rowBytes:10000000000 size:9999999990000000008 overflowed:false
-rowBytes:100000000000 size:18446744073709551615 overflowed:true
-rowBytes:1000000000000 size:18446744073709551615 overflowed:true
-##
+ SkImageInfo info = SkImageInfo::MakeN32Premul(2, 1000000000);
+ for (size_t rowBytes = 100000000; rowBytes < 10000000000000LL; rowBytes *= 10) {
+ const size_t size = info.computeByteSize(rowBytes);
+ SkDebugf("rowBytes:%llu size:%llu overflowed:%s\n", rowBytes, size,
+ SkImageInfo::ByteSizeOverflowed(size) ? "true" : "false");
+ }
+#StdOut
+rowBytes:100000000 size:99999999900000008 overflowed:false
+rowBytes:1000000000 size:999999999000000008 overflowed:false
+rowBytes:10000000000 size:9999999990000000008 overflowed:false
+rowBytes:100000000000 size:18446744073709551615 overflowed:true
+rowBytes:1000000000000 size:18446744073709551615 overflowed:true
+##
##
#SeeAlso computeByteSize computeMinByteSize validRowBytes
@@ -2200,16 +2293,16 @@ Returns true if rowBytes is smaller than width times pixel size.
#Return true if rowBytes is large enough to contain pixel row ##
#Example
- SkImageInfo info = SkImageInfo::MakeN32Premul(16, 8);
- for (size_t rowBytes = 60; rowBytes < 72; rowBytes += sizeof(SkPMColor)) {
- SkDebugf("validRowBytes(%llu): %s\n", rowBytes, info.validRowBytes(rowBytes) ?
- "true" : "false");
- }
-#StdOut
-validRowBytes(60): false
-validRowBytes(64): true
-validRowBytes(68): true
-##
+ SkImageInfo info = SkImageInfo::MakeN32Premul(16, 8);
+ for (size_t rowBytes = 60; rowBytes < 72; rowBytes += sizeof(SkPMColor)) {
+ SkDebugf("validRowBytes(%llu): %s\n", rowBytes, info.validRowBytes(rowBytes) ?
+ "true" : "false");
+ }
+#StdOut
+validRowBytes(60): false
+validRowBytes(64): true
+validRowBytes(68): true
+##
##
#SeeAlso ByteSizeOverflowed computeByteSize computeMinByteSize
@@ -2225,17 +2318,17 @@ Creates an empty Image_Info with kUnknown_SkColorType, kUnknown_SkAlphaType,
a width and height of zero, and no Color_Space.
#Example
- SkImageInfo info = SkImageInfo::MakeN32Premul(16, 8);
- SkImageInfo copy = info;
- SkDebugf("info %c= copy\n", info == copy ? '=' : '!');
- copy.reset();
- SkDebugf("info %c= reset copy\n", info == copy ? '=' : '!');
- SkDebugf("SkImageInfo() %c= reset copy\n", SkImageInfo() == copy ? '=' : '!');
-#StdOut
-info == copy
-info != reset copy
-SkImageInfo() == reset copy
-##
+ SkImageInfo info = SkImageInfo::MakeN32Premul(16, 8);
+ SkImageInfo copy = info;
+ SkDebugf("info %c= copy\n", info == copy ? '=' : '!');
+ copy.reset();
+ SkDebugf("info %c= reset copy\n", info == copy ? '=' : '!');
+ SkDebugf("SkImageInfo() %c= reset copy\n", SkImageInfo() == copy ? '=' : '!');
+#StdOut
+info == copy
+info != reset copy
+SkImageInfo() == reset copy
+##
##
#SeeAlso SkImageInfo()
@@ -2251,7 +2344,7 @@ SkImageInfo() == reset copy
#Method void validate() const
#In Utility
#Line # asserts if Image_Info is invalid (debug only) ##
-Asserts if internal values are illegal or inconsistent. Only available if
+Asserts if internal values are illegal or inconsistent. Only available if
SK_DEBUG is defined at compile time.
#NoExample
diff --git a/docs/SkImage_Reference.bmh b/docs/SkImage_Reference.bmh
index cd33812263..571dc49996 100644
--- a/docs/SkImage_Reference.bmh
+++ b/docs/SkImage_Reference.bmh
@@ -1,12 +1,6 @@
#Topic Image
#Alias Image_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkImage
Image describes a two dimensional array of pixels to draw. The pixels may be
@@ -47,11 +41,11 @@ Image is drawn. Lazy_Image caches result if possible to speed up repeated
drawing.
##
-#Subtopic Related_Function
+#Subtopic Overview
#Populate
##
-#Subtopic Class_or_Struct
+#Subtopic Related_Function
#Populate
##
@@ -133,7 +127,7 @@ pixels is not nullptr, and contains enough data for Image.
#Image 3
size_t rowBytes = image->width() * SkColorTypeBytesPerPixel(kRGBA_8888_SkColorType);
sk_sp<SkData> data = SkData::MakeUninitialized(rowBytes * image->height());
- SkImageInfo dstInfo = SkImageInfo::MakeN32(image->width(), image->height(),
+ SkImageInfo dstInfo = SkImageInfo::MakeN32(image->width(), image->height(),
kPremul_SkAlphaType);
image->readPixels(dstInfo, data->writable_data(), rowBytes, 0, 0, SkImage::kAllow_CachingHint);
sk_sp<SkImage> raw = SkImage::MakeRasterData(dstInfo.makeColorType(kRGBA_8888_SkColorType),
@@ -149,7 +143,7 @@ pixels is not nullptr, and contains enough data for Image.
# ------------------------------------------------------------------------------
#Typedef void* ReleaseContext
-
+#Line # parameter type for MakeFromRaster ##
Caller data passed to RasterReleaseProc; may be nullptr.
#SeeAlso MakeFromRaster RasterReleaseProc
@@ -157,9 +151,9 @@ Caller data passed to RasterReleaseProc; may be nullptr.
##
#Typedef void (*RasterReleaseProc)(const void* pixels, ReleaseContext)
-
+#Line # parameter type for MakeFromRaster ##
Function called when Image no longer shares pixels. ReleaseContext is
-provided by caller when Image is created, and may be nullptr.
+provided by caller when Image is created, and may be nullptr.
#SeeAlso ReleaseContext MakeFromRaster
@@ -224,7 +218,7 @@ after reset: 1
#Method static sk_sp<SkImage> MakeFromBitmap(const SkBitmap& bitmap)
#In Constructor
#Line # creates Image from Bitmap, sharing or copying pixels ##
-Creates Image from bitmap, sharing or copying bitmap pixels. If the bitmap
+Creates Image from bitmap, sharing or copying bitmap pixels. If the bitmap
is marked immutable, and its pixel memory is shareable, it may be shared
instead of copied.
@@ -315,7 +309,7 @@ The generator returning Picture cannot be shared; std::move transfers ownership
#Method static sk_sp<SkImage> MakeFromEncoded(sk_sp<SkData> encoded, const SkIRect* subset = nullptr)
#In Constructor
#Line # creates Image from encoded data ##
-Creates Image from encoded data.
+Creates Image from encoded data.
subset allows selecting a portion of the full image. Pass nullptr to select the entire image;
otherwise, subset must be contained by image bounds.
@@ -345,7 +339,9 @@ for (int quality : { 100, 50, 10, 1} ) {
# ------------------------------------------------------------------------------
#Typedef void (*TextureReleaseProc)(ReleaseContext releaseContext)
-
+#Line # parameter type for MakeFromTexture ##
+User function called when supplied texture may be deleted.
+#SeeAlso MakeFromTexture
##
#Method static sk_sp<SkImage> MakeFromTexture(GrContext* context,
@@ -466,10 +462,10 @@ for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {
#In Constructor
#Line # creates Image from encoded data, and uploads to GPU ##
-Creates Image from encoded data. Image is uploaded to GPU back-end using context.
+Creates Image from encoded data. Image is uploaded to GPU back-end using context.
Created Image is available to other GPU contexts, and is available across thread
-boundaries. All contexts must be in the same GPU_Share_Group, or otherwise
+boundaries. All contexts must be in the same GPU_Share_Group, or otherwise
share resources.
When Image is no longer referenced, context releases texture memory
@@ -515,10 +511,10 @@ canvas->drawImage(image, 0, 0);
#In Constructor
#Line # creates Image from Pixmap, and uploads to GPU ##
-Creates Image from pixmap. Image is uploaded to GPU back-end using context.
+Creates Image from pixmap. Image is uploaded to GPU back-end using context.
Created Image is available to other GPU contexts, and is available across thread
-boundaries. All contexts must be in the same GPU_Share_Group, or otherwise
+boundaries. All contexts must be in the same GPU_Share_Group, or otherwise
share resources.
When Image is no longer referenced, context releases texture memory
@@ -527,7 +523,7 @@ asynchronously.
Texture created from pixmap is uploaded to match Surface created with
dstColorSpace. Color_Space of Image is determined by pixmap.colorSpace().
-Image is returned referring to GPU back-end if context is not nullptr,
+Image is returned referring to GPU back-end if context is not nullptr,
format of data is recognized and supported, and if context supports moving
resources between contexts. Otherwise, pixmap pixel data is copied and Image
as returned in raster format if possible; nullptr may be returned.
@@ -596,7 +592,7 @@ Recognized formats vary by GPU back-end.
for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {
for (auto alpha : { kOpaque_SkAlphaType, kPremul_SkAlphaType, kUnpremul_SkAlphaType } ) {
sk_sp<SkImage> image = SkImage::MakeFromAdoptedTexture(canvas->getGrContext(),
- backEndTexture, origin,
+ backEndTexture, origin,
kRGBA_8888_SkColorType, alpha);
canvas->drawImage(image, x, y);
x += 160;
@@ -690,7 +686,7 @@ should this be moved to chrome only?
#Bug 7424
#EnumClass BitDepth
-
+#Line # options for MakeFromPicture ##
#Code
enum class BitDepth {
kU8,
@@ -699,10 +695,12 @@ should this be moved to chrome only?
##
#Const kU8 0
+#Line # uses 8-bit unsigned int per Color component ##
Use 8 bits per Color_ARGB component using unsigned integer format.
##
#Const kF16 1
-Use 16 bits per Color_ARGB component using half-precision floating point format.
+#Line # uses 16-bit float per Color component ##
+Use 16 bits per Color_ARGB component using half-precision floating point format.
##
#NoExample
@@ -725,13 +723,13 @@ Creates Image from picture. Returned Image width and height are set by dimension
Image draws picture with matrix and paint, set to bitDepth and colorSpace.
If matrix is nullptr, draws with identity Matrix. If paint is nullptr, draws
-with default Paint. colorSpace may be nullptr.
+with default Paint. colorSpace may be nullptr.
#Param picture stream of drawing commands ##
#Param dimensions width and height ##
#Param matrix Matrix to rotate, scale, translate, and so on; may be nullptr ##
#Param paint Paint to apply transparency, filtering, and so on; may be nullptr ##
-#Param bitDepth 8 bit integer or 16 bit float: per component ##
+#Param bitDepth 8-bit integer or 16-bit float: per component ##
#Param colorSpace range of colors; may be nullptr ##
#Return created Image, or nullptr ##
@@ -891,7 +889,7 @@ Returns IRect { 0, 0, width(), height() }.
}
##
-#SeeAlso dimensions()
+#SeeAlso dimensions()
#Method ##
@@ -899,7 +897,7 @@ Returns IRect { 0, 0, width(), height() }.
#Method uint32_t uniqueID() const
#In Property
-#Line # identifier for Image ##
+#Line # returns identifier for Image ##
Returns value unique to image. Image contents cannot change after Image is
created. Any operation to create a new Image will receive generate a new
unique number.
@@ -1222,7 +1220,7 @@ false and leave pixmap unchanged.
# ------------------------------------------------------------------------------
#Method GrTexture* getTexture() const
-#Deprecated
+#Deprecated
#Method ##
# ------------------------------------------------------------------------------
@@ -1330,7 +1328,7 @@ drawImage(textureImage, "backEndTexture");
#In Property
#Line # returns GPU reference to Image as texture ##
-Retrieves the backend texture. If Image has no backend texture, an invalid
+Retrieves the back-end texture. If Image has no back-end texture, an invalid
object is returned. Call GrBackendTexture::isValid to determine if the result
is valid.
@@ -1372,7 +1370,7 @@ If origin in not nullptr, copies location of content drawn into Image.
# ------------------------------------------------------------------------------
#Enum CachingHint
-
+#Line # options for readPixels and scalePixels ##
#Code
enum CachingHint {
kAllow_CachingHint,
@@ -1382,7 +1380,7 @@ If origin in not nullptr, copies location of content drawn into Image.
CachingHint selects whether Skia may internally cache Bitmaps generated by
decoding Image, or by copying Image from GPU to CPU. The default behavior
-allows caching Bitmaps.
+allows caching Bitmaps.
Choose kDisallow_CachingHint if Image pixels are to be used only once, or
if Image pixels reside in a cache outside of Skia, or to reduce memory pressure.
@@ -1392,10 +1390,10 @@ Image pixels may not be cached if memory requirements are too large or
pixels are not accessible.
#Const kAllow_CachingHint 0
-Allows Skia to internally cache decoded and copied pixels.
+#Line # allows internally caching decoded and copied pixels ##
##
#Const kDisallow_CachingHint 1
-Disallows Skia from internally caching decoded and copied pixels.
+#Line # disallows internally caching decoded and copied pixels ##
##
#NoExample
@@ -1413,7 +1411,7 @@ Disallows Skia from internally caching decoded and copied pixels.
#Line # copies and converts pixels ##
Copies Rect of pixels from Image to dstPixels. Copy starts at offset (srcX, srcY),
-and does not exceed Image (width(), height()).
+and does not exceed Image (width(), 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.
@@ -1432,8 +1430,8 @@ match. If Image Color_Space 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
+false if width() or height() is zero or negative.
+Returns false if
#Formula
abs(srcX) >= Image width()
##
@@ -1487,7 +1485,7 @@ If cachingHint is kDisallow_CachingHint, pixels are not added to the local cache
CachingHint cachingHint = kAllow_CachingHint) const
Copies a Rect of pixels from Image to dst. Copy starts at (srcX, srcY), and
-does not exceed Image (width(), height()).
+does not exceed Image (width(), height()).
dst specifies width, height, Color_Type, Alpha_Type, Color_Space, pixel storage,
and row bytes of destination. dst.rowBytes specifics the gap from one destination
@@ -1504,10 +1502,10 @@ If Image Color_Type is kGray_8_SkColorType, dst.colorSpace must match.
If Image Alpha_Type is kOpaque_SkAlphaType, dst.alphaType must
match. If Image Color_Space is nullptr, dst.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
+false if width() or height() is zero or negative.
+Returns false if
#Formula
abs(srcX) >= Image width()
##
@@ -1619,7 +1617,7 @@ If cachingHint is kDisallow_CachingHint, pixels are not added to the local cache
#Method sk_sp<SkData> encodeToData(SkEncodedImageFormat encodedImageFormat, int quality) const
#In Utility
#Line # returns encoded Image as SkData ##
-Encodes Image pixels, returning result as SkData.
+Encodes Image pixels, returning result as SkData.
Returns nullptr if encoding fails, or if encodedImageFormat is not supported.
@@ -1667,7 +1665,7 @@ Encodes Image pixels, returning result as SkData. Returns existing encoded data
if present; otherwise, Image is encoded with SkEncodedImageFormat::kPNG. Skia
must be built with SK_HAS_PNG_LIBRARY to encode Image.
-Returns nullptr if existing encoded data is missing or invalid, and
+Returns nullptr if existing encoded data is missing or invalid, and
encoding fails.
#Return encoded Image, or nullptr ##
@@ -1995,7 +1993,9 @@ By translating canvas by returned offset, Image appears stationary.
# ------------------------------------------------------------------------------
#Typedef std::function<void(GrBackendTexture)> BackendTextureReleaseProc
-
+#Line # parameter type for MakeBackendTextureFromSkImage ##
+Defines a function take one parameter of type
+GrBackendTexture with no return value.
##
# ------------------------------------------------------------------------------
@@ -2024,10 +2024,10 @@ If Image is not texture backed, returns texture with Image contents.
#Param context GPU_Context ##
#Param image Image used for texture ##
-#Param backendTexture storage for backend texture ##
+#Param backendTexture storage for back-end texture ##
#Param backendTextureReleaseProc storage for clean up function ##
-#Return true if backend texture was created ##
+#Return true if back-end texture was created ##
#Example
#Platform gpu
@@ -2045,7 +2045,7 @@ static sk_sp<SkImage> create_gpu_image(GrContext* grContext) {
}
##
-void draw(SkCanvas* canvas) {
+void draw(SkCanvas* canvas) {
GrContext* grContext = canvas->getGrContext();
if (!grContext) {
return;
@@ -2079,7 +2079,7 @@ void draw(SkCanvas* canvas) {
##
#Const kRO_LegacyBitmapMode 0
-Returned bitmap is read-only and immutable.
+#Line # returned bitmap is read-only and immutable ##
##
#Enum ##
diff --git a/docs/SkMatrix_Reference.bmh b/docs/SkMatrix_Reference.bmh
index ba3cf79a1d..b079cb5632 100644
--- a/docs/SkMatrix_Reference.bmh
+++ b/docs/SkMatrix_Reference.bmh
@@ -2,12 +2,6 @@
#Alias Matrices
#Alias Matrix_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkMatrix
Matrix holds a 3x3 matrix for transforming coordinates. This allows mapping
@@ -19,9 +13,13 @@ so it must be explicitly initialized. setIdentity initializes Matrix
so it has no effect. setTranslate, setScale, setSkew, setRotate, set9 and setAll
initializes all Matrix elements with the corresponding mapping.
-Matrix includes a hidden variable that classifies the type of matrix to
+Matrix includes a hidden variable that classifies the type of matrix to
improve performance. Matrix is not thread safe unless getType is called first.
+#Subtopic Overview
+#Populate
+##
+
#Subtopic Member_Function
#Populate
##
@@ -173,7 +171,7 @@ Sets Matrix to:
# ------------------------------------------------------------------------------
#Enum TypeMask
-
+#Line # bit field for Matrix complexity ##
#Code
enum TypeMask {
kIdentity_Mask = 0,
@@ -188,18 +186,23 @@ Enum of bit fields for mask returned by getType.
Used to identify the complexity of Matrix, to optimize performance.
#Const kIdentity_Mask 0
+#Line # identity Matrix; all bits clear ##
all bits clear if Matrix is identity
##
#Const kTranslate_Mask 1
+#Line # translation Matrix ##
set if Matrix has translation
##
#Const kScale_Mask 2
+#Line # scale Matrix ##
set if Matrix has x or y scale
##
#Const kAffine_Mask 4
+#Line # skew or rotate Matrix ##
set if Matrix skews or rotates
##
#Const kPerspective_Mask 8
+#Line # perspective Matrix ##
set if Matrix has perspective
##
@@ -226,10 +229,10 @@ SkPoint polys[][4] = {{{0, 0}, {0, 1}, {1, 1}, {1, 0}}, {{0, 0}, {0, 1}, {2, 1},
matrix.setPolyToPoly(polys[0], polys[1], 4);
debugster("setPolyToPoly", matrix);
#StdOut
-after reset: kIdentity_Mask
-after postTranslate: kTranslate_Mask
-after postScale: kTranslate_Mask kScale_Mask
-after postScale: kTranslate_Mask kScale_Mask kAffine_Mask
+after reset: kIdentity_Mask
+after postTranslate: kTranslate_Mask
+after postScale: kTranslate_Mask kScale_Mask
+after postScale: kTranslate_Mask kScale_Mask kAffine_Mask
after setPolyToPoly: kTranslate_Mask kScale_Mask kAffine_Mask kPerspective_Mask
##
##
@@ -253,7 +256,7 @@ false positives. For example, when kPerspective_Mask is set, all
other bits are set.
#Return kIdentity_Mask, or combinations of: kTranslate_Mask, kScale_Mask,
- kAffine_Mask, kPerspective_Mask
+ kAffine_Mask, kPerspective_Mask
##
#Example
@@ -492,7 +495,7 @@ Returns true if the matrix contains perspective elements. Matrix form is:
| perspective-x perspective-y perspective-scale |
##
-where perspective-x or perspective-y is non-zero, or perspective-scale is
+where perspective-x or perspective-y is non-zero, or perspective-scale is
not one. All other elements may have any value.
#Return true if Matrix is in most general form ##
@@ -527,7 +530,7 @@ uniform scale.
Returns false if Matrix contains different scales, skewing, perspective, or
degenerate forms that collapse to a line or point.
-Describes that the Matrix makes rendering with and without the matrix are
+Describes that the Matrix makes rendering with and without the matrix are
visually alike; a transformed circle remains a circle. Mathematically, this is
referred to as similarity of a Euclidean_Space, or a similarity transformation.
@@ -555,7 +558,7 @@ with isSimilarity false reveals the pair not visible through the matrix.
{
SkAutoCanvasRestore autoRestore(canvas, true);
canvas->concat(m);
- canvas->drawString(str, 0, 0, p);
+ canvas->drawString(str, 0, 0, p);
}
if (!isSimilarity) {
canvas->drawString(str, 40, below, p);
@@ -576,7 +579,7 @@ with isSimilarity false reveals the pair not visible through the matrix.
#Line # returns if mapped 90 angle remains 90 degrees ##
Returns true if Matrix contains only translation, rotation, reflection, and
scale. Scale may differ along rotated axes.
-Returns false if Matrix skewing, perspective, or degenerate forms that collapse
+Returns false if Matrix skewing, perspective, or degenerate forms that collapse
to a line or point.
Preserves right angles, but not requiring that the arms of the angle
@@ -607,7 +610,7 @@ for (SkScalar sx : { 1, 2 } ) {
preservesRightAngles ? "right" : "");
SkAutoCanvasRestore autoRestore(canvas, true);
canvas->concat(m);
- canvas->drawString(str, 0, pos, p);
+ canvas->drawString(str, 0, pos, p);
pos += 20;
}
}
@@ -639,31 +642,31 @@ Matrix organizes its values in row order. These members correspond to
each value in Matrix.
#Const kMScaleX 0
-horizontal scale factor
+#Line # horizontal scale factor ##
##
#Const kMSkewX 1
-horizontal skew factor
+#Line # horizontal skew factor ##
##
#Const kMTransX 2
-horizontal translation
+#Line # horizontal translation ##
##
#Const kMSkewY 3
-vertical skew factor
+#Line # vertical skew factor ##
##
#Const kMScaleY 4
-vertical scale factor
+#Line # vertical scale factor ##
##
#Const kMTransY 5
-vertical translation
+#Line # vertical translation ##
##
#Const kMPersp0 6
-input x perspective factor
+#Line # input x perspective factor ##
##
#Const kMPersp1 7
-input y perspective factor
+#Line # input y perspective factor ##
##
#Const kMPersp2 8
-perspective bias
+#Line # perspective bias ##
##
#Example
@@ -710,22 +713,22 @@ Affine arrays are in column major order to match the matrix used by
PDF and XPS.
#Const kAScaleX 0
-horizontal scale factor
+#Line # horizontal scale factor ##
##
#Const kASkewY 1
-vertical skew factor
+#Line # vertical skew factor ##
##
#Const kASkewX 2
-horizontal skew factor
+#Line # horizontal skew factor ##
##
#Const kAScaleY 3
-vertical scale factor
+#Line # vertical scale factor ##
##
#Const kATransX 4
-horizontal translation
+#Line # horizontal translation ##
##
#Const kATransY 5
-vertical translation
+#Line # vertical translation ##
##
#NoExample
@@ -943,7 +946,7 @@ matrix.getTranslateY() == 24
#Method SkScalar getPerspX() const
#In Property
#Line # returns input x perspective factor ##
-Returns factor scaling input x relative to input y.
+Returns factor scaling input x relative to input y.
#Return input x perspective factor ##
@@ -975,7 +978,7 @@ Returns factor scaling input x relative to input y.
#In Property
#Line # returns input y perspective factor ##
-Returns factor scaling input y relative to input x.
+Returns factor scaling input y relative to input x.
#Return input y perspective factor ##
@@ -1044,7 +1047,7 @@ after dirty cache: x = 66
# ------------------------------------------------------------------------------
#Subtopic Set
#Populate
-#Line # set one or more matrix values ##
+#Line # sets one or more matrix values ##
##
#Method void set(int index, SkScalar value)
@@ -1082,7 +1085,7 @@ after 2nd skew x mod: x = 66
#Method void setScaleX(SkScalar v)
#In Set
#Line # sets horizontal scale factor ##
-Sets horizontal scale factor.
+Sets horizontal scale factor.
#Param v horizontal scale factor to store ##
@@ -1108,7 +1111,7 @@ canvas->drawString("x scale", 0, 48, paint);
#Method void setScaleY(SkScalar v)
#In Set
#Line # sets vertical scale factor ##
-Sets vertical scale factor.
+Sets vertical scale factor.
#Param v vertical scale factor to store ##
@@ -1134,7 +1137,7 @@ canvas->drawString("y scale", 12, 48, paint);
#Method void setSkewY(SkScalar v)
#In Set
#Line # sets vertical skew factor ##
-Sets vertical skew factor.
+Sets vertical skew factor.
#Param v vertical skew factor to store ##
@@ -1160,7 +1163,7 @@ canvas->drawString("y skew", 12, 48, paint);
#Method void setSkewX(SkScalar v)
#In Set
#Line # sets horizontal skew factor ##
-Sets horizontal skew factor.
+Sets horizontal skew factor.
#Param v horizontal skew factor to store ##
@@ -1352,13 +1355,13 @@ SkMatrix matrix = SkMatrix::MakeRectToRect({0, 0, 1, 1}, {3, 4, 7, 9},
SkMatrix::kFill_ScaleToFit);
SkScalar b[9];
matrix.get9(b);
-SkDebugf("{%g, %g, %g},\n{%g, %g, %g},\n{%g, %g, %g}\n", b[0], b[1], b[2],
+SkDebugf("{%g, %g, %g},\n{%g, %g, %g},\n{%g, %g, %g}\n", b[0], b[1], b[2],
b[3], b[4], b[5], b[6], b[7], b[8]);
#StdOut
{4, 0, 3},
{0, 5, 4},
{0, 0, 1}
-##
+##
##
#SeeAlso set9
@@ -1650,7 +1653,7 @@ Positive degrees rotates clockwise.
#In Set
#Line # sets to rotate and scale about a point ##
-Sets Matrix to rotate by sinValue and cosValue, about a pivot point at (px, py).
+Sets Matrix to rotate by sinValue and cosValue, about a pivot point at (px, py).
The pivot point is unchanged when mapped with Matrix.
Vector (sinValue, cosValue) describes the angle of rotation relative to (0, 1).
@@ -1683,7 +1686,7 @@ Vector length specifies scale.
#Method void setSinCos(SkScalar sinValue, SkScalar cosValue)
-Sets Matrix to rotate by sinValue and cosValue, about a pivot point at (0, 0).
+Sets Matrix to rotate by sinValue and cosValue, about a pivot point at (0, 0).
Vector (sinValue, cosValue) describes the angle of rotation relative to (0, 1).
Vector length specifies scale.
@@ -1901,7 +1904,7 @@ Matrix * T(dx, dy) = | D E F | | 0 1 dy | = | D E D*dx+E*dy+F |
for (int i = 0; i < 2; ++i ) {
SkMatrix matrix;
i == 0 ? matrix.reset(): matrix.setRotate(25, rect.centerX(), 320);
- {
+ {
SkAutoCanvasRestore acr(canvas, true);
canvas->concat(matrix);
paint.setColor(SK_ColorGRAY);
@@ -1940,7 +1943,7 @@ Matrix = | D E F |, S(sx, sy, px, py) = | 0 sy dy |
| G H I | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2043,7 +2046,7 @@ Matrix = | D E F |, R(degrees, px, py) = | s c dy |
| G H I | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2100,7 +2103,7 @@ Matrix = | D E F |, R(degrees, px, py) = | s c 0 |
| G H I | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2153,7 +2156,7 @@ Matrix = | D E F |, K(kx, ky, px, py) = | ky 1 dy |
| G H I | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2324,7 +2327,7 @@ Compare with preTranslate example.
for (int i = 0; i < 2; ++i ) {
SkMatrix matrix;
i == 0 ? matrix.reset(): matrix.setRotate(25, rect.centerX(), 320);
- {
+ {
SkAutoCanvasRestore acr(canvas, true);
canvas->concat(matrix);
paint.setColor(SK_ColorGRAY);
@@ -2340,7 +2343,7 @@ Compare with preTranslate example.
}
##
-#SeeAlso preTranslate setTranslate MakeTrans
+#SeeAlso preTranslate setTranslate MakeTrans
#Method ##
@@ -2363,7 +2366,7 @@ Matrix = | M N O |, S(sx, sy, px, py) = | 0 sy dy |
| P Q R | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2467,7 +2470,7 @@ Matrix = | M N O |, I(divx, divy) = | 0 sy 0 |
| P Q R | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2525,7 +2528,7 @@ Matrix = | M N O |, R(degrees, px, py) = | s c dy |
| P Q R | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2582,7 +2585,7 @@ Matrix = | M N O |, R(degrees, px, py) = | s c 0 |
| P Q R | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2635,7 +2638,7 @@ Matrix = | M N O |, K(kx, ky, px, py) = | ky 1 dy |
| P Q R | | 0 0 1 |
##
-where
+where
#Code
#Literal
@@ -2764,7 +2767,7 @@ canvas->drawBitmap(source, 0, 0);
# ------------------------------------------------------------------------------
#Enum ScaleToFit
-
+#Line # options to map Rects ##
#Code
enum ScaleToFit {
kFill_ScaleToFit,
@@ -2780,21 +2783,25 @@ or may restrict Matrix to square scaling. If restricted, ScaleToFit specifies
how Matrix maps to the side or center of the destination Rect.
#Const kFill_ScaleToFit 0
+#Line # scales in x and y to fill destination Rect ##
Computes Matrix that scales in x and y independently, so that source Rect is
mapped to completely fill destination Rect. The aspect ratio of source Rect
may change.
##
#Const kStart_ScaleToFit 1
+#Line # scales and aligns to left and top ##
Computes Matrix that maintains source Rect aspect ratio, mapping source Rect
width or height to destination Rect. Aligns mapping to left and top edges
of destination Rect.
##
#Const kCenter_ScaleToFit 2
+#Line # scales and aligns to center ##
Computes Matrix that maintains source Rect aspect ratio, mapping source Rect
width or height to destination Rect. Aligns mapping to center of destination
Rect.
##
#Const kEnd_ScaleToFit 3
+#Line # scales and aligns to right and bottom ##
Computes Matrix that maintains source Rect aspect ratio, mapping source Rect
width or height to destination Rect. Aligns mapping to right and bottom
edges of destination Rect.
@@ -2879,7 +2886,7 @@ src: 1, 2, 3, 4 dst: 5, 6, 8, 9 success: true
##
##
-#SeeAlso MakeRectToRect ScaleToFit setPolyToPoly SkRect::isEmpty
+#SeeAlso MakeRectToRect ScaleToFit setPolyToPoly SkRect::isEmpty
##
@@ -2947,7 +2954,7 @@ If count is zero, sets Matrix to identity and returns true.
If count is one, sets Matrix to translate and returns true.
If count is two or more, sets Matrix to map Points if possible; returns false
if Matrix cannot be constructed. If count is four, Matrix may include
-perspective.
+perspective.
#Param src Points to map from ##
#Param dst Points to map to ##
@@ -3091,7 +3098,7 @@ if (matrix.asAffine(affine)) {
SkDebugf("\n");
}
#StdOut
-ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
+ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
##
##
@@ -3140,7 +3147,7 @@ if (matrix.asAffine(affine)) {
matrix.dump();
}
#StdOut
-ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
+ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
[ 2.0000 3.0000 4.0000][ 5.0000 6.0000 7.0000][ 0.0000 0.0000 1.0000]
##
##
@@ -3168,7 +3175,7 @@ Matrix = | D E F |, pt = | y |
| G H I | | 1 |
##
-where
+where
#Code
#Literal
@@ -3227,7 +3234,7 @@ Matrix = | D E F |, pt = | y |
| G H I | | 1 |
##
-where
+where
#Code
#Literal
@@ -3436,7 +3443,7 @@ Matrix = | D E 0 |, src = | y |
| G H I | | 1 |
##
-where
+where
#Code
#Literal
@@ -3497,7 +3504,7 @@ Matrix = | D E 0 |, vec = | y |
| G H I | | 1 |
##
-where
+where
#Code
#Literal
@@ -3711,7 +3718,7 @@ Returned value is the same as calling rectStaysRect.
Maps four corners of rect to dst. Points are mapped by multiplying each
rect corner by Matrix. rect corner is processed in this order:
(rect.fLeft, rect.fTop), (rect.fRight, rect.fTop), (rect.fRight, rect.fBottom),
-(rect.fLeft, rect.fBottom).
+(rect.fLeft, rect.fBottom).
rect may be empty: rect.fLeft may be greater than or equal to rect.fRight;
rect.fTop may be greater than or equal to rect.fBottom.
@@ -4162,7 +4169,7 @@ matrix.getMaxScale() 42
#Method bool SK_WARN_UNUSED_RESULT getMinMaxScales(SkScalar scaleFactors[2]) const
#In Property
#Line # returns minimum and maximum scaling, if possible ##
-Sets scaleFactors[0] to the minimum scaling factor, and scaleFactors[1] to the
+Sets scaleFactors[0] to the minimum scaling factor, and scaleFactors[1] to the
maximum scaling factor. Scaling factors are computed by decomposing
the Matrix scaling and skewing elements.
@@ -4205,7 +4212,7 @@ to determine if Matrix can be decomposed without computing remainder.
Returns true if scale components are found. scale and remaining are
unchanged if Matrix contains perspective; scale factors are not finite, or
-are nearly zero.
+are nearly zero.
On success
@@ -4362,7 +4369,7 @@ canvas->drawBitmap(source, 0, 0);
#Method void dirtyMatrixTypeCache()
#In Utility
#Line # sets internal cache to unknown state ##
-Sets internal cache to unknown state. Use to force update after repeated
+Sets internal cache to unknown state. Use to force update after repeated
modifications to Matrix element reference returned by operator[](int index).
#Example
diff --git a/docs/SkPaint_Reference.bmh b/docs/SkPaint_Reference.bmh
index e07999a434..6fdf2a0e89 100644
--- a/docs/SkPaint_Reference.bmh
+++ b/docs/SkPaint_Reference.bmh
@@ -1,12 +1,6 @@
#Topic Paint
#Alias Paint_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkPaint
Paint controls options applied when drawing and measuring. Paint collects all
@@ -35,6 +29,10 @@ Paint describes a single color, a single font, a single image quality, and so on
Multiple colors are drawn either by using multiple paints or with objects like
Shader attached to Paint.
+#Subtopic Overview
+#Populate
+##
+
#Subtopic Related_Function
#Populate
##
@@ -43,7 +41,7 @@ Shader attached to Paint.
#Populate
##
-#Subtopic Class_or_Struct
+#Subtopic Struct
#Populate
##
@@ -419,6 +417,7 @@ The four levels roughly control corresponding features on platforms that use Fre
as the Font_Engine.
#Const kNo_Hinting 0
+#Line # glyph outlines unchanged ##
Leaves glyph outlines unchanged from their native representation.
With FreeType, this is equivalent to the FT_LOAD_NO_HINTING
bit-field constant supplied to FT_Load_Glyph, which indicates that the vector
@@ -426,6 +425,7 @@ as the Font_Engine.
to 26.6 fractional pixels.
##
#Const kSlight_Hinting 1
+#Line # minimal modification to improve constrast ##
Modifies glyph outlines minimally to improve constrast.
With FreeType, this is equivalent in spirit to the
FT_LOAD_TARGET_LIGHT value supplied to FT_Load_Glyph. It chooses a
@@ -433,12 +433,14 @@ as the Font_Engine.
Generated Glyphs may be fuzzy but better resemble their original shape.
##
#Const kNormal_Hinting 2
+#Line # glyph outlines modified to improve constrast ##
Modifies glyph outlines to improve constrast. This is the default.
With FreeType, this supplies FT_LOAD_TARGET_NORMAL to FT_Load_Glyph,
choosing the default hinting algorithm, which is optimized for standard
gray-level rendering.
##
#Const kFull_Hinting 3
+#Line # modifies glyph outlines for maxiumum constrast ##
Modifies glyph outlines for maxiumum constrast. With FreeType, this selects
FT_LOAD_TARGET_LCD or FT_LOAD_TARGET_LCD_V if kLCDRenderText_Flag is set.
FT_LOAD_TARGET_LCD is a variant of FT_LOAD_TARGET_NORMAL optimized for
@@ -446,15 +448,11 @@ as the Font_Engine.
variant of FT_LOAD_TARGET_NORMAL optimized for vertically decimated LCD displays.
##
-#Track
-#File SkFontHost_mac.cpp:1777,1806
-#Time 2013-03-03 07:16:29 +0000
#Bug 915
On OS_X and iOS, hinting controls whether Core_Graphics dilates the font outlines
to account for LCD text. No hinting uses Core_Text gray scale output.
Normal hinting uses Core_Text LCD output. If kLCDRenderText_Flag is clear,
the LCD output is reduced to a single grayscale channel.
-#Track ##
On Windows with DirectWrite, Hinting has no effect.
@@ -548,34 +546,34 @@ All flags can be read and written explicitly; Flags allows manipulating
multiple settings at once.
#Const kAntiAlias_Flag 0x0001
- mask for setting Anti-alias
+ #Line # mask for setting Anti-alias ##
##
#Const kDither_Flag 0x0004
- mask for setting Dither
+ #Line # mask for setting Dither ##
##
-
#Const kFakeBoldText_Flag 0x0020
- mask for setting Fake_Bold
+ #Line # mask for setting Fake_Bold ##
##
#Const kLinearText_Flag 0x0040
- mask for setting Linear_Text
+ #Line # mask for setting Linear_Text ##
##
#Const kSubpixelText_Flag 0x0080
- mask for setting Subpixel_Text
+ #Line # mask for setting Subpixel_Text ##
##
#Const kLCDRenderText_Flag 0x0200
- mask for setting LCD_Text
+ #Line # mask for setting LCD_Text ##
##
#Const kEmbeddedBitmapText_Flag 0x0400
- mask for setting Font_Embedded_Bitmaps
+ #Line # mask for setting Font_Embedded_Bitmaps ##
##
#Const kAutoHinting_Flag 0x0800
- mask for setting Automatic_Hinting
+ #Line # mask for setting Automatic_Hinting ##
##
#Const kVerticalText_Flag 0x1000
- mask for setting Vertical_Text
+ #Line # mask for setting Vertical_Text ##
##
#Const kAllFlags 0xFFFF
+ #Line # mask of all Flags ##
mask of all Flags, including private flags and flags reserved for future use
##
@@ -652,6 +650,8 @@ All Flags members may be cleared, or one or more may be set.
# ------------------------------------------------------------------------------
#Subtopic Anti-alias
#Alias Anti-alias # permit hyphen in topic name, should probably not substitute hyphen with _
+#Alias Anti-aliased
+#Alias Anti-aliasing
#In Related_Function
#Line # approximating coverage with transparency ##
@@ -1342,7 +1342,7 @@ Skia can translate text character codes as a series of Glyphs, but does not impl
font substitution,
textual substitution, line layout, or contextual spacing like Kerning pairs. Use
a text shaping engine like
-#A HarfBuzz # http://harfbuzz.org/ ##
+#A HarfBuzz # https://harfbuzz.org/ ##
to translate text runs
into glyph series.
@@ -1868,7 +1868,7 @@ Use kStrokeAndFill_Style to avoid hitting the same pixels twice with a stroke dr
a fill draw.
#Const kFill_Style 0
- Set to fill geometry.
+#Line # set to fill geometry ##
Applies to Rect, Region, Round_Rect, Circles, Ovals, Path, and Text.
Bitmap, Image, Patches, Region, Sprites, and Vertices are painted as if
kFill_Style is set, and ignore the set Style.
@@ -1878,7 +1878,7 @@ a fill draw.
##
#Const kStroke_Style 1
- Set to stroke geometry.
+#Line # set to stroke geometry ##
Applies to Rect, Region, Round_Rect, Arcs, Circles, Ovals, Path, and Text.
Arcs, Lines, and points, are always drawn as if kStroke_Style is set,
and ignore the set Style.
@@ -1886,14 +1886,14 @@ a fill draw.
##
#Const kStrokeAndFill_Style 2
- Set to stroke and fill geometry.
+#Line # sets to stroke and fill geometry ##
Applies to Rect, Region, Round_Rect, Circles, Ovals, Path, and Text.
Path is treated as if it is set to SkPath::kWinding_FillType,
and the set Path_Fill_Type is ignored.
##
#Const kStyleCount 3
-The number of different Style values defined.
+#Line # number of different Style values defined ##
May be used to verify that Style is a legal value.
##
@@ -2200,27 +2200,31 @@ Here are some miter limits and the angles that triggers them.
Stroke_Cap draws at the beginning and end of an open Path_Contour.
#Const kButt_Cap 0
+ #Line # no stroke extension ##
Does not extend the stroke past the beginning or the end.
##
#Const kRound_Cap 1
+ #Line # adds circle ##
Adds a circle with a diameter equal to Stroke_Width at the beginning
and end.
##
#Const kSquare_Cap 2
+ #Line # adds square ##
Adds a square with sides equal to Stroke_Width at the beginning
and end. The square sides are parallel to the initial and final direction
of the stroke.
##
#Const kLast_Cap 2
+ #Line # largest Stroke_Cap value ##
Equivalent to the largest value for Stroke_Cap.
##
#Const kDefault_Cap 0
- Equivalent to kButt_Cap.
+ #Line # equivalent to kButt_Cap ##
Stroke_Cap is set to kButt_Cap by default.
##
#Const kCapCount 3
- The number of different Stroke_Cap values defined.
+ #Line # number of different Stroke_Cap values defined ##
May be used to verify that Stroke_Cap is a legal value.
##
#Enum ##
@@ -2362,29 +2366,32 @@ not contain the actual join. For instance, a fill path constructed with round jo
not necessarily include circles at each connected segment.
#Const kMiter_Join 0
+#Line # extends to Miter_Limit ##
Extends the outside corner to the extent allowed by Miter_Limit.
If the extension exceeds Miter_Limit, kBevel_Join is used instead.
##
#Const kRound_Join 1
+#Line # adds circle ##
Adds a circle with a diameter of Stroke_Width at the sharp corner.
##
#Const kBevel_Join 2
+#Line # connects outside edges ##
Connects the outside edges of the sharp corner.
##
#Const kLast_Join 2
- Equivalent to the largest value for Stroke_Join.
+#Line # equivalent to the largest value for Stroke_Join ##
##
#Const kDefault_Join 1
- Equivalent to kMiter_Join.
+#Line # equivalent to kMiter_Join ##
Stroke_Join is set to kMiter_Join by default.
##
#Const kJoinCount 3
- The number of different Stroke_Join values defined.
+#Line # number of different Stroke_Join values defined ##
May be used to verify that Stroke_Join is a legal value.
##
@@ -3466,21 +3473,24 @@ using the metrics returned by the font.
Align defaults to kLeft_Align.
#Const kLeft_Align 0
+#Line # positions glyph by computed font offset ##
Leaves the glyph at the position computed by the font offset by the text position.
##
#Const kCenter_Align 1
+#Line # centers line of glyphs by its width or height ##
Moves the glyph half its width if Flags has kVerticalText_Flag clear, and
half its height if Flags has kVerticalText_Flag set.
##
#Const kRight_Align 2
+#Line # moves lines of glyphs by its width or height ##
Moves the glyph by its width if Flags has kVerticalText_Flag clear,
and by its height if Flags has kVerticalText_Flag set.
##
#Const kAlignCount 3
- The number of different Text_Align values defined.
+#Line # number of different Text_Align values defined ##
##
#Enum ##
@@ -3765,7 +3775,7 @@ Text_Skew_X defaults to 0.
TextEncoding determines whether text specifies character codes and their encoded
size, or glyph indices. Characters are encoded as specified by the
-#A Unicode standard # http://unicode.org/standard/standard.html ##
+#A Unicode standard # https://unicode.org/standard/standard.html ##
.
Character codes encoded size are specified by UTF-8, UTF-16, or UTF-32.
@@ -3778,7 +3788,7 @@ in the total storage required.
#A UTF-16 (RFC 2781) # https://tools.ietf.org/html/rfc2781 ##
encodes each character as one or two 16-bit words.
-#A UTF-32 # http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf ##
+#A UTF-32 # https://www.unicode.org/versions/Unicode5.0.0/ch03.pdf ##
encodes each character as one 32-bit word.
Font_Manager uses font data to convert character code points into glyph indices.
@@ -3787,16 +3797,16 @@ A glyph index is a 16-bit word.
TextEncoding is set to kUTF8_TextEncoding by default.
#Const kUTF8_TextEncoding 0
-Uses bytes to represent UTF-8 or ASCII.
+#Line # uses bytes to represent UTF-8 or ASCII ##
##
#Const kUTF16_TextEncoding 1
-Uses two byte words to represent most of Unicode.
+#Line # uses two byte words to represent most of Unicode ##
##
#Const kUTF32_TextEncoding 2
-Uses four byte words to represent all of Unicode.
+#Line # uses four byte words to represent all of Unicode ##
##
#Const kGlyphID_TextEncoding 3
-Uses two byte words to represent glyph indices.
+#Line # uses two byte words to represent glyph indices ##
##
#Enum ##
@@ -3807,7 +3817,7 @@ Uses two byte words to represent glyph indices.
First line is encoded in UTF-8.
Second line is encoded in UTF-16.
Third line is encoded in UTF-32.
-Fourth line has 16 bit glyph indices.
+Fourth line has 16-bit glyph indices.
##
void draw(SkCanvas* canvas) {
SkPaint paint;
@@ -3987,7 +3997,7 @@ void draw(SkCanvas* canvas) {
are valid, since their value may be zero.
#Enum FontMetricsFlags
-#Line # valid Font_Metrics ##
+ #Line # valid Font_Metrics ##
#Code
enum FontMetricsFlags {
@@ -4003,86 +4013,94 @@ void draw(SkCanvas* canvas) {
Fonts with embedded bitmaps may not have valid underline or strikeout metrics.
#Const kUnderlineThicknessIsValid_Flag 0x0001
- Set if fUnderlineThickness is valid.
+ #Line # set if fUnderlineThickness is valid ##
##
#Const kUnderlinePositionIsValid_Flag 0x0002
- Set if fUnderlinePosition is valid.
+ #Line # set if fUnderlinePosition is valid ##
##
#Const kStrikeoutThicknessIsValid_Flag 0x0004
- Set if fStrikeoutThickness is valid.
+ #Line # set if fStrikeoutThickness is valid ##
##
#Const kStrikeoutPositionIsValid_Flag 0x0008
- Set if fStrikeoutPosition is valid.
+ #Line # set if fStrikeoutPosition is valid ##
##
#Enum ##
#Member uint32_t fFlags
- fFlags is set when underline metrics are valid.
+ #Line # is set to FontMetricsFlags when metrics are valid ##
##
#Member SkScalar fTop
+ #Line # extent above baseline ##
Greatest extent above the baseline for any glyph.
Typically less than zero.
##
#Member SkScalar fAscent
+ #Line # distance to reserve above baseline ##
Recommended distance above the baseline to reserve for a line of text.
Typically less than zero.
##
#Member SkScalar fDescent
+ #Line # distance to reserve below baseline ##
Recommended distance below the baseline to reserve for a line of text.
Typically greater than zero.
##
#Member SkScalar fBottom
+ #Line # extent below baseline ##
Greatest extent below the baseline for any glyph.
Typically greater than zero.
##
#Member SkScalar fLeading
+ #Line # distance to add between lines ##
Recommended distance to add between lines of text.
Typically greater than or equal to zero.
##
#Member SkScalar fAvgCharWidth
+ #Line # average character width ##
Average character width, if it is available.
Zero if no average width is stored in the font.
##
#Member SkScalar fMaxCharWidth
- Maximum character width.
+ #Line # maximum character width ##
##
#Member SkScalar fXMin
- Minimum bounding box x value for all Glyphs.
+ #Line # minimum x ##
+ Minimum bounding box x-value for all Glyphs.
Typically less than zero.
##
#Member SkScalar fXMax
+ #Line # maximum x ##
Maximum bounding box x value for all Glyphs.
Typically greater than zero.
##
#Member SkScalar fXHeight
- Height of a lower-case 'x'.
+ #Line # height of lower-case 'x' ##
May be zero if no lower-case height is stored in the font.
##
#Member SkScalar fCapHeight
- Height of an upper-case letter.
+ #Line # height of an upper-case letter ##
May be zero if no upper-case height is stored in the font.
##
#Member SkScalar fUnderlineThickness
- Underline thickness.
-
+ #Line # underline thickness ##
If the metric is valid, the kUnderlineThicknessIsValid_Flag is set in fFlags.
If kUnderlineThicknessIsValid_Flag is clear, fUnderlineThickness is zero.
##
#Member SkScalar fUnderlinePosition
+ #Line # underline position relative to baseline ##
Position of the top of the underline stroke relative to the baseline.
Typically positive when valid.
@@ -4091,13 +4109,14 @@ void draw(SkCanvas* canvas) {
##
#Member SkScalar fStrikeoutThickness
- Strikeout thickness.
+ #Line # strikeout thickness ##
If the metric is valid, the kStrikeoutThicknessIsValid_Flag is set in fFlags.
If kStrikeoutThicknessIsValid_Flag is clear, fStrikeoutThickness is zero.
##
#Member SkScalar fStrikeoutPosition
+ #Line # strikeout position relative to baseline ##
Position of the bottom of the strikeout stroke relative to the baseline.
Typically negative when valid.
@@ -4106,6 +4125,7 @@ void draw(SkCanvas* canvas) {
##
#Method bool hasUnderlineThickness(SkScalar* thickness) const
+ #Line # returns underline thickness if set ##
If Font_Metrics has a valid underline thickness, return true, and set
thickness to that value. If the underline thickness is not valid,
@@ -4120,6 +4140,7 @@ void draw(SkCanvas* canvas) {
##
#Method bool hasUnderlinePosition(SkScalar* position) const
+ #Line # returns underline position if set ##
If Font_Metrics has a valid underline position, return true, and set
position to that value. If the underline position is not valid,
@@ -4134,6 +4155,7 @@ void draw(SkCanvas* canvas) {
##
#Method bool hasStrikeoutThickness(SkScalar* thickness) const
+ #Line # returns strikeout thickness if set ##
If Font_Metrics has a valid strikeout thickness, return true, and set
thickness to that value. If the underline thickness is not valid,
@@ -4148,6 +4170,7 @@ void draw(SkCanvas* canvas) {
##
#Method bool hasStrikeoutPosition(SkScalar* position) const
+ #Line # returns strikeout position if set ##
If Font_Metrics has a valid strikeout position, return true, and set
position to that value. If the underline position is not valid,
@@ -4985,7 +5008,7 @@ void draw(SkCanvas* canvas) {
To be made private.
##
-Fast_Bounds methods conservatively outset a drawing bounds by additional area
+Fast_Bounds functions conservatively outset a drawing bounds by additional area
Paint may draw to.
#Method bool canComputeFastBounds() const
@@ -5023,15 +5046,14 @@ Paint may draw to.
Rect.
#Private
- e.g.
- if (paint.canComputeFastBounds()) {
- SkRect r, storage;
- path.computeBounds(&r, SkPath::kFast_BoundsType);
- const SkRect& fastR = paint.computeFastBounds(r, &storage);
- if (canvas->quickReject(fastR, ...)) {
- // don't draw the path
- }
+ For example:
+ if (!path.isInverseFillType() && paint.canComputeFastBounds()) {
+ SkRect storage;
+ if (canvas->quickReject(paint.computeFastBounds(path.getBounds(), &storage))) {
+ return; // don't draw the path
+ }
}
+ // draw the path
##
#Param orig geometry modified by Paint when drawn ##
diff --git a/docs/SkPath_Reference.bmh b/docs/SkPath_Reference.bmh
index 8aecf01728..f43bd2b8e1 100644
--- a/docs/SkPath_Reference.bmh
+++ b/docs/SkPath_Reference.bmh
@@ -2,19 +2,13 @@
#Alias Path_Reference
#Alias Paths
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
-Path contains Lines and Curves which can be stroked or filled. Contour is
-composed of a series of connected Lines and Curves. Path may contain zero,
+Path contains Lines and Curves which can be stroked or filled. Contour is
+composed of a series of connected Lines and Curves. Path may contain zero,
one, or more Contours.
Each Line and Curve are described by Verb, Points, and optional Conic_Weight.
Each pair of connected Lines and Curves share common Point; for instance, Path
-containing two connected Lines are described the Verb sequence:
+containing two connected Lines are described the Verb sequence:
SkPath::kMove_Verb, SkPath::kLine_Verb, SkPath::kLine_Verb; and a Point sequence
with three entries, sharing
the middle entry as the end of the first Line and the start of the second Line.
@@ -90,9 +84,9 @@ are required to satisfy Verb_Array. First Verb in Path is always
SkPath::kMove_Verb; each SkPath::kMove_Verb that follows starts a new Contour.
#Example
-#Description
+#Description
Each SkPath::moveTo starts a new Contour, and content after SkPath::close()
-also starts a new Contour. Since SkPath::conicTo is not preceded by
+also starts a new Contour. Since SkPath::conicTo is not preceded by
SkPath::moveTo, the first Point of the third Contour starts at the last Point
of the second Contour.
##
@@ -114,10 +108,10 @@ of the second Contour.
##
If final Verb in Contour is SkPath::kClose_Verb, Line connects Last_Point in
-Contour with first Point. A closed Contour, stroked, draws
+Contour with first Point. A closed Contour, stroked, draws
Paint_Stroke_Join at Last_Point and first Point. Without SkPath::kClose_Verb
as final Verb, Last_Point and first Point are not connected; Contour
-remains open. An open Contour, stroked, draws Paint_Stroke_Cap at
+remains open. An open Contour, stroked, draws Paint_Stroke_Cap at
Last_Point and first Point.
#Example
@@ -169,7 +163,7 @@ makes them visible.
#Subtopic Zero_Length ##
#Subtopic Contour ##
-
+
# ------------------------------------------------------------------------------
#Class SkPath
@@ -189,7 +183,11 @@ outside the geometry. Path also describes the winding rule used to fill
overlapping contours.
Internally, Path lazily computes metrics likes bounds and convexity. Call
-SkPath::updateBoundsCache to make Path thread safe.
+SkPath::updateBoundsCache to make Path thread safe.
+
+#Subtopic Overview
+#Populate
+##
#Subtopic Related_Function
#Populate
@@ -199,7 +197,7 @@ SkPath::updateBoundsCache to make Path thread safe.
#Populate
##
-#Subtopic Class_or_Struct
+#Subtopic Class
#Populate
##
@@ -223,13 +221,13 @@ SkPath::updateBoundsCache to make Path thread safe.
#Code
enum Verb {
- kMove_Verb,
- kLine_Verb,
- kQuad_Verb,
- kConic_Verb,
- kCubic_Verb,
- kClose_Verb,
- kDone_Verb,
+ kMove_Verb,
+ kLine_Verb,
+ kQuad_Verb,
+ kConic_Verb,
+ kCubic_Verb,
+ kClose_Verb,
+ kDone_Verb,
};
##
@@ -237,34 +235,49 @@ Verb instructs Path how to interpret one or more Point and optional Conic_Weight
manage Contour, and terminate Path.
#Const kMove_Verb 0
- Starts new Contour at next Point.
+#Line # starts new Contour at next Point ##
+ Consecutive kMove_Verb are preserved but all but the last kMove_Verb is
+ ignored. kMove_Verb after other Verbs implicitly closes the previous Contour
+ if SkPaint::kFill_Style is set when drawn; otherwise, stroke is drawn open.
+ kMove_Verb as the last Verb is preserved but ignored.
##
#Const kLine_Verb 1
- Adds Line from Last_Point to next Point.
- Line is a straight segment from Point to Point.
+#Line # adds Line from Last_Point to next Point ##
+ Line is a straight segment from Point to Point. Consecutive kLine_Verb
+ extend Contour. kLine_Verb at same position as prior kMove_Verb is
+ preserved, and draws Point if SkPaint::kStroke_Style is set, and
+ SkPaint::Cap is SkPaint::kSquare_Cap or SkPaint::kRound_Cap. kLine_Verb
+ at same position as prior line or curve Verb is preserved but is ignored.
##
#Const kQuad_Verb 2
- Adds Quad from Last_Point, using control Point, and end Point.
+#Line # adds Quad from Last_Point ##
+ Adds Quad from Last_Point, using control Point, and end Point.
Quad is a parabolic section within tangents from Last_Point to control Point,
and control Point to end Point.
##
#Const kConic_Verb 3
+#Line # adds Conic from Last_Point ##
Adds Conic from Last_Point, using control Point, end Point, and Conic_Weight.
- Conic is a elliptical, parabolic, or hyperbolic section within tangents
+ Conic is a elliptical, parabolic, or hyperbolic section within tangents
from Last_Point to control Point, and control Point to end Point, constrained
by Conic_Weight. Conic_Weight less than one is elliptical; equal to one is
parabolic (and identical to Quad); greater than one hyperbolic.
##
#Const kCubic_Verb 4
- Adds Cubic from Last_Point, using two control Points, and end Point.
+#Line # adds Cubic from Last_Point ##
+ Adds Cubic from Last_Point, using two control Points, and end Point.
Cubic is a third-order Bezier_Curve section within tangents from Last_Point
to first control Point, and from second control Point to end Point.
##
#Const kClose_Verb 5
- Closes Contour, connecting Last_Point to kMove_Verb Point.
+#Line # closes Contour ##
+ Closes Contour, connecting Last_Point to kMove_Verb Point. Consecutive
+ kClose_Verb are preserved but only first has an effect. kClose_Verb after
+ kMove_Verb has no effect.
##
#Const kDone_Verb 6
- Terminates Path. Not in Verb_Array, but returned by Path iterator.
+#Line # terminates Path ##
+ Not in Verb_Array, but returned by Path iterator.
##
Each Verb has zero or more Points stored in Path.
@@ -303,7 +316,7 @@ void draw(SkCanvas* canvas) {
}
#StdOut
verb count: 7
-verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConic_Verb
+verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConic_Verb
##
##
@@ -312,7 +325,7 @@ verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConi
# ------------------------------------------------------------------------------
#Subtopic Direction
-#Line # Path contour orientation ##
+#Line # contour orientation, clockwise or counterclockwise ##
#Alias Directions
#Enum Direction
@@ -320,8 +333,8 @@ verbs: kMove_Verb kLine_Verb kQuad_Verb kClose_Verb kMove_Verb kCubic_Verb kConi
#Code
enum Direction {
- kCW_Direction,
- kCCW_Direction,
+ kCW_Direction,
+ kCCW_Direction,
};
##
@@ -333,15 +346,15 @@ Direction also determines how Contour is measured. For instance, dashing
measures along Path to determine where to start and stop stroke; Direction
will change dashed results as it steps clockwise or counterclockwise.
-Closed Contours like Rect, Round_Rect, Circle, and Oval added with
+Closed Contours like Rect, Round_Rect, Circle, and Oval added with
kCW_Direction travel clockwise; the same added with kCCW_Direction
travel counterclockwise.
#Const kCW_Direction 0
- Contour travels in a clockwise direction
+#Line # contour travels clockwise ##
##
#Const kCCW_Direction 1
- Contour travels in a counterclockwise direction
+#Line # contour travels counterclockwise ##
##
@@ -374,7 +387,7 @@ void draw(SkCanvas* canvas) {
}
##
-#SeeAlso arcTo rArcTo isRect isNestedFillRects addRect addOval
+#SeeAlso arcTo rArcTo isRect isNestedFillRects addRect addOval
#Enum Direction ##
#Subtopic Direction ##
@@ -549,7 +562,7 @@ reset one == two
# ------------------------------------------------------------------------------
-#Method bool operator!=(const SkPath& a, const SkPath& b)
+#Method bool operator!=(const SkPath& a, const SkPath& b)
#Line # compares paths for inequality ##
Compares a and b; returns true if Fill_Type, Verb_Array, Point_Array, and Weights
@@ -604,7 +617,7 @@ If Paths contain one or more Conics, the Weights must match.
conicTo may add different Verbs depending on Conic_Weight, so it is not
trivial to interpolate a pair of Paths containing Conics with different
-Conic_Weight values.
+Conic_Weight values.
#Param compare Path to compare ##
@@ -646,17 +659,17 @@ average of this Point_Array and ending Point_Array, using the formula:
##
.
-weight is most useful when between zero (ending Point_Array) and
-one (this Point_Array); will work with values outside of this
+weight is most useful when between zero (ending Point_Array) and
+one (this Point_Array); will work with values outside of this
range.
interpolate() returns false and leaves out unchanged if Point_Array is not
-the same size as ending Point_Array. Call isInterpolatable to check Path
+the same size as ending Point_Array. Call isInterpolatable to check Path
compatibility prior to calling interpolate().
#Param ending Point_Array averaged with this Point_Array ##
-#Param weight contribution of this Point_Array, and
- one minus contribution of ending Point_Array
+#Param weight contribution of this Point_Array, and
+ one minus contribution of ending Point_Array
##
#Param out Path replaced by interpolated averages ##
@@ -690,31 +703,31 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method bool unique() const
+#Method bool unique() const
#Deprecated soon
Only valid for Android framework.
##
# ------------------------------------------------------------------------------
#Subtopic Fill_Type
-#Line # Path fill rule, normal and inverted ##
+#Line # fill rule, normal and inverted ##
#Enum FillType
#Line # sets winding rule and inverse fill ##
#Code
enum FillType {
- kWinding_FillType,
- kEvenOdd_FillType,
- kInverseWinding_FillType,
- kInverseEvenOdd_FillType,
+ kWinding_FillType,
+ kEvenOdd_FillType,
+ kInverseWinding_FillType,
+ kInverseEvenOdd_FillType,
};
##
-Fill_Type selects the rule used to fill Path. Path set to kWinding_FillType
+Fill_Type selects the rule used to fill Path. Path set to kWinding_FillType
fills if the sum of Contour edges is not zero, where clockwise edges add one, and
counterclockwise edges subtract one. Path set to kEvenOdd_FillType fills if the
-number of Contour edges is odd. Each Fill_Type has an inverse variant that
+number of Contour edges is odd. Each Fill_Type has an inverse variant that
reverses the rule:
kInverseWinding_FillType fills where the sum of Contour edges is zero;
kInverseEvenOdd_FillType fills where the number of Contour edges is even.
@@ -738,7 +751,7 @@ void draw(SkCanvas* canvas) {
SkRect clipRect = {0, 0, 51, 100};
canvas->drawPath(path, strokePaint);
SkPaint fillPaint;
- for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,
+ for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,
SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {
canvas->translate(51, 0);
canvas->save();
@@ -751,16 +764,16 @@ void draw(SkCanvas* canvas) {
##
#Const kWinding_FillType 0
-Specifies fill as area is enclosed by a non-zero sum of Contour Directions.
+#Line # is enclosed by a non-zero sum of Contour Directions ##
##
#Const kEvenOdd_FillType 1
-Specifies fill as area enclosed by an odd number of Contours.
+#Line # is enclosed by an odd number of Contours ##
##
#Const kInverseWinding_FillType 2
-Specifies fill as area is enclosed by a zero sum of Contour Directions.
+#Line # is enclosed by a zero sum of Contour Directions ##
##
#Const kInverseEvenOdd_FillType 3
-Specifies fill as area enclosed by an even number of Contours.
+#Line # is enclosed by an even number of Contours ##
##
#Example
@@ -784,7 +797,7 @@ void draw(SkCanvas* canvas) {
canvas->scale(.5f, .5f);
canvas->drawString("inverse", 384, 150, textPaint);
SkPaint fillPaint;
- for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,
+ for (auto fillType : { SkPath::kWinding_FillType, SkPath::kEvenOdd_FillType,
SkPath::kInverseWinding_FillType, SkPath::kInverseEvenOdd_FillType } ) {
canvas->save();
canvas->clipRect(clipRect);
@@ -803,22 +816,22 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method FillType getFillType() const
+#Method FillType getFillType() const
#In Fill_Type
#Line # returns Fill_Type: winding, even-odd, inverse ##
Returns FillType, the rule used to fill Path. FillType of a new Path is
kWinding_FillType.
-#Return one of: kWinding_FillType, kEvenOdd_FillType, kInverseWinding_FillType,
-kInverseEvenOdd_FillType
+#Return one of: kWinding_FillType, kEvenOdd_FillType, kInverseWinding_FillType,
+kInverseEvenOdd_FillType
##
#Example
SkPath path;
SkDebugf("default path fill type is %s\n",
path.getFillType() == SkPath::kWinding_FillType ? "kWinding_FillType" :
- path.getFillType() == SkPath::kEvenOdd_FillType ? "kEvenOdd_FillType" :
+ path.getFillType() == SkPath::kEvenOdd_FillType ? "kEvenOdd_FillType" :
path.getFillType() == SkPath::kInverseWinding_FillType ? "kInverseWinding_FillType" :
"kInverseEvenOdd_FillType");
#StdOut
@@ -832,15 +845,15 @@ default path fill type is kWinding_FillType
# ------------------------------------------------------------------------------
-#Method void setFillType(FillType ft)
+#Method void setFillType(FillType ft)
#In Fill_Type
#Line # sets Fill_Type: winding, even-odd, inverse ##
Sets FillType, the rule used to fill Path. While there is no check
that ft is legal, values outside of FillType are not supported.
-#Param ft one of: kWinding_FillType, kEvenOdd_FillType, kInverseWinding_FillType,
-kInverseEvenOdd_FillType
+#Param ft one of: kWinding_FillType, kEvenOdd_FillType, kInverseWinding_FillType,
+kInverseEvenOdd_FillType
##
#Example
@@ -861,7 +874,7 @@ If empty Path is set to inverse FillType, it fills all pixels.
# ------------------------------------------------------------------------------
-#Method bool isInverseFillType() const
+#Method bool isInverseFillType() const
#In Fill_Type
#Line # returns if Fill_Type fills outside geometry ##
@@ -885,16 +898,16 @@ default path fill type is inverse: false
# ------------------------------------------------------------------------------
-#Method void toggleInverseFillType()
+#Method void toggleInverseFillType()
#In Fill_Type
#Line # toggles Fill_Type between inside and outside geometry ##
Replace FillType with its inverse. The inverse of FillType describes the area
unmodified by the original FillType.
-#Table
+#Table
#Legend
-# FillType # toggled FillType ##
+# FillType # toggled FillType ##
##
# kWinding_FillType # kInverseWinding_FillType ##
# kEvenOdd_FillType # kInverseEvenOdd_FillType ##
@@ -934,37 +947,37 @@ canvas->drawPath(path, paint);
#Code
enum Convexity : uint8_t {
- kUnknown_Convexity,
+ kUnknown_Convexity,
kConvex_Convexity,
- kConcave_Convexity,
+ kConcave_Convexity,
};
##
-Path is convex if it contains one Contour and Contour loops no more than
-360 degrees, and Contour angles all have same Direction. Convex Path
+Path is convex if it contains one Contour and Contour loops no more than
+360 degrees, and Contour angles all have same Direction. Convex Path
may have better performance and require fewer resources on GPU_Surface.
Path is concave when either at least one Direction change is clockwise and
another is counterclockwise, or the sum of the changes in Direction is not 360
degrees.
-Initially Path Convexity is kUnknown_Convexity. Path Convexity is computed
+Initially Path Convexity is kUnknown_Convexity. Path Convexity is computed
if needed by destination Surface.
#Const kUnknown_Convexity 0
- Indicates Convexity has not been determined.
+#Line # indicates Convexity has not been determined ##
##
#Const kConvex_Convexity 1
- Path has one Contour made of a simple geometry without indentations.
+#Line # one Contour made of a simple geometry without indentations ##
##
#Const kConcave_Convexity 2
- Path has more than one Contour, or a geometry with indentations.
+#Line # more than one Contour, or a geometry with indentations ##
##
#Example
void draw(SkCanvas* canvas) {
SkPaint paint;
- SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};
+ SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};
const char* labels[] = { "unknown", "convex", "concave" };
for (SkScalar x : { 40, 100 } ) {
SkPath path;
@@ -981,11 +994,11 @@ void draw(SkCanvas* canvas) {
#Enum Convexity ##
-#Method Convexity getConvexity() const
+#Method Convexity getConvexity() const
#In Convexity
#Line # returns geometry convexity, computing if necessary ##
-Computes Convexity if required, and returns stored value.
+Computes Convexity if required, and returns stored value.
Convexity is computed if stored value is kUnknown_Convexity,
or if Path has been altered since Convexity was computed or set.
@@ -994,7 +1007,7 @@ or if Path has been altered since Convexity was computed or set.
#Example
void draw(SkCanvas* canvas) {
auto debugster = [](const char* prefix, const SkPath& path) -> void {
- SkDebugf("%s path convexity is %s\n", prefix,
+ SkDebugf("%s path convexity is %s\n", prefix,
SkPath::kUnknown_Convexity == path.getConvexity() ? "unknown" :
SkPath::kConvex_Convexity == path.getConvexity() ? "convex" : "concave"); };
SkPath path;
@@ -1014,11 +1027,11 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method Convexity getConvexityOrUnknown() const
+#Method Convexity getConvexityOrUnknown() const
#In Convexity
#Line # returns geometry convexity if known ##
-Returns last computed Convexity, or kUnknown_Convexity if
+Returns last computed Convexity, or kUnknown_Convexity if
Path has been altered since Convexity was computed or set.
#Return stored Convexity ##
@@ -1030,7 +1043,7 @@ that alters the path.
##
void draw(SkCanvas* canvas) {
auto debugster = [](const char* prefix, const SkPath& path) -> void {
- SkDebugf("%s path convexity is %s\n", prefix,
+ SkDebugf("%s path convexity is %s\n", prefix,
SkPath::kUnknown_Convexity == path.getConvexityOrUnknown() ? "unknown" :
SkPath::kConvex_Convexity == path.getConvexityOrUnknown() ? "convex" : "concave"); };
SkPath path;
@@ -1072,10 +1085,10 @@ altered.
#Example
void draw(SkCanvas* canvas) {
auto debugster = [](const char* prefix, const SkPath& path) -> void {
- SkDebugf("%s path convexity is %s\n", prefix,
+ SkDebugf("%s path convexity is %s\n", prefix,
SkPath::kUnknown_Convexity == path.getConvexity() ? "unknown" :
SkPath::kConvex_Convexity == path.getConvexity() ? "convex" : "concave"); };
- SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};
+ SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};
SkPath path;
path.addPoly(quad, SK_ARRAY_COUNT(quad), true);
debugster("initial", path);
@@ -1092,7 +1105,7 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method bool isConvex() const
+#Method bool isConvex() const
#In Convexity
#Line # returns if geometry is convex ##
@@ -1104,12 +1117,12 @@ the path has not been altered, Convexity is not recomputed.
#Example
#Description
-Concave shape is erroneously considered convex after a forced call to
+Concave shape is erroneously considered convex after a forced call to
setConvexity.
##
void draw(SkCanvas* canvas) {
SkPaint paint;
- SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};
+ SkPoint quad[] = {{70, 70}, {20, 20}, {120, 20}, {120, 120}};
for (SkScalar x : { 40, 100 } ) {
SkPath path;
quad[0].fX = x;
@@ -1198,7 +1211,7 @@ void draw(SkCanvas* canvas) {
}
##
-#SeeAlso Round_Rect addRoundRect addRRect
+#SeeAlso Round_Rect addRoundRect addRRect
##
@@ -1234,7 +1247,7 @@ Removes Verb_Array, Point_Array, and Weights, and sets FillType to kWinding_Fill
Internal storage associated with Path is retained.
Use rewind() instead of reset() if Path storage will be reused and performance
-is critical.
+is critical.
#Example
#Description
@@ -1255,11 +1268,11 @@ a newly initialized path.
# ------------------------------------------------------------------------------
-#Method bool isEmpty() const
+#Method bool isEmpty() const
#In Property
#Line # returns if verb count is zero ##
Empty Path may have FillType but has no SkPoint, Verb, or Conic_Weight.
-SkPath() constructs empty Path; reset() and (rewind) make Path empty.
+SkPath() constructs empty Path; reset() and (rewind) make Path empty.
#Return true if the path contains no Verb array ##
@@ -1298,7 +1311,7 @@ after reset path is empty
#In Property
#Line # returns if final Contour forms a loop ##
Contour is closed if Path Verb array was last modified by close(). When stroked,
-closed Contour draws Paint_Stroke_Join instead of Paint_Stroke_Cap at first and last Point.
+closed Contour draws Paint_Stroke_Join instead of Paint_Stroke_Cap at first and last Point.
#Return true if the last Contour ends with a kClose_Verb ##
@@ -1335,7 +1348,7 @@ after close last contour is closed
# ------------------------------------------------------------------------------
-#Method bool isFinite() const
+#Method bool isFinite() const
#In Property
#Line # returns if all Point values are finite ##
Returns true for finite Point array values between negative SK_ScalarMax and
@@ -1370,12 +1383,12 @@ after scale path is not finite
# ------------------------------------------------------------------------------
-#Method bool isVolatile() const
+#Method bool isVolatile() const
#In Property
#In Volatile
#Line # returns if Device should not cache ##
Returns true if the path is volatile; it will not be altered or discarded
-by the caller after it is drawn. Paths by default have volatile set false, allowing
+by the caller after it is drawn. Paths by default have volatile set false, allowing
Surface to attach a cache of data which speeds repeated drawing. If true, Surface
may not speed repeated drawing.
@@ -1399,11 +1412,11 @@ volatile by default is false
#Line # caching attribute ##
##
-#Method void setIsVolatile(bool isVolatile)
+#Method void setIsVolatile(bool isVolatile)
#In Volatile
#Line # sets if Device should not cache ##
Specify whether Path is volatile; whether it will be altered or discarded
-by the caller after it is drawn. Paths by default have volatile set false, allowing
+by the caller after it is drawn. Paths by default have volatile set false, allowing
Device to attach a cache of data which speeds repeated drawing.
Mark temporary paths, discarded or modified after use, as volatile
@@ -1440,12 +1453,12 @@ GPU_Surface Path draws are affected by volatile for some shadows and concave geo
# ------------------------------------------------------------------------------
-#Method static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact)
+#Method static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact)
#In Property
#Line # returns if Line is very small ##
Test if Line between Point pair is degenerate.
Line with no length or that moves a very short distance is degenerate; it is
-treated as a point.
+treated as a point.
exact changes the equality test. If true, returns true only if p1 equals p2.
If false, returns true if p1 equals or nearly equals p2.
@@ -1481,25 +1494,25 @@ line from (100,100) to (100.0001,100.0001) is not degenerate, exactly
#StdOut ##
##
-#SeeAlso IsQuadDegenerate IsCubicDegenerate
+#SeeAlso IsQuadDegenerate IsCubicDegenerate
##
# ------------------------------------------------------------------------------
#Method static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2,
- const SkPoint& p3, bool exact)
+ const SkPoint& p3, bool exact)
#In Property
#Line # returns if Quad is very small ##
Test if Quad is degenerate.
Quad with no length or that moves a very short distance is degenerate; it is
-treated as a point.
+treated as a point.
#Param p1 Quad start point ##
#Param p2 Quad control point ##
#Param p3 Quad end point ##
-#Param exact if true, returns true only if p1, p2, and p3 are equal;
- if false, returns true if p1, p2, and p3 are equal or nearly equal
+#Param exact if true, returns true only if p1, p2, and p3 are equal;
+ if false, returns true if p1, p2, and p3 are equal or nearly equal
##
#Return true if Quad is degenerate; its length is effectively zero ##
@@ -1512,7 +1525,7 @@ the fractional portion of the number can not be represented by the float and is
##
void draw(SkCanvas* canvas) {
auto debugster = [](const SkPath& path, bool exact) -> void {
- SkDebugf("quad (%1.8g,%1.8g), (%1.8g,%1.8g), (%1.8g,%1.8g) is %s" "degenerate, %s\n",
+ SkDebugf("quad (%1.8g,%1.8g), (%1.8g,%1.8g), (%1.8g,%1.8g) is %s" "degenerate, %s\n",
path.getPoint(0).fX, path.getPoint(0).fY, path.getPoint(1).fX,
path.getPoint(1).fY, path.getPoint(2).fX, path.getPoint(2).fY,
SkPath::IsQuadDegenerate(path.getPoint(0), path.getPoint(1), path.getPoint(2), exact) ?
@@ -1535,25 +1548,25 @@ quad (1100,1100), (1100,1100), (1100,1100) is degenerate, exactly
#StdOut ##
##
-#SeeAlso IsLineDegenerate IsCubicDegenerate
+#SeeAlso IsLineDegenerate IsCubicDegenerate
##
# ------------------------------------------------------------------------------
#Method static bool IsCubicDegenerate(const SkPoint& p1, const SkPoint& p2,
- const SkPoint& p3, const SkPoint& p4, bool exact)
+ const SkPoint& p3, const SkPoint& p4, bool exact)
#In Property
#Line # returns if Cubic is very small ##
Test if Cubic is degenerate.
Cubic with no length or that moves a very short distance is degenerate; it is
-treated as a point.
+treated as a point.
#Param p1 Cubic start point ##
#Param p2 Cubic control point 1 ##
#Param p3 Cubic control point 2 ##
#Param p4 Cubic end point ##
-#Param exact if true, returns true only if p1, p2, p3, and p4 are equal;
+#Param exact if true, returns true only if p1, p2, p3, and p4 are equal;
if false, returns true if p1, p2, p3, and p4 are equal or nearly equal
##
@@ -1592,8 +1605,8 @@ void draw(SkCanvas* canvas) {
#In Property
#Line # returns if describes Line ##
Returns true if Path contains only one Line;
-Path_Verb array has two entries: kMove_Verb, kLine_Verb.
-If Path contains one Line and line is not nullptr, line is set to
+Path_Verb array has two entries: kMove_Verb, kLine_Verb.
+If Path contains one Line and line is not nullptr, line is set to
Line start point and Line end point.
Returns false if Path is not one Line; line is unaltered.
@@ -1653,7 +1666,7 @@ getPoint, with Iter, or with RawIter.
#Line # returns Point_Array ##
Returns number of points in Path. Up to max points are copied.
points may be nullptr; then, max must be zero.
-If max is greater than number of points, excess points storage is unaltered.
+If max is greater than number of points, excess points storage is unaltered.
#Param points storage for Path Point array. May be nullptr ##
#Param max maximum to copy; must be greater than or equal to zero ##
@@ -1695,7 +1708,7 @@ just right point count: 3 (0,0) (20,20) (-10,-10)
#In Point_Array
#Line # returns Point_Array length ##
Returns the number of points in Path.
-Point count is initially zero.
+Point count is initially zero.
#Return Path Point array length ##
@@ -1732,7 +1745,7 @@ second move point count: 3
#Line # returns entry from Point_Array ##
Returns Point at index in Point_Array. Valid range for index is
0 to countPoints - 1.
-Returns (0, 0) if index is out of range.
+Returns (0, 0) if index is out of range.
#Param index Point array element selector ##
@@ -1745,7 +1758,7 @@ void draw(SkCanvas* canvas) {
path.offset(-10, -10);
for (int i= 0; i < path.countPoints(); ++i) {
SkDebugf("point %d: (%1.8g,%1.8g)\n", i, path.getPoint(i).fX, path.getPoint(i).fY);
- }
+ }
}
#StdOut
point 0: (-10,-10)
@@ -1769,14 +1782,14 @@ the quantity of kMove_Verb equals the Contour count.
Verb_Array does not include or count kDone_Verb; it is a convenience
returned when iterating through Verb_Array.
-Verb_Array may be read directly from Path with getVerbs, or inspected with Iter,
+Verb_Array may be read directly from Path with getVerbs, or inspected with Iter,
or with RawIter.
#Method int countVerbs() const
#In Verb_Array
#Line # returns Verb_Array length ##
-Returns the number of Verbs: kMove_Verb, kLine_Verb, kQuad_Verb, kConic_Verb,
+Returns the number of Verbs: kMove_Verb, kLine_Verb, kQuad_Verb, kConic_Verb,
kCubic_Verb, and kClose_Verb; added to Path.
#Return length of Verb_Array ##
@@ -1829,10 +1842,10 @@ void draw(SkCanvas* canvas) {
debugster("just right", path, verbs, path.countVerbs());
}
#StdOut
-no verbs verb count: 3
-zero max verb count: 3
-too small verb count: 3 move line
-just right verb count: 3 move line line
+no verbs verb count: 3
+zero max verb count: 3
+too small verb count: 3 move line
+just right verb count: 3 move line line
##
##
@@ -1876,10 +1889,10 @@ path2 bounds = 10, 20, 30, 40
# ------------------------------------------------------------------------------
-#Method const SkRect& getBounds() const
+#Method const SkRect& getBounds() const
#In Property
#Line # returns maximum and minimum of Point_Array ##
-Returns minimum and maximum x and y values of Point_Array.
+Returns minimum and maximum x and y values of Point_Array.
Returns (0, 0, 0, 0) if Path contains no points. Returned bounds width and height may
be larger or smaller than area affected when Path is drawn.
@@ -1895,7 +1908,7 @@ Bounds of rotated Circle includes control Points outside of filled area.
##
auto debugster = [](const char* prefix, const SkPath& path) -> void {
const SkRect& bounds = path.getBounds();
- SkDebugf("%s bounds = %g, %g, %g, %g\n", prefix,
+ SkDebugf("%s bounds = %g, %g, %g, %g\n", prefix,
bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
};
SkPath path;
@@ -1923,7 +1936,7 @@ rotated circle bounds = 14.6447, 9.64466, 85.3553, 80.3553
#Line # rarely called management functions ##
##
-#Method void updateBoundsCache() const
+#Method void updateBoundsCache() const
#In Utility
#Line # refreshes result of getBounds ##
Update internal bounds so that subsequent calls to getBounds are instantaneous.
@@ -1931,7 +1944,7 @@ Unaltered copies of Path may also access cached bounds through getBounds.
For now, identical to calling getBounds and ignoring the returned value.
-Call to prepare Path subsequently drawn from multiple threads,
+Call to prepare Path subsequently drawn from multiple threads,
to avoid a race condition where each draw separately computes the bounds.
#Example
@@ -1968,8 +1981,8 @@ cached avg: 0.182784 ms
#In Property
#Line # returns extent of geometry ##
Returns minimum and maximum x and y values of the lines and curves in Path.
-Returns (0, 0, 0, 0) if Path contains no points.
-Returned bounds width and height may be larger or smaller than area affected
+Returns (0, 0, 0, 0) if Path contains no points.
+Returned bounds width and height may be larger or smaller than area affected
when Path is drawn.
Includes Points associated with kMove_Verb that define empty
@@ -1985,7 +1998,7 @@ and unlike getBounds, does not cache the result.
#Example
auto debugster = [](const char* prefix, const SkPath& path) -> void {
const SkRect& bounds = path.computeTightBounds();
- SkDebugf("%s bounds = %g, %g, %g, %g\n", prefix,
+ SkDebugf("%s bounds = %g, %g, %g, %g\n", prefix,
bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
};
SkPath path;
@@ -2012,7 +2025,7 @@ rotated circle bounds = 25, 20, 75, 70
#Method bool conservativelyContainsRect(const SkRect& rect) const
#In Property
#Line # returns true if Rect may be inside ##
-Returns true if rect is contained by Path.
+Returns true if rect is contained by Path.
May return false when rect is contained by Path.
For now, only returns true if Path has one Contour and is convex.
@@ -2129,7 +2142,7 @@ Adds beginning of Contour at Point (x, y).
##
-#Method void moveTo(const SkPoint& p)
+#Method void moveTo(const SkPoint& p)
Adds beginning of Contour at Point p.
@@ -2139,7 +2152,7 @@ Adds beginning of Contour at Point p.
#Width 128
#Height 128
void draw(SkCanvas* canvas) {
- SkPoint data[][3] = {{{30,40},{60,60},{90,30}}, {{30,120},{60,100},{90,120}},
+ SkPoint data[][3] = {{{30,40},{60,60},{90,30}}, {{30,120},{60,100},{90,120}},
{{60,100},{60,40},{70,30}}, {{60,40},{50,20},{70,30}}};
SkPath path;
for (unsigned i = 0; i < SK_ARRAY_COUNT(data); ++i) {
@@ -2162,7 +2175,7 @@ void draw(SkCanvas* canvas) {
#Line # starts Contour relative to Last_Point ##
Adds beginning of Contour relative to Last_Point.
If Path is empty, starts Contour at (dx, dy).
-Otherwise, start Contour at Last_Point offset by (dx, dy).
+Otherwise, start Contour at Last_Point offset by (dx, dy).
Function name stands for "relative move to".
#Param dx offset from Last_Point x to Contour start x ##
@@ -2198,7 +2211,7 @@ kClose_Verb, Last_Point is set to (0, 0) before adding Line.
lineTo appends kMove_Verb to Verb_Array and (0, 0) to Point_Array, if needed.
lineTo then appends kLine_Verb to Verb_Array and (x, y) to Point_Array.
-
+
#Param x end of added Line in x ##
#Param y end of added Line in y ##
@@ -2233,7 +2246,7 @@ $$$#
# ------------------------------------------------------------------------------
-#Method void lineTo(const SkPoint& p)
+#Method void lineTo(const SkPoint& p)
Adds Line from Last_Point to Point p. If Path is empty, or last Verb is
kClose_Verb, Last_Point is set to (0, 0) before adding Line.
@@ -2291,7 +2304,7 @@ void draw(SkCanvas* canvas) {
x += i * ((i & 2) - 1);
y += i * (((i + 1) & 2) - 1);
path.rLineTo(x, y);
-
+
}
canvas->drawPath(path, paint);
}
@@ -2307,7 +2320,7 @@ void draw(SkCanvas* canvas) {
#Alias Quads
#Alias Quadratic_Bezier
#Alias Quadratic_Beziers
-#Line # Bezier_Curve described by second-order polynomial ##
+#Line # curve described by second-order polynomial ##
Quad describes a quadratic Bezier, a second-order curve identical to a section
of a parabola. Quad begins at a start Point, curves towards a control Point,
@@ -2364,7 +2377,7 @@ void draw(SkCanvas* canvas) {
#In Quad
#Line # appends Quad ##
- Adds Quad from Last_Point towards (x1, y1), to (x2, y2).
+ Adds Quad from Last_Point towards (x1, y1), to (x2, y2).
If Path is empty, or last Verb is kClose_Verb, Last_Point is set to (0, 0)
before adding Quad.
@@ -2399,10 +2412,10 @@ void draw(SkCanvas* canvas) {
##
-#Method void quadTo(const SkPoint& p1, const SkPoint& p2)
+#Method void quadTo(const SkPoint& p1, const SkPoint& p2)
#In Build
#In Quad
- Adds Quad from Last_Point towards Point p1, to Point p2.
+ Adds Quad from Last_Point towards Point p1, to Point p2.
If Path is empty, or last Verb is kClose_Verb, Last_Point is set to (0, 0)
before adding Quad.
@@ -2481,7 +2494,7 @@ void draw(SkCanvas* canvas) {
#Alias Conics
Conic describes a conical section: a piece of an ellipse, or a piece of a
-parabola, or a piece of a hyperbola. Conic begins at a start Point,
+parabola, or a piece of a hyperbola. Conic begins at a start Point,
curves towards a control Point, and then curves to an end Point. The influence
of the control Point is determined by Conic_Weight.
@@ -2494,14 +2507,17 @@ may be inspected with Iter, or with RawIter.
#Line # strength of Conic control Point ##
Weight determines both the strength of the control Point and the type of Conic.
-If Weight is exactly one, then Conic is identical to Quad; it is always a
-parabolic segment.
-
-
+Weight varies from zero to infinity. At zero, Weight causes the control Point to
+have no effect; Conic is identical to a line segment from start Point to end
+point. If Weight is less than one, Conic follows an elliptical arc.
+If Weight is exactly one, then Conic is identical to Quad; Conic follows a
+parabolic arc. If Weight is greater than one, Conic follows a hyperbolic
+arc. If Weight is infinity, Conic is indentical to two line segments, connecting
+start Point to control Point, and control Point to end Point.
#Example
#Description
-When Conic_Weight is one, Quad is added to path; the two are identical.
+When Conic_Weight is one, Quad is added to path; the two are identical.
##
void draw(SkCanvas* canvas) {
const char* verbNames[] = { "move", "line", "quad", "conic", "cubic", "close", "done" };
@@ -2524,17 +2540,17 @@ void draw(SkCanvas* canvas) {
} while (SkPath::kDone_Verb != verb);
}
#StdOut
-move {0, 0},
-quad {0, 0}, {20, 30}, {50, 60},
-done
+move {0, 0},
+quad {0, 0}, {20, 30}, {50, 60},
+done
##
##
If weight is less than one, Conic is an elliptical segment.
-#Example
+#Example
#Description
-A 90 degree circular arc has the weight
+A 90 degree circular arc has the weight
#Formula
1 / sqrt(2)
##
@@ -2561,9 +2577,9 @@ void draw(SkCanvas* canvas) {
} while (SkPath::kDone_Verb != verb);
}
#StdOut
-move {0, 0},
+move {0, 0},
conic {0, 0}, {20, 0}, {20, 20}, weight = 0.707107
-done
+done
##
##
@@ -2593,10 +2609,10 @@ void draw(SkCanvas* canvas) {
} while (SkPath::kDone_Verb != verb);
}
#StdOut
-move {0, 0},
-line {0, 0}, {20, 0},
-line {20, 0}, {20, 20},
-done
+move {0, 0},
+line {0, 0}, {20, 0},
+line {20, 0}, {20, 20},
+done
##
##
@@ -2608,7 +2624,7 @@ done
#In Build
#Line # appends Conic ##
- Adds Conic from Last_Point towards (x1, y1), to (x2, y2), weighted by w.
+ Adds Conic from Last_Point towards (x1, y1), to (x2, y2), weighted by w.
If Path is empty, or last Verb is kClose_Verb, Last_Point is set to (0, 0)
before adding Conic.
@@ -2632,7 +2648,7 @@ done
#Example
#Height 160
#Description
- As weight increases, curve is pulled towards control point.
+ As weight increases, curve is pulled towards control point.
The bottom two curves are elliptical; the next is parabolic; the
top curve is hyperbolic.
##
@@ -2661,10 +2677,10 @@ void draw(SkCanvas* canvas) {
##
-#Method void conicTo(const SkPoint& p1, const SkPoint& p2, SkScalar w)
+#Method void conicTo(const SkPoint& p1, const SkPoint& p2, SkScalar w)
#In Build
#In Conic
- Adds Conic from Last_Point towards Point p1, to Point p2, weighted by w.
+ Adds Conic from Last_Point towards Point p1, to Point p2, weighted by w.
If Path is empty, or last Verb is kClose_Verb, Last_Point is set to (0, 0)
before adding Conic.
@@ -2729,8 +2745,8 @@ void draw(SkCanvas* canvas) {
is kClose_Verb, Last_Point is set to (0, 0) before adding Conic.
Appends kMove_Verb to Verb_Array and (0, 0) to Point_Array,
- if needed.
-
+ if needed.
+
If w is finite and not one, next appends kConic_Verb to Verb_Array,
and w is recorded as Conic_Weight; otherwise, if w is one, appends
kQuad_Verb to Verb_Array; or if w is not finite, appends kLine_Verb
@@ -2776,9 +2792,9 @@ void draw(SkCanvas* canvas) {
#Alias Cubics
#Alias Cubic_Bezier
#Alias Cubic_Beziers
-#Line # Bezier_Curve described by third-order polynomial ##
+#Line # curve described by third-order polynomial ##
-Cubic describes a Bezier_Curve segment described by a third-order polynomial.
+Cubic describes a Bezier_Curve segment described by a third-order polynomial.
Cubic begins at a start Point, curving towards the first control Point;
and curves from the end Point towards the second control Point.
@@ -2854,7 +2870,7 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method void cubicTo(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3)
+#Method void cubicTo(const SkPoint& p1, const SkPoint& p2, const SkPoint& p3)
#In Build
#In Cubic
@@ -2948,7 +2964,7 @@ Conic describes an Arc of some Oval or Circle.
arcTo(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, bool forceMoveTo)
describes Arc as a piece of Oval, beginning at start angle, sweeping clockwise or counterclockwise,
-which may continue Contour or start a new one. This construction is similar to PostScript and
+which may continue Contour or start a new one. This construction is similar to PostScript and
HTML_Canvas arcs. Variation addArc always starts new Contour. Canvas::drawArc draws without
requiring Path.
@@ -2958,14 +2974,14 @@ where (x0, y0) is the last Point added to Path. This construction is similar to
HTML_Canvas arcs.
arcTo(SkScalar rx, SkScalar ry, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep,
- SkScalar x, SkScalar y)
+ SkScalar x, SkScalar y)
describes Arc as part of Oval with radii (rx, ry), beginning at
last Point added to Path and ending at (x, y). More than one Arc satisfies this criteria,
so additional values choose a single solution. This construction is similar to SVG arcs.
conicTo describes Arc of less than 180 degrees as a pair of tangent lines and Conic_Weight.
conicTo can represent any Arc with a sweep less than 180 degrees at any rotation. All arcTo
-constructions are converted to Conic data when added to Path.
+constructions are converted to Conic data when added to Path.
#ToDo allow example to hide source and not be exposed as fiddle since markdown / html can't
do the kind of table shown in the illustration.
@@ -3179,7 +3195,7 @@ void draw(SkCanvas* canvas) {
Append Arc to Path, after appending Line if needed. Arc is implemented by Conic
weighted to describe part of Circle. Arc is contained by tangent from
last Path point (x0, y0) to (x1, y1), and tangent from (x1, y1) to (x2, y2). Arc
-is part of Circle sized to radius, positioned so it touches both tangent lines.
+is part of Circle sized to radius, positioned so it touches both tangent lines.
#ToDo allow example to hide source and not be exposed as fiddle ##
@@ -3316,19 +3332,19 @@ conic (79.2893,20),(200,20),(114.645,105.355) weight 0.382683
##
##
-#SeeAlso conicTo
+#SeeAlso conicTo
##
# ------------------------------------------------------------------------------
-#Method void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius)
+#Method void arcTo(const SkPoint p1, const SkPoint p2, SkScalar radius)
#In Build
#In Arc
Append Arc to Path, after appending Line if needed. Arc is implemented by Conic
weighted to describe part of Circle. Arc is contained by tangent from
last Path point to p1, and tangent from p1 to p2. Arc
-is part of Circle sized to radius, positioned so it touches both tangent lines.
+is part of Circle sized to radius, positioned so it touches both tangent lines.
If last Path Point does not start Arc, arcTo appends connecting Line to Path.
The length of Vector from p1 to p2 does not affect Arc.
@@ -3378,7 +3394,7 @@ line (156,20),(200,20)
##
##
-#SeeAlso conicTo
+#SeeAlso conicTo
##
@@ -3389,8 +3405,8 @@ line (156,20),(200,20)
#Code
enum ArcSize {
- kSmall_ArcSize,
- kLarge_ArcSize,
+ kSmall_ArcSize,
+ kLarge_ArcSize,
};
##
@@ -3398,10 +3414,10 @@ Four Oval parts with radii (rx, ry) start at last Path Point and ends at (x, y).
ArcSize and Direction select one of the four Oval parts.
#Const kSmall_ArcSize 0
-smaller of Arc pair
+#Line # smaller of Arc pair ##
##
#Const kLarge_ArcSize 1
-larger of Arc pair
+#Line # larger of Arc pair ##
##
#Example
@@ -3492,7 +3508,7 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
#Method void arcTo(const SkPoint r, SkScalar xAxisRotate, ArcSize largeArc, Direction sweep,
- const SkPoint xy)
+ const SkPoint xy)
#In Build
#In Arc
@@ -3542,7 +3558,7 @@ void draw(SkCanvas* canvas) {
#In Arc
#Line # appends Arc relative to Last_Point ##
-Append Arc to Path, relative to last Path Point. Arc is implemented by one or
+Append Arc to Path, relative to last Path Point. Arc is implemented by one or
more Conic, weighted to describe part of Oval with radii (rx, ry) rotated by
xAxisRotate degrees. Arc curves from last Path Point (x0, y0) to end Point:
@@ -3599,7 +3615,7 @@ void draw(SkCanvas* canvas) {
Append kClose_Verb to Path. A closed Contour connects the first and last Point
with Line, forming a continuous loop. Open and closed Contour draw the same
with SkPaint::kFill_Style. With SkPaint::kStroke_Style, open Contour draws
-Paint_Stroke_Cap at Contour start and end; closed Contour draws
+Paint_Stroke_Cap at Contour start and end; closed Contour draws
Paint_Stroke_Join at Contour start and end.
close() has no effect if Path is empty or last Path Verb is kClose_Verb.
@@ -3625,13 +3641,13 @@ void draw(SkCanvas* canvas) {
}
##
-#SeeAlso
+#SeeAlso
##
# ------------------------------------------------------------------------------
-#Method static bool IsInverseFillType(FillType fill)
+#Method static bool IsInverseFillType(FillType fill)
#In Property
#Line # returns if Fill_Type represents outside geometry ##
Returns true if fill is inverted and Path with fill represents area outside
@@ -3689,7 +3705,7 @@ IsInverseFillType(kInverseEvenOdd_FillType) == true
# ------------------------------------------------------------------------------
-#Method static FillType ConvertToNonInverseFillType(FillType fill)
+#Method static FillType ConvertToNonInverseFillType(FillType fill)
#In Utility
#Line # returns Fill_Type representing inside geometry ##
Returns equivalent Fill_Type representing Path fill inside its bounds.
@@ -3732,7 +3748,7 @@ void draw(SkCanvas* canvas) {
if (fills[i].fill != (SkPath::FillType) i) {
SkDebugf("fills array order does not match FillType enum order");
break;
- }
+ }
SkDebugf("ConvertToNonInverseFillType(%s) == %s\n", fills[i].name,
fills[(int) SkPath::ConvertToNonInverseFillType(fills[i].fill)].name);
}
@@ -3757,11 +3773,11 @@ ConvertToNonInverseFillType(kInverseEvenOdd_FillType) == kEvenOdd_FillType
#Line # approximates Conic with Quad array ##
Approximates Conic with Quad array. Conic is constructed from start Point p0,
-control Point p1, end Point p2, and weight w.
+control Point p1, end Point p2, and weight w.
Quad array is stored in pts; this storage is supplied by caller.
Maximum Quad count is 2 to the pow2.
-Every third point in array shares last Point of previous Quad and first Point of
-next Quad. Maximum pts storage size is given by:
+Every third point in array shares last Point of previous Quad and first Point of
+next Quad. Maximum pts storage size is given by:
#Formula
(1 + 2 * (1 << pow2)) * sizeof(SkPoint)
##
@@ -3769,7 +3785,7 @@ next Quad. Maximum pts storage size is given by:
Returns Quad count used the approximation, which may be smaller
than the number requested.
-
+
Conic_Weight determines the amount of influence Conic control point has on the curve.
w less than one represents an elliptical section. w greater than one represents
a hyperbolic section. w equal to one represents a parabolic section.
@@ -3849,7 +3865,7 @@ void draw(SkCanvas* canvas) {
SkRect rect;
SkPath::Direction direction;
bool isClosed;
- path.isRect(&rect, &isClosed, &direction) ?
+ path.isRect(&rect, &isClosed, &direction) ?
SkDebugf("%s is rect (%g, %g, %g, %g); is %s" "closed; direction %s\n", prefix,
rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, isClosed ? "" : "not ",
SkPath::kCW_Direction == direction ? "CW" : "CCW") :
@@ -4158,7 +4174,7 @@ void draw(SkCanvas* canvas) {
#Line # adds one Contour containing Circle ##
Add Circle centered at (x, y) of size radius to Path, appending kMove_Verb,
-four kConic_Verb, and kClose_Verb. Circle begins at:
+four kConic_Verb, and kClose_Verb. Circle begins at:
#Formula
(x + radius, y)
##
@@ -4200,8 +4216,8 @@ bounded by oval, from startAngle through sweepAngle. Both startAngle and
sweepAngle are measured in degrees, where zero degrees is aligned with the
positive x-axis, and positive sweeps extends Arc clockwise.
-If sweepAngle <= -360, or sweepAngle >= 360; and startAngle modulo 90 is nearly
-zero, append Oval instead of Arc. Otherwise, sweepAngle values are treated
+If sweepAngle <= -360, or sweepAngle >= 360; and startAngle modulo 90 is nearly
+zero, append Oval instead of Arc. Otherwise, sweepAngle values are treated
modulo 360, and Arc may or may not draw depending on numeric rounding.
#Param oval bounds of ellipse containing Arc ##
@@ -4211,7 +4227,7 @@ modulo 360, and Arc may or may not draw depending on numeric rounding.
#Example
#Description
The middle row of the left and right columns draw differently from the entries
-above and below because sweepAngle is outside of the range of +/-360,
+above and below because sweepAngle is outside of the range of +/-360,
and startAngle modulo 90 is not zero.
##
void draw(SkCanvas* canvas) {
@@ -4308,11 +4324,11 @@ array.
# 7 # y-radius of bottom-left corner ##
#Table ##
-If dir is kCW_Direction, Round_Rect starts at top-left of the lower-left corner
-and winds clockwise. If dir is kCCW_Direction, Round_Rect starts at the
+If dir is kCW_Direction, Round_Rect starts at top-left of the lower-left corner
+and winds clockwise. If dir is kCCW_Direction, Round_Rect starts at the
bottom-left of the upper-left corner and winds counterclockwise.
-If both radii on any side of rect exceed its length, all radii are scaled
+If both radii on any side of rect exceed its length, all radii are scaled
uniformly until the corners fit. If either radius of a corner is less than or
equal to zero, both are treated as zero.
@@ -4424,7 +4440,7 @@ void draw(SkCanvas* canvas) {
}
##
-#SeeAlso addRoundRect SkCanvas::drawRRect
+#SeeAlso addRoundRect SkCanvas::drawRRect
##
@@ -4440,7 +4456,7 @@ pts[count - 1] and pts[0].
If count is zero, append kMove_Verb to path.
Has no effect if count is less than one.
-
+
#Param pts array of Line sharing end and start Point ##
#Param count length of Point array ##
#Param close true to add Line connecting Contour end and start ##
@@ -4476,8 +4492,8 @@ void draw(SkCanvas* canvas) {
#Code
enum AddPathMode {
- kAppend_AddPathMode,
- kExtend_AddPathMode,
+ kAppend_AddPathMode,
+ kExtend_AddPathMode,
};
##
@@ -4485,11 +4501,13 @@ AddPathMode chooses how addPath appends. Adding one Path to another can extend
the last Contour or start a new Contour.
#Const kAppend_AddPathMode
+#Line # appended to destination unaltered ##
Path Verbs, Points, and Conic_Weights are appended to destination unaltered.
Since Path Verb_Array begins with kMove_Verb if src is not empty, this
starts a new Contour.
##
#Const kExtend_AddPathMode
+#Line # add line if prior Contour is not closed ##
If destination is closed or empty, start a new Contour. If destination
is not empty, add Line from Last_Point to added Path first Point. Skip added
Path initial kMove_Verb, then append remining Verbs, Points, and Conic_Weights.
@@ -4534,11 +4552,11 @@ The top right composition is made up of one contour; the other three have two.
#In Build
#Line # adds contents of Path ##
-Append src to Path, offset by (dx, dy).
+Append src to Path, offset by (dx, dy).
If mode is kAppend_AddPathMode, src Verb_Array, Point_Array, and Conic_Weights are
added unaltered. If mode is kExtend_AddPathMode, add Line before appending
-Verbs, Points, and Conic_Weights.
+Verbs, Points, and Conic_Weights.
#Param src Path Verbs, Points, and Conic_Weights to add ##
#Param dx offset added to src Point_Array x coordinates ##
@@ -4567,13 +4585,13 @@ Verbs, Points, and Conic_Weights.
# ------------------------------------------------------------------------------
-#Method void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode)
+#Method void addPath(const SkPath& src, AddPathMode mode = kAppend_AddPathMode)
Append src to Path.
If mode is kAppend_AddPathMode, src Verb_Array, Point_Array, and Conic_Weights are
added unaltered. If mode is kExtend_AddPathMode, add Line before appending
-Verbs, Points, and Conic_Weights.
+Verbs, Points, and Conic_Weights.
#Param src Path Verbs, Points, and Conic_Weights to add ##
#Param mode kAppend_AddPathMode or kExtend_AddPathMode ##
@@ -4604,7 +4622,7 @@ Verbs, Points, and Conic_Weights.
If mode is kAppend_AddPathMode, src Verb_Array, Point_Array, and Conic_Weights are
added unaltered. If mode is kExtend_AddPathMode, add Line before appending
-Verbs, Points, and Conic_Weights.
+Verbs, Points, and Conic_Weights.
#Param src Path Verbs, Points, and Conic_Weights to add ##
#Param matrix transform applied to src ##
@@ -4634,7 +4652,7 @@ Verbs, Points, and Conic_Weights.
#Method void reverseAddPath(const SkPath& src)
#In Build
#Line # adds contents of Path back to front ##
-Append src to Path, from back to front.
+Append src to Path, from back to front.
Reversed src always appends a new Contour to Path.
#Param src Path Verbs, Points, and Conic_Weights to add ##
@@ -4705,7 +4723,7 @@ If dst is nullptr, Path is replaced by offset data.
#Line # modify all points ##
##
-#Method void offset(SkScalar dx, SkScalar dy)
+#Method void offset(SkScalar dx, SkScalar dy)
#In Transform
Offset Point_Array by (dx, dy). Path is replaced by offset data.
@@ -4738,7 +4756,7 @@ Offset Point_Array by (dx, dy). Path is replaced by offset data.
Transform Verb_Array, Point_Array, and weight by matrix.
transform may change Verbs and increase their number.
Transformed Path replaces dst; if dst is nullptr, original data
-is replaced.
+is replaced.
#Param matrix Matrix to apply to Path ##
#Param dst overwritten, transformed copy of Path; may be nullptr ##
@@ -4766,7 +4784,7 @@ is replaced.
# ------------------------------------------------------------------------------
-#Method void transform(const SkMatrix& matrix)
+#Method void transform(const SkMatrix& matrix)
Transform Verb_Array, Point_Array, and weight by matrix.
transform may change Verbs and increase their number.
@@ -4806,7 +4824,7 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
#In Property
#In Last_Point
#Line # returns Last_Point ##
- Returns Last_Point on Path in lastPt. Returns false if Point_Array is empty,
+ Returns Last_Point on Path in lastPt. Returns false if Point_Array is empty,
storing (0, 0) if lastPt is not nullptr.
#Param lastPt storage for final Point in Point_Array; may be nullptr ##
@@ -4825,7 +4843,7 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
SkDebugf("last point: %g, %g\n", last.fX, last.fY);
#StdOut
last point: 35.2786, 52.9772
- ##
+ ##
##
#SeeAlso setLastPt
@@ -4856,7 +4874,7 @@ Last_Point can be read and written directly with getLastPt and setLastPt.
##
-#Method void setLastPt(const SkPoint& p)
+#Method void setLastPt(const SkPoint& p)
Set the last point on the path. If Point_Array is empty, append kMove_Verb to
Verb_Array and append p to Point_Array.
@@ -4904,15 +4922,19 @@ instance, if Path only contains Lines, only the kLine_SegmentMask bit is set.
#Bug 6785
#Const kLine_SegmentMask 1
+#Line # contains one or more Lines ##
Set if Verb_Array contains kLine_Verb.
##
#Const kQuad_SegmentMask 2
+#Line # contains one or more Quads ##
Set if Verb_Array contains kQuad_Verb. Note that conicTo may add a Quad.
##
#Const kConic_SegmentMask 4
+#Line # contains one or more Conics ##
Set if Verb_Array contains kConic_Verb.
##
#Const kCubic_SegmentMask 8
+#Line # contains one or more Cubics ##
Set if Verb_Array contains kCubic_Verb.
##
@@ -4922,9 +4944,9 @@ When conicTo has a weight of one, Quad is added to Path.
##
SkPath path;
path.conicTo(10, 10, 20, 30, 1);
- SkDebugf("Path kConic_SegmentMask is %s\n", path.getSegmentMasks() &
+ SkDebugf("Path kConic_SegmentMask is %s\n", path.getSegmentMasks() &
SkPath::kConic_SegmentMask ? "set" : "clear");
- SkDebugf("Path kQuad_SegmentMask is %s\n", path.getSegmentMasks() &
+ SkDebugf("Path kQuad_SegmentMask is %s\n", path.getSegmentMasks() &
SkPath::kQuad_SegmentMask ? "set" : "clear");
#StdOut
Path kConic_SegmentMask is clear
@@ -4938,7 +4960,7 @@ Path kQuad_SegmentMask is set
# ------------------------------------------------------------------------------
-#Method uint32_t getSegmentMasks() const
+#Method uint32_t getSegmentMasks() const
#In Utility
#In Property
#Line # returns types in Verb_Array ##
@@ -4960,7 +4982,7 @@ for (auto mask : { SkPath::kLine_SegmentMask, SkPath::kQuad_SegmentMask,
SkPath::kConic_SegmentMask, SkPath::kCubic_SegmentMask } ) {
if (mask & path.getSegmentMasks()) {
SkDebugf("mask %s set\n", masks[index]);
- }
+ }
++index;
}
#StdOut
@@ -4978,7 +5000,7 @@ mask quad set
#In Property
#Line # returns if Point is in fill area ##
Returns true if the point (x, y) is contained by Path, taking into
-account FillType.
+account FillType.
#Table
#Legend
@@ -4988,7 +5010,7 @@ account FillType.
# kEvenOdd_FillType # an odd number of Contours. ##
# kInverseWinding_FillType # a zero sum of Contour Directions. ##
# kInverseEvenOdd_FillType # and even number of Contours. ##
-##
+##
#Param x x-coordinate of containment test ##
#Param y y-coordinate of containment test ##
@@ -5107,8 +5129,8 @@ directly compiled as C++ code. Floating point values are written
in hexadecimal to preserve their exact bit pattern. The output reconstructs the
original Path.
-Use instead of dump() when submitting
-#A bug reports against Skia # http://bug.skia.org ##
+Use instead of dump() when submitting
+#A bug reports against Skia # https://bug.skia.org ##
.
#Example
@@ -5202,9 +5224,9 @@ path is equal to copy
#Method size_t readFromMemory(const void* buffer, size_t length)
#In Utility
-#Line # Initializes from buffer ##
+#Line # initializes from buffer ##
Initializes Path from buffer of size length. Returns zero if the buffer is
-data is inconsistent, or the length is too small.
+data is inconsistent, or the length is too small.
Reads Fill_Type, Verb_Array, Point_Array, Conic_Weight, and
additionally reads computed information like Convexity and bounds.
@@ -5233,7 +5255,7 @@ void draw(SkCanvas* canvas) {
SkDebugf("length = %u; returned by readFromMemory = %u\n", largerSize, bytesRead);
}
#StdOut
-length = 32; returned by readFromMemory = 0
+length = 32; returned by readFromMemory = 0
length = 40; returned by readFromMemory = 36
##
##
@@ -5256,7 +5278,7 @@ Empty Paths have a Generation_ID of one.
#In Generation_ID
#Line # returns unique ID ##
-Returns a non-zero, globally unique value. A different value is returned
+Returns a non-zero, globally unique value. A different value is returned
if Verb_Array, Point_Array, or Conic_Weight changes.
Setting Fill_Type does not change Generation_ID.
@@ -5315,7 +5337,7 @@ empty genID = 1
# ------------------------------------------------------------------------------
#Class Iter
-#Line # Path data iterator ##
+#Line # data iterator ##
Iterates through Verb_Array, and associated Point_Array and Conic_Weight.
Provides options to treat open Contours as closed, and to ignore
@@ -5346,7 +5368,7 @@ void draw(SkCanvas* canvas) {
paint.setTextSize(256);
SkPath asterisk, path;
paint.getTextPath("*", 1, 50, 192, &asterisk);
- SkPath::Iter iter(asterisk, true);
+ SkPath::Iter iter(asterisk, true);
SkPoint start[4], pts[4];
iter.next(start); // skip moveTo
iter.next(start); // first quadTo
@@ -5362,7 +5384,7 @@ void draw(SkCanvas* canvas) {
#SeeAlso RawIter
#Method Iter()
-
+#Line # constructs Path iterator ##
Initializes Iter with an empty Path. next() on Iter returns kDone_Verb.
Call setPath to initialize Iter at a later time.
@@ -5429,16 +5451,16 @@ void draw(SkCanvas* canvas) {
}
#StdOut
open:
-kMove_Verb {0, 0},
-kQuad_Verb {0, 0}, {10, 20}, {30, 40},
-kDone_Verb
+kMove_Verb {0, 0},
+kQuad_Verb {0, 0}, {10, 20}, {30, 40},
+kDone_Verb
closed:
-kMove_Verb {0, 0},
-kQuad_Verb {0, 0}, {10, 20}, {30, 40},
-kLine_Verb {30, 40}, {0, 0},
-kClose_Verb {0, 0},
-kDone_Verb
+kMove_Verb {0, 0},
+kQuad_Verb {0, 0}, {10, 20}, {30, 40},
+kLine_Verb {30, 40}, {0, 0},
+kClose_Verb {0, 0},
+kDone_Verb
##
##
@@ -5488,16 +5510,16 @@ void draw(SkCanvas* canvas) {
}
#StdOut
quad open:
-kMove_Verb {0, 0},
-kQuad_Verb {0, 0}, {10, 20}, {30, 40},
-kDone_Verb
+kMove_Verb {0, 0},
+kQuad_Verb {0, 0}, {10, 20}, {30, 40},
+kDone_Verb
conic closed:
-kMove_Verb {0, 0},
+kMove_Verb {0, 0},
kConic_Verb {0, 0}, {1, 2}, {3, 4}, weight = 0.5
-kLine_Verb {3, 4}, {0, 0},
-kClose_Verb {0, 0},
-kDone_Verb
+kLine_Verb {3, 4}, {0, 0},
+kClose_Verb {0, 0},
+kDone_Verb
##
##
@@ -5505,7 +5527,7 @@ kDone_Verb
##
-#Method Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)
+#Method Verb next(SkPoint pts[4], bool doConsumeDegenerates = true, bool exact = false)
Returns next Verb in Verb_Array, and advances Iter.
When Verb_Array is exhausted, returns kDone_Verb.
@@ -5525,7 +5547,7 @@ Conics with zero lengths.
#Return next Verb from Verb_Array ##
#Example
-#Description
+#Description
skip degenerate skips the first in a kMove_Verb pair, the kMove_Verb
followed by the kClose_Verb, the zero length Line and the very small Line.
@@ -5569,32 +5591,32 @@ void draw(SkCanvas* canvas) {
}
#StdOut
skip degenerate:
-kMove_Verb {20, 20},
-kQuad_Verb {20, 20}, {10, 20}, {30, 40},
-kDone_Verb
+kMove_Verb {20, 20},
+kQuad_Verb {20, 20}, {10, 20}, {30, 40},
+kDone_Verb
skip degenerate if exact:
-kMove_Verb {20, 20},
-kQuad_Verb {20, 20}, {10, 20}, {30, 40},
-kMove_Verb {30, 30},
-kLine_Verb {30, 30}, {30.00001, 30},
-kDone_Verb
+kMove_Verb {20, 20},
+kQuad_Verb {20, 20}, {10, 20}, {30, 40},
+kMove_Verb {30, 30},
+kLine_Verb {30, 30}, {30.00001, 30},
+kDone_Verb
skip none:
-kMove_Verb {10, 10},
-kMove_Verb {20, 20},
-kQuad_Verb {20, 20}, {10, 20}, {30, 40},
-kMove_Verb {1, 1},
-kClose_Verb {1, 1},
-kMove_Verb {30, 30},
-kLine_Verb {30, 30}, {30, 30},
-kMove_Verb {30, 30},
-kLine_Verb {30, 30}, {30.00001, 30},
-kDone_Verb
+kMove_Verb {10, 10},
+kMove_Verb {20, 20},
+kQuad_Verb {20, 20}, {10, 20}, {30, 40},
+kMove_Verb {1, 1},
+kClose_Verb {1, 1},
+kMove_Verb {30, 30},
+kLine_Verb {30, 30}, {30, 30},
+kMove_Verb {30, 30},
+kLine_Verb {30, 30}, {30.00001, 30},
+kDone_Verb
##
##
-#SeeAlso Verb IsLineDegenerate IsCubicDegenerate IsQuadDegenerate
+#SeeAlso Verb IsLineDegenerate IsCubicDegenerate IsQuadDegenerate
##
@@ -5611,7 +5633,7 @@ kDone_Verb
void draw(SkCanvas* canvas) {
SkPath path;
path.conicTo(1, 2, 3, 4, .5f);
- SkPath::Iter iter(path, false);
+ SkPath::Iter iter(path, false);
SkPoint p[4];
SkDebugf("first verb is " "%s" "move\n", SkPath::kMove_Verb == iter.next(p) ? "" : "not ");
SkDebugf("next verb is " "%s" "conic\n", SkPath::kConic_Verb == iter.next(p) ? "" : "not ");
@@ -5632,7 +5654,7 @@ conic weight: 0.5
##
#Method bool isCloseLine() const
-
+#Line # returns if Line was generated by kClose_Verb ##
Returns true if last kLine_Verb returned by next() was generated
by kClose_Verb. When true, the end point returned by next() is
also the start point of Contour.
@@ -5648,7 +5670,7 @@ void draw(SkCanvas* canvas) {
path.moveTo(6, 7);
path.conicTo(1, 2, 3, 4, .5f);
path.close();
- SkPath::Iter iter(path, false);
+ SkPath::Iter iter(path, false);
SkPoint p[4];
SkDebugf("1st verb is " "%s" "move\n", SkPath::kMove_Verb == iter.next(p) ? "" : "not ");
SkDebugf("moveTo point: {%g,%g}\n", p[0].fX, p[0].fY);
@@ -5673,7 +5695,7 @@ line generated by close
##
#Method bool isClosedContour() const
-
+#Line # returns if Contour has kClose_Verb ##
Returns true if subsequent calls to next() return kClose_Verb before returning
kMove_Verb. if true, Contour Iter is processing may end with kClose_Verb, or
Iter may have been initialized with force close set to true.
@@ -5685,7 +5707,7 @@ void draw(SkCanvas* canvas) {
for (bool forceClose : { false, true } ) {
SkPath path;
path.conicTo(1, 2, 3, 4, .5f);
- SkPath::Iter iter(path, forceClose);
+ SkPath::Iter iter(path, forceClose);
SkDebugf("without close(), forceClose is %s: isClosedContour returns %s\n",
forceClose ? "true " : "false", iter.isClosedContour() ? "true" : "false");
path.close();
@@ -5709,10 +5731,10 @@ with close(), forceClose is true : isClosedContour returns true
#Class Iter ##
#Class RawIter
-#Line # Path raw data iterator ##
+#Line # raw data iterator ##
Iterates through Verb_Array, and associated Point_Array and Conic_Weight.
-Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
+Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
#Code
class RawIter {
@@ -5727,6 +5749,7 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
##
#Method RawIter()
+ #Line # constructs empty Path iterator ##
Initializes RawIter with an empty Path. next() on RawIter returns kDone_Verb.
Call setPath to initialize SkPath::Iter at a later time.
@@ -5738,6 +5761,7 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
##
#Method RawIter(const SkPath& path)
+ #Line # constructs with Path to iterate over ##
Sets RawIter to return elements of Verb_Array, Point_Array, and Conic_Weight in path.
@@ -5751,6 +5775,7 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
##
#Method void setPath(const SkPath& path)
+ #Line # sets Path to iterate over ##
Sets SkPath::Iter to return elements of Verb_Array, Point_Array, and Conic_Weight in path.
@@ -5761,7 +5786,7 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
##
#Method Verb next(SkPoint pts[4])
-
+ #Line # returns next Verb and associated Points ##
Returns next Verb in Verb_Array, and advances RawIter.
When Verb_Array is exhausted, returns kDone_Verb.
Zero to four Points are stored in pts, depending on the returned Verb.
@@ -5797,14 +5822,14 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
} while (SkPath::kDone_Verb != verb);
}
#StdOut
- kMove_Verb {50, 60},
- kQuad_Verb {50, 60}, {10, 20}, {30, 40},
- kClose_Verb {50, 60},
- kMove_Verb {50, 60},
- kLine_Verb {50, 60}, {30, 30},
+ kMove_Verb {50, 60},
+ kQuad_Verb {50, 60}, {10, 20}, {30, 40},
+ kClose_Verb {50, 60},
+ kMove_Verb {50, 60},
+ kLine_Verb {50, 60}, {30, 30},
kConic_Verb {30, 30}, {1, 2}, {3, 4}, weight = 0.5
- kCubic_Verb {3, 4}, {-1, -2}, {-3, -4}, {-5, -6},
- kDone_Verb
+ kCubic_Verb {3, 4}, {-1, -2}, {-3, -4}, {-5, -6},
+ kDone_Verb
##
##
@@ -5813,7 +5838,7 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
##
#Method Verb peek() const
-
+ #Line # returns next Verb ##
Returns next Verb, but does not advance RawIter.
#Return next Verb from Verb_Array ##
@@ -5845,16 +5870,17 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
##
#Bug 6832
- StdOut isn't really volatile, it just produces the wrong result.
+ StdOut is not really volatile, it just produces the wrong result.
A simple fix changes the output of hairlines and needs to be
investigated to see if the change is correct or not.
- https://skia-review.googlesource.com/c/21340/
+ see change 21340 (abandoned for now)
#SeeAlso next()
##
#Method SkScalar conicWeight() const
+ #Line # returns Conic_Weight ##
Returns Conic_Weight if next() returned kConic_Verb.
@@ -5867,7 +5893,7 @@ Verb_Array, Point_Array, and Conic_Weight are returned unaltered.
void draw(SkCanvas* canvas) {
SkPath path;
path.conicTo(1, 2, 3, 4, .5f);
- SkPath::RawIter iter(path);
+ SkPath::RawIter iter(path);
SkPoint p[4];
SkDebugf("first verb is " "%s" "move\n", SkPath::kMove_Verb == iter.next(p) ? "" : "not ");
SkDebugf("next verb is " "%s" "conic\n", SkPath::kConic_Verb == iter.next(p) ? "" : "not ");
diff --git a/docs/SkPixmap_Reference.bmh b/docs/SkPixmap_Reference.bmh
index 9ad87f0acc..03f2b714aa 100644
--- a/docs/SkPixmap_Reference.bmh
+++ b/docs/SkPixmap_Reference.bmh
@@ -1,15 +1,9 @@
#Topic Pixmap
#Alias Pixmap_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkPixmap
-Pixmap provides a utility to pair SkImageInfo with pixels and row bytes.
+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.
@@ -20,6 +14,10 @@ pixels referenced by Pixmap.
Pixmap does not try to manage the lifetime of the pixel memory. Use Pixel_Ref
to manage pixel memory; Pixel_Ref is safe across threads.
+#Subtopic Overview
+#Populate
+##
+
#Subtopic Related_Function
#Populate
##
@@ -75,7 +73,7 @@ width: 25 height: 35 color: kRGBA_8888_SkColorType alpha: kOpaque_SkAlphaType
# ------------------------------------------------------------------------------
#Method SkPixmap(const SkImageInfo& info, const void* addr, size_t rowBytes)
-
+
#In Initialization
#Line # constructs from Image_Info, pixels ##
Creates Pixmap from info width, height, SkAlphaType, and SkColorType.
@@ -83,7 +81,7 @@ 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.
+addr and rowBytes agree with info.
The memory lifetime of pixels is managed by the caller. When Pixmap goes
out of scope, addr is unaffected.
@@ -100,7 +98,7 @@ storage.
#Example
#Image 3
#Description
-SkImage::MakeRasterCopy takes const SkPixmap& as an argument. The example
+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");
@@ -125,7 +123,7 @@ copy alpha only = true
#In Initialization
#Line # reuses existing Pixmap with replacement values ##
-Sets width, height, row bytes to zero; pixel address to nullptr; SkColorType to
+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
@@ -161,12 +159,12 @@ width: 0 height: 0 color: kUnknown_SkColorType alpha: kUnknown_SkAlphaType
#In Initialization
Sets width, height, SkAlphaType, and SkColorType from info.
-Sets pixel address from addr, which may be nullptr.
+Sets pixel address from addr, which may be nullptr.
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.
+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.
@@ -186,7 +184,7 @@ void draw(SkCanvas* canvas) {
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,
+ pixmap.reset(SkImageInfo::Make(image->width(), image->height(), colorType,
image->alphaType()), (const void*) &pixels.front(), image->width() * 4);
SkBitmap bitmap;
bitmap.installPixels(pixmap);
@@ -218,9 +216,9 @@ 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 ");
+ SkDebugf("is %sunique\n", colorSpace1->unique() ? "" : "not ");
pixmap.setColorSpace(colorSpace1);
- SkDebugf("is %sunique\n", colorSpace1->unique() ? "" : "not ");
+ SkDebugf("is %sunique\n", colorSpace1->unique() ? "" : "not ");
}
#StdOut
is unique
@@ -246,7 +244,7 @@ is not unique
#Line # sets pointer to portion of original ##
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.
+and return false.
Failing to read the return value generates a compile time warning.
@@ -284,7 +282,7 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method const SkImageInfo& info() const
+#Method const SkImageInfo& info() const
#In Image_Info_Access
#Line # returns Image_Info ##
@@ -319,12 +317,12 @@ width: 384 height: 384 color: BGRA_8888 alpha: Opaque
# ------------------------------------------------------------------------------
-#Method size_t rowBytes() const
+#Method size_t rowBytes() const
#In Image_Info_Access
#Line # returns interval between rows in bytes ##
Returns row bytes, the interval from one pixel row to the next. Row bytes
-is at least as large as:
+is at least as large as:
#Formula
width() * info().bytesPerPixel()
##
@@ -339,7 +337,7 @@ It is up to the Bitmap creator to ensure that row bytes is a useful value.
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(),
+ SkDebugf("rowBytes: %d minRowBytes: %d\n", pixmap.rowBytes(),
pixmap.info().minRowBytes());
}
#StdOut
@@ -354,7 +352,7 @@ rowBytes: 8 minRowBytes: 4
# ------------------------------------------------------------------------------
-#Method const void* addr() const
+#Method const void* addr() const
#In Image_Info_Access
#Line # returns readable pixel address as void pointer ##
@@ -389,7 +387,7 @@ inset address: 0x7f2a440fb210
# ------------------------------------------------------------------------------
-#Method int width() const
+#Method int width() const
#In Image_Info_Access
#Line # returns pixel column count ##
@@ -398,7 +396,7 @@ Returns pixel count in each pixel row. Should be equal or less than:
#Formula
rowBytes() / info().bytesPerPixel()
##
-.
+.
#Return pixel width in Image_Info ##
@@ -417,7 +415,7 @@ pixmap width: 16 info width: 16
# ------------------------------------------------------------------------------
-#Method int height() const
+#Method int height() const
#In Image_Info_Access
#Line # returns pixel row count ##
@@ -439,7 +437,7 @@ pixmap height: 32 info height: 32
# ------------------------------------------------------------------------------
-#Method SkColorType colorType() const
+#Method SkColorType colorType() const
#In Image_Info_Access
#Line # returns Image_Info Color_Type ##
@@ -463,7 +461,7 @@ color type: kAlpha_8_SkColorType
# ------------------------------------------------------------------------------
-#Method SkAlphaType alphaType() const
+#Method SkAlphaType alphaType() const
#In Image_Info_Access
#Line # returns Image_Info Alpha_Type ##
@@ -486,7 +484,7 @@ alpha type: kPremul_SkAlphaType
# ------------------------------------------------------------------------------
-#Method SkColorSpace* colorSpace() const
+#Method SkColorSpace* colorSpace() const
#In Image_Info_Access
#Line # returns Image_Info Color_Space ##
@@ -501,7 +499,7 @@ immutable.
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,
+ SkPixmap pixmap(SkImageInfo::MakeN32(16, 32, kPremul_SkAlphaType,
SkColorSpace::MakeSRGBLinear()), nullptr, 64);
SkColorSpace* colorSpace = pixmap.colorSpace();
SkDebugf("gammaCloseToSRGB: %s gammaIsLinear: %s isSRGB: %s\n",
@@ -519,7 +517,7 @@ gammaCloseToSRGB: false gammaIsLinear: true isSRGB: false
# ------------------------------------------------------------------------------
-#Method bool isOpaque() const
+#Method bool isOpaque() const
#In Image_Info_Access
#Line # returns true if Image_Info describes opaque pixels ##
@@ -561,7 +559,7 @@ isOpaque: true
# ------------------------------------------------------------------------------
-#Method SkIRect bounds() const
+#Method SkIRect bounds() const
#In Image_Info_Access
#Line # returns width and height as Rectangle ##
@@ -585,13 +583,13 @@ width: 2 height: 2 empty: false
##
##
-#SeeAlso height() width() IRect
+#SeeAlso height() width() IRect
##
# ------------------------------------------------------------------------------
-#Method int rowBytesAsPixels() const
+#Method int rowBytesAsPixels() const
#In Image_Info_Access
#Line # returns interval between rows in pixels ##
@@ -621,7 +619,7 @@ rowBytes: 8 rowBytesAsPixels: 2
# ------------------------------------------------------------------------------
-#Method int shiftPerPixel() const
+#Method int shiftPerPixel() const
#In Image_Info_Access
#Line # returns bit shift from pixels to bytes ##
@@ -635,7 +633,7 @@ Returns zero for kUnknown_SkColorType.
"BGRA_8888", "RGBA_1010102", "RGB_101010x", "Gray_8", "RGBA_F16"};
SkImageInfo info = SkImageInfo::MakeA8(1, 1);
for (SkColorType colorType : { kUnknown_SkColorType, kAlpha_8_SkColorType,
- kRGB_565_SkColorType, kARGB_4444_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);
@@ -723,7 +721,7 @@ For Color_Type kARGB_4444_SkColorType: returns true if all pixel Alpha values ar
For kRGBA_F16_SkColorType: returns true if all pixel Alpha values are 1.0 or
greater.
-Returns false for kUnknown_SkColorType.
+Returns false for kUnknown_SkColorType.
#Return true if all pixels have opaque values or Color_Type is opaque ##
@@ -769,7 +767,7 @@ 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
+conversion to Unpremultiplied Color; original pixel data may have additional
precision.
#Param x column index, zero or greater, and less than width() ##
@@ -801,15 +799,15 @@ precision.
}
#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
+(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
+(0, 0) 0x00000000 0x2a5500ff 0x55a800ff 0x7fff00ff
+(0, 1) 0x2a0055ff 0x555454ff 0x7fa954ff 0xaaff54ff
+(0, 2) 0x5500a8ff 0x7f54a9ff 0xaaaaaaff 0xd4ffaaff
+(0, 3) 0x7f00ffff 0xaa54ffff 0xd4aaffff 0xffffffff
##
##
@@ -832,7 +830,7 @@ Returns readable pixel address at (x, y). Returns nullptr if Pixel_Ref is nullpt
Input is not validated: out of bounds values of x or y trigger an assert() if
built with SK_DEBUG defined. Returns nullptr if Color_Type is kUnknown_SkColorType.
-Performs a lookup of pixel size; for better performance, call
+Performs a lookup of pixel size; for better performance, call
one of: addr8, addr16, addr32, addr64, or addrF16.
#Param x column index, zero or greater, and less than width() ##
@@ -859,7 +857,7 @@ pixmap.addr(1, 2) == &storage[1 + 2 * w]
# ------------------------------------------------------------------------------
-#Method const uint8_t* addr8() const
+#Method const uint8_t* addr8() const
#In Readable_Address
#Line # returns readable pixel address as 8-bit pointer ##
@@ -890,7 +888,7 @@ pixmap.addr8() == storage
# ------------------------------------------------------------------------------
-#Method const uint16_t* addr16() const
+#Method const uint16_t* addr16() const
#In Readable_Address
#Line # returns readable pixel address as 16-bit pointer ##
@@ -921,7 +919,7 @@ pixmap.addr16() == storage
# ------------------------------------------------------------------------------
-#Method const uint32_t* addr32() const
+#Method const uint32_t* addr32() const
#In Readable_Address
#Line # returns readable pixel address as 32-bit pointer ##
@@ -952,7 +950,7 @@ pixmap.addr32() == storage
# ------------------------------------------------------------------------------
-#Method const uint64_t* addr64() const
+#Method const uint64_t* addr64() const
#In Readable_Address
#Line # returns readable pixel address as 64-bit pointer ##
@@ -983,7 +981,7 @@ pixmap.addr64() == storage
# ------------------------------------------------------------------------------
-#Method const uint16_t* addrF16() const
+#Method const uint16_t* addrF16() const
#In Readable_Address
#Line # returns readable pixel component address as 16-bit pointer ##
@@ -1015,7 +1013,7 @@ pixmap.addrF16() == storage
# ------------------------------------------------------------------------------
-#Method const uint8_t* addr8(int x, int y) const
+#Method const uint8_t* addr8(int x, int y) const
#In Readable_Address
Returns readable pixel address at (x, y).
@@ -1050,7 +1048,7 @@ pixmap.addr8(1, 2) == &storage[1 + 2 * w]
# ------------------------------------------------------------------------------
-#Method const uint16_t* addr16(int x, int y) const
+#Method const uint16_t* addr16(int x, int y) const
#In Readable_Address
Returns readable pixel address at (x, y).
@@ -1085,7 +1083,7 @@ pixmap.addr16(1, 2) == &storage[1 + 2 * w]
# ------------------------------------------------------------------------------
-#Method const uint32_t* addr32(int x, int y) const
+#Method const uint32_t* addr32(int x, int y) const
#In Readable_Address
Returns readable pixel address at (x, y).
@@ -1120,7 +1118,7 @@ pixmap.addr32(1, 2) == &storage[1 + 2 * w]
# ------------------------------------------------------------------------------
-#Method const uint64_t* addr64(int x, int y) const
+#Method const uint64_t* addr64(int x, int y) const
#In Readable_Address
Returns readable pixel address at (x, y).
@@ -1155,7 +1153,7 @@ pixmap.addr64(1, 2) == &storage[1 + 2 * w]
# ------------------------------------------------------------------------------
-#Method const uint16_t* addrF16(int x, int y) const
+#Method const uint16_t* addrF16(int x, int y) const
#In Readable_Address
Returns readable pixel address at (x, y).
@@ -1200,7 +1198,7 @@ pixmap.addrF16(1, 2) == &storage[1 * wordsPerPixel + 2 * rowWords]
# ------------------------------------------------------------------------------
-#Method void* writable_addr() const
+#Method void* writable_addr() const
#In Writable_Address
#Line # returns writable pixel address as void pointer ##
@@ -1234,7 +1232,7 @@ pixmap.getColor(0, 0) == 0xFFFFFFFF
# ------------------------------------------------------------------------------
-#Method void* writable_addr(int x, int y) const
+#Method void* writable_addr(int x, int y) const
#In Writable_Address
Returns writable pixel address at (x, y).
@@ -1273,7 +1271,7 @@ pixmap.getColor(1, 2) == 0xFFFFFFFF
# ------------------------------------------------------------------------------
-#Method uint8_t* writable_addr8(int x, int y) const
+#Method uint8_t* writable_addr8(int x, int y) const
#In Writable_Address
#Line # returns writable pixel address as 8-bit pointer ##
@@ -1319,7 +1317,7 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method uint16_t* writable_addr16(int x, int y) const
+#Method uint16_t* writable_addr16(int x, int y) const
#In Writable_Address
#Line # returns writable pixel address as 16-bit pointer ##
@@ -1362,7 +1360,7 @@ The low nibble of the 16-bit word is Alpha.
# ------------------------------------------------------------------------------
-#Method uint32_t* writable_addr32(int x, int y) const
+#Method uint32_t* writable_addr32(int x, int y) const
#In Writable_Address
#Line # returns writable pixel address as 32-bit pointer ##
@@ -1389,7 +1387,7 @@ One word corresponds to one pixel.
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),
+ SkTSwap(*pixmap.writable_addr32(x, y),
*pixmap.writable_addr32(pixmap.width() - x, pixmap.height() - y));
}
}
@@ -1405,7 +1403,7 @@ One word corresponds to one pixel.
# ------------------------------------------------------------------------------
-#Method uint64_t* writable_addr64(int x, int y) const
+#Method uint64_t* writable_addr64(int x, int y) const
#In Writable_Address
#Line # returns writable pixel address as 64-bit pointer ##
@@ -1442,7 +1440,7 @@ One word corresponds to one pixel.
# ------------------------------------------------------------------------------
-#Method uint16_t* writable_addrF16(int x, int y) const
+#Method uint16_t* writable_addrF16(int x, int y) const
#In Writable_Address
#Line # returns writable pixel component address as 16-bit pointer ##
@@ -1462,7 +1460,7 @@ Four words correspond to one pixel.
#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.
+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];
@@ -1502,9 +1500,9 @@ is drawn after overwriting bottom half float color with top half float color.
#Line # copies and converts pixels ##
Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not
-exceed Pixmap (width(), height()).
+exceed Pixmap (width(), 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.
@@ -1515,7 +1513,7 @@ If Pixmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match.
If Pixmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must
match. If Pixmap 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:
@@ -1539,7 +1537,7 @@ pixels are treated as if they are linear, regardless of how they are encoded.
#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
+ SkTransferFunctionBehavior::kIgnore
##
#Return true if pixels are copied to dstPixels ##
@@ -1578,13 +1576,13 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const
+#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes) const
#In Pixels
Copies a Rect of pixels to dstPixels. Copy starts at (0, 0), and does not
exceed Pixmap (width(), 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.
@@ -1642,12 +1640,12 @@ creates visible banding.
# ------------------------------------------------------------------------------
#Method bool readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX,
- int srcY) const
+ int srcY) const
Copies a Rect of pixels to dstPixels. Copy starts at (srcX, srcY), and does not
exceed Pixmap (width(), 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.
@@ -1658,7 +1656,7 @@ If Pixmap colorType is kGray_8_SkColorType, dstInfo.colorSpace must match.
If Pixmap alphaType is kOpaque_SkAlphaType, dstInfo.alphaType must
match. If Pixmap 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 Pixmap width() or height() is zero or negative. Returns false if:
@@ -1707,7 +1705,7 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method bool readPixels(const SkPixmap& dst, int srcX, int srcY) const
+#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 Pixmap (width(), height()). dst specifies width, height, Color_Type,
@@ -1721,7 +1719,7 @@ If Pixmap colorType is kGray_8_SkColorType, dst.info().colorSpace must match.
If Pixmap alphaType is kOpaque_SkAlphaType, dst.info().alphaType must
match. If Pixmap 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 Pixmap width() or height() is zero or negative. Returns false if:
@@ -1768,7 +1766,7 @@ void draw(SkCanvas* canvas) {
# ------------------------------------------------------------------------------
-#Method bool readPixels(const SkPixmap& dst) const
+#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.
@@ -1781,7 +1779,7 @@ If Pixmap colorType is kGray_8_SkColorType, dst Color_Space must match.
If Pixmap alphaType is kOpaque_SkAlphaType, dst Alpha_Type must
match. If Pixmap colorSpace is nullptr, dst Color_Space must match. Returns
false if pixel conversion is not possible.
-
+
Returns false if Pixmap width() or height() is zero or negative.
#Param dst Image_Info and pixel address to write to ##
@@ -1842,7 +1840,7 @@ 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,
+#Param filterQuality one of: kNone_SkFilterQuality, kLow_SkFilterQuality,
kMedium_SkFilterQuality, kHigh_SkFilterQuality
##
@@ -1885,7 +1883,7 @@ void draw(SkCanvas* canvas) {
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 ##
@@ -1910,7 +1908,7 @@ not intersect bounds().
# ------------------------------------------------------------------------------
-#Method bool erase(SkColor color) const
+#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()
diff --git a/docs/SkPoint_Reference.bmh b/docs/SkPoint_Reference.bmh
index ff7710e781..0f98f19326 100644
--- a/docs/SkPoint_Reference.bmh
+++ b/docs/SkPoint_Reference.bmh
@@ -2,15 +2,13 @@
#Alias Points
#Alias Point_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Struct SkPoint
-SkPoint holds two 32 bit floating point coordinates.
+SkPoint holds two 32-bit floating point coordinates.
+
+#Subtopic Overview
+#Populate
+##
#Subtopic Related_Function
#Populate
@@ -174,9 +172,9 @@ pt1 == pt2
#Line # sets to integer input ##
Sets fX to x and fY to y, promoting integers to SkScalar values.
-Assigning a large integer value directly to fX or fY may cause a compiler
+Assigning a large integer value directly to fX or fY may cause a compiler
error, triggered by narrowing conversion of int to SkScalar. This safely
-casts x and y to avoid the error.
+casts x and y to avoid the error.
#Param x new value for fX ##
#Param y new value for fY ##
@@ -199,7 +197,7 @@ Sets fX to p.fX and fY to p.fY, promoting integers to SkScalar values.
Assigning an IPoint containing a large integer value directly to fX or fY may
cause a compiler error, triggered by narrowing conversion of int to SkScalar.
-This safely casts p.fX and p.fY to avoid the error.
+This safely casts p.fX and p.fY to avoid the error.
#Param p IPoint members promoted to SkScalar ##
@@ -245,7 +243,7 @@ pt: nan, -nan abs: nan, nan
##
##
-#SeeAlso set Make negate
+#SeeAlso set Make negate
#Method ##
@@ -1258,12 +1256,21 @@ Returns the dot product of Vector and Vector vec.
#Struct SkPoint ##
-#Topic Point ##
# ------------------------------------------------------------------------------
-#Topic Vector
+#Subtopic Vector
+#Line # alias for Point ##
+ #Alias Vector
#Alias Vectors
#Typedef SkPoint SkVector
+ #Line # alias for Point ##
+ #Code
+ typedef SkPoint SkVector;
+ ##
+ SkVector provides an alternative name for SkPoint. SkVector and SkPoint can
+ be used interchangably for all purposes.
#Typedef ##
##
+
+#Topic Point ##
diff --git a/docs/SkRect_Reference.bmh b/docs/SkRect_Reference.bmh
index d3ba4c3dd7..73225fcc88 100644
--- a/docs/SkRect_Reference.bmh
+++ b/docs/SkRect_Reference.bmh
@@ -2,16 +2,10 @@
#Alias Rects
#Alias Rect_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Struct SkRect
SkRect holds four SkScalar coordinates describing the upper and
-lower bounds of a rectangle. SkRect may be created from outer bounds or
+lower bounds of a rectangle. SkRect may be created from outer bounds or
from position, width, and height. SkRect describes an area; if its right
is less than or equal to its left, or if its bottom is less than or equal to
its top, it is considered empty.
@@ -20,9 +14,13 @@ its top, it is considered empty.
SkRect can be constructed from int values to avoid compiler warnings that
integer input cannot convert to SkScalar without loss of precision.
+#Subtopic Overview
+#Populate
+##
+
#Subtopic Related_Function
#Populate
-#Subtopic ##
+##
#Subtopic Member_Function
#Populate
@@ -70,7 +68,7 @@ Returns constructed Rect set to (0, 0, 0, 0).
Many other rectangles are empty; if left is equal to or greater than right,
or if top is equal to or greater than bottom. Setting all members to zero
is a convenience, but does not designate a special empty rectangle.
-
+
#Return bounds (0, 0, 0, 0) ##
#Example
@@ -274,7 +272,7 @@ rect: -10, 35, 5, 60 isEmpty: false
#In Constructor
#Line # constructs from ISize returning (0, 0, width, height) ##
-Returns constructed IRect set to (0, 0, size.width(), size.height()).
+Returns constructed IRect set to (0, 0, size.width(), size.height()).
Does not validate input; size.width() or size.height() may be negative.
#Param size integer values for Rect width and height ##
@@ -399,7 +397,7 @@ sorted: {20, 40, 20, 50} is sorted
#In Property
#Line # returns true if no member is infinite or NaN ##
Returns true if all values in the rectangle are finite: SK_ScalarMin or larger,
-and SK_ScalarMax or smaller.
+and SK_ScalarMax or smaller.
#Return true if no member is infinite or NaN ##
@@ -700,7 +698,7 @@ left: 2e+38 right: 3e+38 centerX: inf safe mid x: 2.5e+38
#In Operator
#Line # returns true if members are equal ##
-Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
+Returns true if all members in a: fLeft, fTop, fRight, and fBottom; are
equal to the corresponding members in b.
a and b are not equal if either contain NaN. a and b are equal if members
@@ -731,7 +729,7 @@ contain zeroes width different signs.
tests are equal
{0, 0, 2, 2} == {-0, -0, 2, 2} and are numerically equal
{0, 0, 2, 2} == {-0, -0, 2, 2} and are numerically equal
-{0, 0, 2, 2} == {-0, -0, 2, 2} and are numerically equal
+{0, 0, 2, 2} == {-0, -0, 2, 2} and are numerically equal
##
##
@@ -745,7 +743,7 @@ tests are equal
#In Operator
#Line # returns true if members are unequal ##
-Returns true if any in a: fLeft, fTop, fRight, and fBottom; does not
+Returns true if any in a: fLeft, fTop, fRight, and fBottom; does not
equal the corresponding members in b.
a and b are not equal if either contain NaN. a and b are equal if members
@@ -760,7 +758,7 @@ contain zeroes width different signs.
SkRect test = {0, 0, 2, SK_ScalarNaN};
SkDebugf("test with NaN is %s" "equal to itself\n", test == test ? "" : "not ");
#StdOut
-test with NaN is not equal to itself
+test with NaN is not equal to itself
##
##
@@ -782,10 +780,10 @@ test with NaN is not equal to itself
#In As_Points
#Line # returns four corners as Point ##
Returns four points in quad that enclose Rect ordered as: top-left, top-right,
-bottom-right, bottom-left.
+bottom-right, bottom-left.
#Private
-Consider adding param to control whether quad is CW or CCW.
+Consider adding param to control whether quad is clockwise or counterclockwise.
##
#Param quad storage for corners of Rect ##
@@ -802,7 +800,7 @@ Consider adding param to control whether quad is CW or CCW.
SkDebugf("\n");
#StdOut
rect: {1, 2, 3, 4}
-corners: {1, 2} {3, 2} {3, 4} {1, 4}
+corners: {1, 2} {3, 2} {3, 4} {1, 4}
##
##
@@ -937,7 +935,7 @@ rect: {0, 0, 0, 0} is empty
#In Set
#Line # sets to SkScalar input (left, top, right, bottom) and others ##
Sets Rect to src, promoting src members from integer to Scalar.
-Very large values in src may lose precision.
+Very large values in src may lose precision.
#Param src integer Rect ##
@@ -1071,7 +1069,7 @@ sorted and may be empty. Does not check to see if values are finite.
#Example
#Description
-p0 and p1 may be swapped and have the same effect unless one contains NaN.
+p0 and p1 may be swapped and have the same effect unless one contains NaN.
##
SkPoint point1 = {SK_ScalarNaN, 8};
SkPoint point2 = {3, 4};
@@ -1092,7 +1090,7 @@ p0 and p1 may be swapped and have the same effect unless one contains NaN.
#In Set
#Line # sets to SkScalar input (x, y, width, height) ##
-Sets Rect to
+Sets Rect to
#Formula
(x, y, x + width, y + height)
##
@@ -1155,7 +1153,7 @@ rect: -15, 0, 0, 25 isEmpty: false
#Subtopic Set ##
#Subtopic From_Integers
-#Line # set Scalar values from integer input ##
+#Line # sets Scalar values from integer input ##
#Populate
@@ -1238,7 +1236,7 @@ Returns Rect offset by (dx, dy).
If dx is negative, Rect returned is moved to the left.
If dx is positive, Rect returned is moved to the right.
If dy is negative, Rect returned is moved upward.
-If dy is positive, Rect returned is moved downward.
+If dy is positive, Rect returned is moved downward.
#Param dx added to fLeft and fRight ##
#Param dy added to fTop and fBottom ##
@@ -1273,7 +1271,7 @@ Returns Rect, inset by (dx, dy).
If dx is negative, Rect returned is wider.
If dx is positive, Rect returned is narrower.
If dy is negative, Rect returned is taller.
-If dy is positive, Rect returned is shorter.
+If dy is positive, Rect returned is shorter.
#Param dx added to fLeft and subtracted from fRight ##
#Param dy added to fTop and subtracted from fBottom ##
@@ -1308,7 +1306,7 @@ Returns Rect, outset by (dx, dy).
If dx is negative, Rect returned is narrower.
If dx is positive, Rect returned is wider.
If dy is negative, Rect returned is shorter.
-If dy is positive, Rect returned is taller.
+If dy is positive, Rect returned is taller.
#Param dx subtracted to fLeft and added from fRight ##
#Param dy subtracted to fTop and added from fBottom ##
@@ -1343,7 +1341,7 @@ Offsets Rect by adding dx to fLeft, fRight; and by adding dy to fTop, fBottom.
If dx is negative, moves Rect to the left.
If dx is positive, moves Rect to the right.
If dy is negative, moves Rect upward.
-If dy is positive, moves Rect downward.
+If dy is positive, moves Rect downward.
#Param dx offset added to fLeft and fRight ##
#Param dy offset added to fTop and fBottom ##
@@ -1372,7 +1370,7 @@ fTop, fBottom.
If delta.fX is negative, moves Rect to the left.
If delta.fX is positive, moves Rect to the right.
If delta.fY is negative, moves Rect upward.
-If delta.fY is positive, moves Rect downward.
+If delta.fY is positive, moves Rect downward.
#Param delta added to Rect ##
@@ -1475,9 +1473,9 @@ rect: 5, 1, 55, 86
#Subtopic Inset_Outset_Offset ##
#Subtopic Intersection
-#Line # set to shared bounds ##
+#Line # sets to shared bounds ##
-Rects intersect when they enclose a common area. To intersect, each of the pair
+Rects intersect when they enclose a common area. To intersect, each of the pair
must describe area; fLeft is less than fRight, and fTop is less than fBottom;
empty() returns false. The intersection of Rect pair can be described by:
@@ -1618,11 +1616,11 @@ be before or after the call to intersect.
SkRect leftRect = { 10, 40, 50, 80 };
SkRect rightRect = { 30, 60, 70, 90 };
SkDebugf("%s intersection: ", leftRect.intersect(rightRect) ? "" : "no ");
- SkDebugf("%g, %g, %g, %g\n", leftRect.left(), leftRect.top(),
+ SkDebugf("%g, %g, %g, %g\n", leftRect.left(), leftRect.top(),
leftRect.right(), leftRect.bottom());
#StdOut
intersection: 30, 60, 50, 80
-##
+##
##
#SeeAlso intersects Intersects join SkIRect::intersect
@@ -1657,11 +1655,11 @@ be before or after the call to intersect.
##
SkRect leftRect = { 10, 40, 50, 80 };
SkDebugf("%s intersection: ", leftRect.intersect(30, 60, 70, 90) ? "" : "no ");
- SkDebugf("%g, %g, %g, %g\n", leftRect.left(), leftRect.top(),
+ SkDebugf("%g, %g, %g, %g\n", leftRect.left(), leftRect.top(),
leftRect.right(), leftRect.bottom());
#StdOut
intersection: 30, 60, 50, 80
-##
+##
##
#SeeAlso intersects Intersects join SkIRect::intersect
@@ -1690,7 +1688,7 @@ Returns false if either a or b is empty, leaving Rect unchanged.
result.left(), result.top(), result.right(), result.bottom());
#StdOut
intersection: 30, 60, 50, 80
-##
+##
##
#SeeAlso intersects Intersects join SkIRect::intersect
@@ -1721,7 +1719,7 @@ Returns false if either construction or Rect is empty, or do not intersect.
SkDebugf("%s intersection", rect.intersects(30, 60, 70, 90) ? "" : "no ");
#StdOut
intersection
-##
+##
##
#SeeAlso intersect Intersects SkIRect::Intersects
@@ -1745,7 +1743,7 @@ Returns false if either r or Rect is empty, or do not intersect.
SkDebugf("%s intersection", rect.intersects({30, 60, 70, 90}) ? "" : "no ");
#StdOut
intersection
-##
+##
##
#SeeAlso intersect Intersects SkIRect::Intersects
@@ -1770,7 +1768,7 @@ Returns false if either a or b is empty, or do not intersect.
SkDebugf("%s intersection", SkRect::Intersects({10, 40, 50, 80}, {30, 60, 70, 90}) ? "" : "no ");
#StdOut
intersection
-##
+##
##
#SeeAlso intersect intersects SkIRect::Intersects
@@ -1780,7 +1778,7 @@ Returns false if either a or b is empty, or do not intersect.
#Subtopic Intersection ##
#Subtopic Join
-#Line # set to union of bounds ##
+#Line # sets to union of bounds ##
#Populate
@@ -1809,7 +1807,7 @@ Rect to construction.
SkDebugf("join: %g, %g, %g, %g\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
#StdOut
join: 10, 20, 55, 65
-##
+##
##
#SeeAlso joinNonEmptyArg joinPossiblyEmptyRect SkIRect::join
@@ -1834,7 +1832,7 @@ Rect to r.
SkDebugf("join: %g, %g, %g, %g\n", rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
#StdOut
join: 10, 20, 55, 65
-##
+##
##
#SeeAlso joinNonEmptyArg joinPossiblyEmptyRect SkIRect::join
@@ -1870,7 +1868,7 @@ Since Rect is not sorted, first result is copy of toJoin.
#StdOut
rect: 50, 60, 55, 65
sorted: 10, 0, 55, 100
-##
+##
##
#SeeAlso join joinPossiblyEmptyRect SkIRect::join
@@ -1882,7 +1880,7 @@ sorted: 10, 0, 55, 100
#Method void joinPossiblyEmptyRect(const SkRect& r)
#In Join
-#Line # sets to union of bounds. Skips empty check for both ##
+#Line # sets to union of bounds; skips empty check for both ##
Sets Rect to the union of itself and the construction.
May produce incorrect results if Rect or r is empty.
@@ -1903,7 +1901,7 @@ Since Rect is not sorted, first result is not useful.
#StdOut
rect: 10, 60, 55, 65
sorted: 10, 0, 55, 100
-##
+##
##
#SeeAlso joinNonEmptyArg join SkIRect::join
@@ -1977,7 +1975,7 @@ round: 30, 50, 41, 61
# ------------------------------------------------------------------------------
-#Method void roundOut(SkRect* dst) const
+#Method void roundOut(SkRect* dst) const
#In Rounding
Sets Rect by discarding the fractional portion of fLeft and fTop; and
@@ -2129,7 +2127,7 @@ sorted: 20.5, 10.5, 30.5, 50.5
#In Sorting
#In Constructor
-#Line # constructs, ordering sides from smaller to larger ##
+#Line # constructs Rect, ordering sides from smaller to larger ##
Returns Rect with fLeft and fRight swapped if fLeft is greater than fRight; and
with fTop and fBottom swapped if fTop is greater than fBottom. Result may be empty;
and width() and height() will be zero or positive.
@@ -2180,7 +2178,7 @@ rect.asScalars() == &rect.fLeft
#Method void dump(bool asHex) const
#In Property
#Line # sends text representation to standard output using floats ##
-Writes text representation of Rect to standard output. Set asHex to true to
+Writes text representation of Rect to standard output. Set asHex to true to
generate exact binary representations of floating point numbers.
#Param asHex true if SkScalar values are written as hexadecimal ##
@@ -2239,8 +2237,8 @@ directly compiled as C++ code. Floating point values are written
in hexadecimal to preserve their exact bit pattern. The output reconstructs the
original Rect.
-Use instead of dump() when submitting
-#A bug reports against Skia # http://bug.skia.org ##
+Use instead of dump() when submitting
+#A bug reports against Skia # https://bug.skia.org ##
.
#Example
diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh
index 0c4b43483b..01df8b80d6 100644
--- a/docs/SkSurface_Reference.bmh
+++ b/docs/SkSurface_Reference.bmh
@@ -1,12 +1,6 @@
#Topic Surface
#Alias Surface_Reference
-#Subtopic Overview
- #Subtopic Subtopic
- #Populate
- ##
-##
-
#Class SkSurface
SkSurface is responsible for managing the pixels that a canvas draws into. The pixels can be
@@ -16,9 +10,17 @@ surface->getCanvas() to use that canvas (but don't delete it, it is owned by the
SkSurface always has non-zero dimensions. If there is a request for a new surface, and either
of the requested dimensions are zero, then nullptr will be returned.
+#Subtopic Overview
+#Populate
+##
+
+#Subtopic Constant
+#Populate
+##
+
#Subtopic Related_Function
#Populate
-#Subtopic ##
+##
#Subtopic Member_Function
#Populate
@@ -542,7 +544,7 @@ selects whether allocation for pixels is tracked by context. imageInfo
describes the pixel format in Color_Type, and transparency in
Alpha_Type, and color matching in Color_Space.
-sampleCount requests the number of samples per pixel.
+sampleCount requests the number of samples per pixel.
Pass zero to disable Multi_Sample_Anti_Aliasing. The request is rounded
up to the next supported count, or rounded down if it is larger than the
maximum supported count.
@@ -607,7 +609,7 @@ selects whether allocation for pixels is tracked by context. imageInfo
describes the pixel format in Color_Type, and transparency in
Alpha_Type, and color matching in Color_Space.
-sampleCount requests the number of samples per pixel.
+sampleCount requests the number of samples per pixel.
Pass zero to disable Multi_Sample_Anti_Aliasing. The request is rounded
up to the next supported count, or rounded down if it is larger than the
maximum supported count.
@@ -858,7 +860,7 @@ surface generationID: 3
# ------------------------------------------------------------------------------
#Enum ContentChangeMode
-
+#Line # parameter options for notifyContentWillChange ##
#Code
enum ContentChangeMode {
kDiscard_ContentChangeMode,
@@ -869,10 +871,12 @@ surface generationID: 3
ContentChangeMode members are parameters to notifyContentWillChange.
#Const kDiscard_ContentChangeMode
+#Line # discards surface on change ##
Pass to notifyContentWillChange to discard surface contents when
the surface is cleared or overwritten.
##
#Const kRetain_ContentChangeMode
+#Line # preserves surface on change ##
Pass to notifyContentWillChange when to preserve surface contents.
If a snapshot has been generated, this copies the Surface contents.
##
@@ -900,7 +904,7 @@ Subsequent calls to generationID return a different value.
mode is normally passed as kRetain_ContentChangeMode.
#Private
-CAN WE DEPRECATE THIS?
+Can we deprecate this?
##
#Param mode one of: kDiscard_ContentChangeMode, kRetain_ContentChangeMode ##
@@ -924,7 +928,7 @@ CAN WE DEPRECATE THIS?
# ------------------------------------------------------------------------------
#Enum BackendHandleAccess
-
+#Line # options to read and write back-end object ##
#Code
enum BackendHandleAccess {
kFlushRead_BackendHandleAccess,
@@ -941,23 +945,26 @@ CAN WE DEPRECATE THIS?
##
#Const kFlushRead_BackendHandleAccess 0
+#Line # back-end object is readable ##
Caller may read from the back-end object.
##
#Const kFlushWrite_BackendHandleAccess 1
+#Line # back-end object is writable ##
Caller may write to the back-end object.
##
#Const kDiscardWrite_BackendHandleAccess 2
+#Line # back-end object must be overwritten ##
Caller must overwrite the entire back-end object.
##
#Const kFlushRead_TextureHandleAccess 0
-#Deprecated
+#Deprecated
##
#Const kFlushWrite_TextureHandleAccess 1
-#Deprecated
+#Deprecated
##
#Const kDiscardWrite_TextureHandleAccess 2
-#Deprecated
+#Deprecated
##
#NoExample
@@ -975,7 +982,7 @@ Caller must overwrite the entire back-end object.
int y = 20;
SkString str;
paint.setTextSize(16);
- for (auto access : { SkSurface::kFlushRead_BackendHandleAccess,
+ for (auto access : { SkSurface::kFlushRead_BackendHandleAccess,
SkSurface::kFlushWrite_BackendHandleAccess,
SkSurface::kDiscardWrite_BackendHandleAccess } ) {
sk_sp<SkImage> image(gpuSurface->makeImageSnapshot());
@@ -1012,7 +1019,7 @@ Caller must overwrite the entire back-end object.
#Method GrBackendTexture getBackendTexture(BackendHandleAccess backendHandleAccess)
#In Property
#Line # returns the GPU reference to texture ##
-Retrieves the backend texture. If Surface has no backend texture, an invalid
+Retrieves the back-end texture. If Surface has no back-end texture, an invalid
object is returned. Call GrBackendTexture::isValid to determine if the result
is valid.
@@ -1037,7 +1044,7 @@ The returned GrBackendTexture should be discarded if the Surface is drawn to or
#In Property
#Line # returns the GPU reference to render target ##
-Retrieves the backend render target. If Surface has no backend render target, an invalid
+Retrieves the back-end render target. If Surface has no back-end render target, an invalid
object is returned. Call GrBackendRenderTarget::isValid to determine if the result
is valid.
@@ -1094,7 +1101,7 @@ does not share the same pixels.
Returns nullptr if imageInfo width or height are zero, or if imageInfo
is incompatible with Surface.
-
+
#Param imageInfo width, height, Color_Type, Alpha_Type, Color_Space,
of Surface; width and height must be greater than zero
##
@@ -1170,7 +1177,7 @@ Blend_Mode, and Draw_Looper.
#Param x horizontal offset in Canvas ##
#Param y vertical offset in Canvas ##
#Param paint Paint containing Blend_Mode, Color_Filter, Image_Filter,
- and so on; or nullptr
+ and so on; or nullptr
##
#Example
@@ -1342,7 +1349,7 @@ Does not copy, and returns false if:
for (int x : { 32, -32 } ) {
for (int y : { 32, -32 } ) {
surf->readPixels(info, data->writable_data(), info.minRowBytes(), x, y);
- }
+ }
}
sk_sp<SkImage> image = SkImage::MakeRasterData(info, data, info.minRowBytes());
canvas->drawImage(image, 0, 0);
@@ -1401,7 +1408,7 @@ Does not copy, and returns false if:
for (int x : { 32, -32 } ) {
for (int y : { 32, -32 } ) {
surf->readPixels(bitmap, x, y);
- }
+ }
}
canvas->drawBitmap(bitmap, 0, 0);
##
@@ -1418,7 +1425,7 @@ Does not copy, and returns false if:
Copies Rect of pixels from the src Pixmap to the Surface.
Source Rect corners are (0, 0) and (src.width(), src.height()).
-Destination Rect corners are (dstX, dstY) and
+Destination Rect corners are (dstX, dstY) and
#Formula
(dstX + Surface width(), dstY + Surface height())
##
@@ -1501,7 +1508,7 @@ surf.props(): kRGB_H_SkPixelGeometry
#Method void flush()
#In Utility
-#Line # resolve pending I/O ##
+#Line # resolves pending I/O ##
Issues pending Surface commands to the GPU-backed API and resolves any Surface MSAA.
Skia flushes as needed, so it is not necessary to call this if Skia manages
@@ -1520,7 +1527,7 @@ GPU calls.
#Method GrSemaphoresSubmitted flushAndSignalSemaphores(int numSemaphores,
GrBackendSemaphore signalSemaphores[])
#In Utility
-#Line # resolve pending I/O, and signal ##
+#Line # resolves pending I/O, and signal ##
Issues pending Surface commands to the GPU-backed API and resolves any Surface MSAA.
After issuing all commands, signalSemaphores of count numSemaphores semaphores
@@ -1541,7 +1548,7 @@ with which they were created.
If GrSemaphoresSubmitted::kNo is returned, the GPU back-end did not create or
add any semaphores to signal on the GPU; the caller should not instruct the GPU
-to wait on any of the semaphores.
+to wait on any of the semaphores.
Pending surface commands are flushed regardless of the return result.
@@ -1561,7 +1568,7 @@ Pending surface commands are flushed regardless of the return result.
#Method bool wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores)
#In Utility
-#Line # rause commands until signaled ##
+#Line # pauses commands until signaled ##
Inserts a list of GPU semaphores that the current GPU-backed API must wait on before
executing any more commands on the GPU for this surface. Skia will take ownership of the
underlying semaphores and delete them once they have been signaled and waited on.
@@ -1646,7 +1653,7 @@ Return true if Surface supports characterization. Raster_Surface returns false.
canvas->drawString("characterization unsupported", 20, 40, paint);
return;
}
- // start of threadable work
+ // start of threadable work
SkDeferredDisplayListRecorder recorder(characterization);
SkCanvas* subCanvas = recorder.getCanvas();
subCanvas->clear(SK_ColorGREEN);
@@ -1686,7 +1693,7 @@ Raster_Surface returns false.
canvas->drawString("characterization unsupported", 20, 40, paint);
return;
}
- // start of threadable work
+ // start of threadable work
SkDeferredDisplayListRecorder recorder(characterization);
SkCanvas* subCanvas = recorder.getCanvas();
subCanvas->clear(SK_ColorGREEN);
diff --git a/docs/catalogHeader.txt b/docs/catalogHeader.txt
index 0ca0568cd2..45a40d30a4 100644
--- a/docs/catalogHeader.txt
+++ b/docs/catalogHeader.txt
@@ -1,6 +1,6 @@
<!DOCTYPE html>
-<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
+<html lang="en" xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
diff --git a/docs/illustrations.bmh b/docs/illustrations.bmh
index 48b844ac78..ef528adf60 100644
--- a/docs/illustrations.bmh
+++ b/docs/illustrations.bmh
@@ -1,6 +1,6 @@
#Topic Illustrations
-#Subtopic Image_Info_Color_Type_BGR_565
+#Subtopic Image_Info_Color_Type_RGB_565
#Example
#Width 415
#Height 250
@@ -43,7 +43,7 @@ void draw(SkCanvas* canvas) {
canvas->drawLine(5 + e[0] * 20, yPos + i * 15, 5 + e[count] * 20, yPos + i * 15, p);
}
};
- SkScalar edges[] = { 0, 5, 11, 16,
+ SkScalar edges[] = { 0, 5, 11, 16,
0, 3, 8,
0, 5, 8 };
const char* labels[] = { "red", "green", "blue" };
@@ -54,7 +54,7 @@ void draw(SkCanvas* canvas) {
##
##
-#Subtopic Image_Info_Color_Type_ABGR_4444
+#Subtopic Image_Info_Color_Type_ARGB_4444
#Example
#Width 415
#Height 250
@@ -156,7 +156,7 @@ void draw(SkCanvas* canvas) {
##
##
-#Subtopic Image_Info_Color_Type_RGB_888x
+#Subtopic Image_Info_Color_Type_RGB_888
#Example
#Width 812
#Height 365
@@ -323,7 +323,7 @@ void draw(SkCanvas* canvas) {
##
##
-#Subtopic Image_Info_Color_Type_RGB_101010x
+#Subtopic Image_Info_Color_Type_RGB_101010
#Example
#Width 812
#Height 380
diff --git a/docs/markup.bmh b/docs/markup.bmh
index 2127fc71f4..7e4d98b7d5 100644
--- a/docs/markup.bmh
+++ b/docs/markup.bmh
@@ -1,7 +1,7 @@
#Topic Bookmaker_Markup
# redefine markup character so examples below will not be parsed
-###$
+###$
Text, except for the single markup character, requires no annotation.
@@ -71,7 +71,7 @@ description
method description
the _method_reference must be unique within the class
-#Method type name(params..)
+#Method type name(params..)
description
#Param name description ##
#Return return ##
@@ -83,6 +83,6 @@ description
#ToDo description ##
$ restore markup character
-$$$#
+$$$#
##
diff --git a/docs/undocumented.bmh b/docs/undocumented.bmh
index 84f4f90d3b..d0efc87680 100644
--- a/docs/undocumented.bmh
+++ b/docs/undocumented.bmh
@@ -1,9 +1,9 @@
# external references that will be documented eventually ...
#External
DirectWrite TrueType Windows Linux Android iOS __ANDROID_API__ AHardwareBuffer
- FreeType FreeType-based Harfbuzz
- Descenders Kerning Unhinted
- LCD RGB sRGB YUV
+ FreeType FreeType-based Harfbuzz
+ Descenders Kerning Unhinted
+ LCD RGB sRGB YUV SDTV HDTV
YUV_Component_Y YUV_Component_U YUV_Component_V
Unicode Unicode5 UTF-8 UTF-16 UTF-32 ASCII Unichar
API
@@ -15,6 +15,9 @@
NaN NaNs
Bezier_Curve Coons_Patch Cartesian_Coordinate Euclidean_Distance Euclidean_Space Mip_Map
C C++ Destructor Subclasses
+ CSS HTML
+ HTML_Gray HTML_DarkGray HTML_LightGray HTML_Silver HTML_Lime HTML_Green HTML_Aqua HTML_Fuchsia
+ SVG_lightgray SVG_darkgray
SkUserConfig # not external, but still thinking about how markup refers to this
SkXXX.h # ditto
SkXXX_Reference # ditto
@@ -34,6 +37,7 @@
SK_HAS_WEBP_LIBRARY # ditto
SK_IGNORE_GPU_DITHER # ditto
SK_PMCOLOR_BYTE_ORDER # ditto
+ SK_WARN_UNUSED_RESULT # ditto
# FreeType related
FT_LOAD_TARGET_LIGHT
@@ -50,11 +54,6 @@ FT_Load_Glyph
#Alias Aliasing
##
-#Topic Anti-alias
-#Alias Anti-aliased
-#Alias Anti-aliasing
-##
-
#Topic Arc
#Alias Arcs
#Topic ##
@@ -96,10 +95,10 @@ FT_Load_Glyph
#Topic Color_Filter
#Class SkColorFilter
-#Method void toString(SkString* str) const
+#Method void toString(SkString* str) const
##
#Class ##
-#Topic ##
+##
#Topic Color_Space
#Class SkColorSpace
@@ -163,7 +162,7 @@ FT_Load_Glyph
#Topic Device
#Class SkBaseDevice
##
-#Topic ##
+##
#Topic Document
#Class SkDocument
@@ -186,7 +185,7 @@ FT_Load_Glyph
#Topic Draw_Looper
#Class SkDrawLooper
#Class ##
-#Topic ##
+##
#Topic Drawable
#Class SkDrawable
@@ -195,7 +194,7 @@ FT_Load_Glyph
##
##
-#Topic Encoded_Image_Format
+# to be in topic Encoded_Image_Format
#EnumClass SkEncodedImageFormat
#Const kUnknown 0
##
@@ -224,7 +223,7 @@ FT_Load_Glyph
#Const kHEIF 12
##
##
-#Topic ##
+# end of topic Encoded_Image_Format
#Topic Filter_Quality
#Enum SkFilterQuality
@@ -267,9 +266,6 @@ FT_Load_Glyph
#Topic GPU_Context
#Substitute GPU context
-#Subtopic Resource_Cache_Limits
-#Alias Resource_Cache_Limits
-##
#Class GrContext
#Method void flush()
##
@@ -292,14 +288,15 @@ FT_Load_Glyph
##
#Topic Image_Filter
-#Subtopic Scaling
-#Subtopic ##
#Class SkImageFilter
-#Method void toString(SkString* str) const
+#Method void toString(SkString* str) const
##
#Class ##
#Topic ##
+#Class SkImageGenerator
+##
+
#Topic Image_Scaling
##
@@ -308,20 +305,23 @@ FT_Load_Glyph
##
##
-#Topic Left_Side_Bearing
+#Topic Left_Side_Bearing
##
#Topic Line
#Alias Lines
#Topic ##
-#Topic Malloc_Pixel_Ref
+# to be in Topic Malloc_Pixel_Ref
#Class SkMallocPixelRef
#Method static sk_sp<SkPixelRef> MakeZeroed(const SkImageInfo&, size_t rowBytes)
##
#Method static sk_sp<SkPixelRef> MakeAllocate(const SkImageInfo&, size_t rowBytes)
##
##
+# end of Topic Malloc_Pixel_Ref
+
+#Struct SkMask
##
#Topic Mask_Alpha
@@ -329,12 +329,12 @@ FT_Load_Glyph
#Topic Mask_Filter
#Class SkMaskFilter
-#Method void toString(SkString* str) const
+#Method void toString(SkString* str) const
##
#Class ##
#Topic ##
-#Topic Math
+# to be in Topic Math
#Method static inline bool sk_64_isS32(int64_t value)
##
#Method SkIntToScalar(x)
@@ -355,7 +355,7 @@ FT_Load_Glyph
##
#Method template <typename D, typename S> inline bool SkTFitsIn(S s)
##
-##
+# end of Topic Math
#Topic Meta_Data
#Class SkMetaData
@@ -368,10 +368,10 @@ FT_Load_Glyph
#Topic Nine_Patch
##
-#Topic Number_Types
+# to be in Topic Number_Types
#Typedef uint16_t SkGlyphID
#Typedef ##
- #Subtopic Scalar
+ #Topic Scalar
#Alias Scalar
#Typedef float SkScalar
#Typedef ##
@@ -397,6 +397,9 @@ FT_Load_Glyph
#Const SK_ScalarNaN
to be written
##
+ #Const SK_ScalarNearlyZero
+ to be written
+ ##
#Const SK_MinS32
to be written
##
@@ -410,7 +413,7 @@ FT_Load_Glyph
#Typedef ##
#Typedef unsigned U8CPU
#Typedef ##
-#Topic ##
+# end of Topic Number_Types
#Topic OS_X
#Substitute OS X
@@ -442,14 +445,16 @@ FT_Load_Glyph
#Class ##
#Topic ##
-#Topic Path_Measure
+# to be in Topic Path_Measure
#Class SkPathMeasure
#Method void dump() const
##
##
-##
+# end of Topic Path_Measure
#Topic PathOps
+ #Enum SkPathOp
+ ##
#Method bool SK_API Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result)
##
#Topic ##
@@ -515,6 +520,8 @@ FT_Load_Glyph
#Topic Raster_Handle_Allocator
#Class SkRasterHandleAllocator
+ #Typedef void* Handle
+ ##
#Struct Rec
##
#Method static std::unique_ptr<SkCanvas> MakeCanvas(std::unique_ptr<SkRasterHandleAllocator>, const SkImageInfo&, const Rec* rec = nullptr)
@@ -528,12 +535,10 @@ FT_Load_Glyph
#Topic Raster_Surface
##
-#Topic Rasterizer
+# to be in Topic Rasterizer
#Class SkRasterizer
#Class ##
-#Subtopic Layer
-#Subtopic ##
-#Topic ##
+# end of Topic Rasterizer
#Topic Reference_Count
#Substitute SkRefCnt
@@ -584,8 +589,6 @@ FT_Load_Glyph
const SkMatrix* localMatrix = nullptr)
##
#Class ##
-#Subtopic Gradient
-#Subtopic ##
#Topic ##
#Topic Size
@@ -598,8 +601,8 @@ FT_Load_Glyph
#Topic ##
#Topic Stream
-#Class SkStream
-#Class ##
+#Class SkWStream
+##
#Topic ##
#Topic String
@@ -663,25 +666,23 @@ FT_Load_Glyph
#Class ##
#Topic ##
-#Topic Types
+# to be defined in types
#Typedef intptr_t GrBackendObject
#Typedef ##
#Enum GrSurfaceOrigin
- #Const kBottomLeft_GrSurfaceOrigin 0
+ #Const kBottomLeft_GrSurfaceOrigin 0
##
#Const kTopLeft_GrSurfaceOrigin 1
##
#Enum ##
- #Subtopic Budgeted
#EnumClass SkBudgeted
#Const kNo 0
##
#Const kYes 1
##
#EnumClass ##
- ##
#EnumClass GrSemaphoresSubmitted
#Const kNo 0
@@ -689,26 +690,23 @@ FT_Load_Glyph
#Const kYes 1
##
#EnumClass ##
-#Topic ##
+# end of defined in types
#Topic Unpremultiply
#Alias Unpremultiplied
##
#Topic Vertices
+#Class SkVertices
+##
#Subtopic Colors
##
#Subtopic Texs
##
#Topic ##
-#Topic Read_Buffer
+# to be in Topic Read_Buffer
#Struct SkReadBuffer
#Struct ##
-##
-
-#Topic Write_Buffer
- #Struct SkWriteBuffer
- #Struct ##
-#Topic ##
+# end of Topic Read_Buffer
diff --git a/docs/usingBookmaker.bmh b/docs/usingBookmaker.bmh
index 5261e61b44..d804a3e37f 100644
--- a/docs/usingBookmaker.bmh
+++ b/docs/usingBookmaker.bmh
@@ -15,7 +15,7 @@ How to use the Bookmaker utility.
#Subtopic Broken_Build
-If the
+If the
#A Housekeeper-PerCommit-Bookmaker # https://status.skia.org/repo/skia?filter=search&search_value=Housekeeper-PerCommit-Bookmaker ##
bot is red, the bot has detected that the files in docs and include/core differ.
@@ -290,7 +290,7 @@ any of the above commands with -a docs/status.json in place of
#Subtopic Bugs
Bookmaker bugs are tracked
-#A here # bug.skia.org/6898 ##
+#A here # https://bug.skia.org/6898 ##
.
##